We by Evgenii Zamyatin.
Managed to write a dystopian-future-as-allegory-for-Stalinism in the early 1920's.
It's worth pointing out that
We was written from 1917-1920, and is not a predictor of "Stalinism" but a reaction to the October Revolution and the subsequent extreme restrictions placed on basic human liberties. Zamyatin certainly predicts many future restrictions and eliminations of freedoms, but the predictions cannot have been of "Stalinism," because he was drawing on events already taking place, and at the time of writing it was not known who Lenin's successor would be, nor that he'd be dead in a few years. Given this, I think the book is more accurately described as "dystopian-future-as-allegory-for-Russia-if-Lenin-remains-in-power."