Inspiration

We wanted to transform the solitary experience of tracking daily habits into a collaborative, gamified journey. "Iron Empire" was inspired by classic 16-bit arcade games and the strong community aspect of Reddit. We asked ourselves: What if we could build a daily progression RPG that users play directly within their Reddit feed, where individual fitness consistency contributes to upgrading a shared, subreddit-wide gym?

What we learned

Building "Iron Empire" pushed our understanding of the Reddit Devvit platform. We learned how to seamlessly bridge a serverless Node.js backend with an embedded HTML iframe. Specifically, we gained deep insights into syncing state between the Devvit Redis instance and a Phaser 3 game loop, ensuring smooth performance and secure data validation using tRPC. We also learned how to implement a paper-doll system for modular avatar progression based on user stats.

How we built it

We utilized the Reddit Devvit Web platform as our foundation.

Frontend: The user interface is built with React and compiled via Vite. Inside the React app, we embedded a Phaser 3 canvas which handles the interactive, rhythm-based workout minigames. The visual design leans heavily into a retro aesthetic with a CRT-style overlay and pixel-art assets. Backend: Our serverless backend runs on Node.js using Hono as the web framework. We used tRPC (v11) to maintain strict end-to-end type safety between our Devvit server and the iframe client. State Management: We leveraged Devvit's built-in Redis store to handle user progress, community points, and daily streaks. Progression Logic: We implemented a decay function that runs on login to simulate muscle loss if the user skips their daily routine. The mathematical model we used is based on exponential decay.

Challenges we faced

One of our biggest hurdles was maintaining the stability of the animation and paper-doll system across different mobile and web viewports, ensuring the Phaser canvas fits cleanly inside a standard Reddit post frame. We also had to resolve tricky connectivity issues during playtesting when communicating between the iFrame and Devvit backend. Finally, orchestrating the Reddit DM notification scheduler to keep user retention high required careful planning of our backend event triggers.

Built With

Share this project:

Updates

Submission history