Reddit Hackathon – Initial thoughts

Disclaimer: This post was not ai generated

So I was going through reddit the other day and noticed an ad for a Reddit hackathon. It’s been awhile since I’ve done a hackathon, so I immediately took a look and signed up. Diving into the criteria for the hackathon, it is centered around reddits app framework, devvit, to create engaging interactive apps. From the requirements, they are looking for apps or games with user generated content, or to drive daily usage.

Getting started

Getting started with a sample app was as simple as chosing a tempate from developers.reddit.com. Once you chose a template, it will generate details on how to pull down your project and generate a dev /r that your appplication will be deployed to. I forget exactly what all it gives you in the process, I think tokens, and atleast a npx command to pull down your project. Once you run the npx command, your project will be pulled down with a really good starter template. The entire project is setup, and you can deploy everything in seconds. Getting started is as simple as:

npm install
npm run dev

Once you run the dev command, it will automatically deploy to reddits dev environment, and provide a url to a dev subreddit that you can access your app through for testing.

Devvit Phaser Stack

So once I got everything pulled down locally, and was able to see the app in action, it was time to go through the code and see what’s going on. For my template I chose the phaser stack, as I want to create a 2d game. This generated a mono repo with the frontend project, and backend projects with basic setup as shown below:

Backend

The backend project is based around express, which is nice as this is a framework that I know very well. Plus, SwizzyWeb is directly compatible with express, so I was thinking about integrating the entire thing as a swizzyweb service.

Frontend

For the frontend project, I didn’t really do much deep dive here yet. But your given pages containing basic forms with buttons and basic logic. I’ll dive deeper into this when I get to that point, stay tuned for future posts.

Dependencies

The backend framework itself is basically built around express js, with reddits custom devit framework. In total there are only 4 runtime depenencies as follows:

    "@devvit/web": "0.12.0",
    "devvit": "0.12.0",
    "express": "5.1.0",
    "phaser": "3.88.2"

That is basically all you have to work with. I attempted to install some of my own dependencies, but once deployed it appeared that those additional packages are ignored. This makes sense escpecially with all of the recent supply chain attacks. Locking down packages to these few well trusted and maintained packages reduces the risk of reddit hosting potentially malicious services on their infrastructure that could potentially open vulnerabilities into their systems. They are hosting all of this for you after all.

Redis

The devvit fraemwork includes a free Redis instance built into the library giving your app persistent storage. It’s basically a free database paid for by reddit. I think that’s pretty cool. I have yet to use it, but I think it is could resolve some issues I am facing running my dev server.

What will I make?

So the hackathon was already about 1 week in when I started, leaving me with 2 weeks to build a production ready submission, so I had to act fast. But I noticed that the hackathon is about creating games, and I remembered a game before that I created 10 years ago for a java course I took in college, and then rebuilt 5 years ago as a mobile app on android and IOS with multiplayer. Coincidentally, Apple just removed it from their app store last week, and I have battled with google to keep it on google play, but at this point I haven’t checked in awhile and it may have been removed.

Why?

This has been a real frustration for me, and even more so seeing a lot of opinions online blaming developers for being lazy and not updating their app. The argument goes like this:

Developer: My app still works great, why does it matter when I last updated it if it’s not broken and is still supported by devices?

Redditors: All you have to do is update it, you can even just recompile and upload a bumped version of the same app. Your just being lazy

Me: I would love to update my app, but the language, frameworks, and libraries I depend on got completely re-written and would require an entire rewrite of my frontend. I tried to rollback to the older versions, but for the life of me I cannot figure out the versions I need to get it compiled. So now I have a game that works, on all of my devices, but once I uninstall from my phones will be lost forever (unless I have backups on github). Over the 5 years I have had this app on the app store $500, charged $0 for it, and now it is gone forever.

Redditors: Your game probably sucks anyway

Me: Downvoted to oblivion

Me: Publishes same game on reddit

Final thoughts and Next steps

Overall I’m very impressed with the ease of getting up and running. It is a pleasant experience and stupid simple to get going. This is the ease of use I’m looking to implement for SwizzyWeb, and I’m very excited to dive deeper into devvit.

Over the next 2 weeks I will be working on the app, maybe just on weekends. I plan to post about it throughout that time and provide updates on how the project is going, and any learnings I can share. I look forward to learning more about devvit and get my game up and running before the end of the hackathon.

Keep it swizzy

J

Leave a Comment