Orius Games API
One of my many tasks that I’ve worked on for Orius Games is their API. This API is used to power many of their games, and it’s a very important part of the company’s business.
The API was originally written in Node.js using the Express framework. This original version was created in just over a week back in 2023, and it wasn’t very advanced, with a lot of hardcoded data and secrets pulled directly from process.env.
In order to reduce costs, it got rewritten in 2024 using Next.js and TypeScript. This version is much more advanced, and it was a lot easier to maintain. It was also more secure, with better error handling and validation, including the use of the zod and t3-oss/env libraries to parse and validate both the incoming requests and the environment variables.
However, after the Vercel CEO made some questionable decisions, we pulled all our code from Vercel, and took this as an opportunity to rewrite the API a final time, back into a proper API framework. This time, it was using Hono, a new framework that I’ve been using for a seperate project, and it’s been a lot of fun to work with.
It only took a day to port the API from Next.js to Hono, and since then it’s been a lot more stable and secure. It also uses zod and t3-oss/env, but now it’s a lot easier to maintain and update, with more of the logic being abstracted away into reusable functions.
Unfortunately, I’m not allowed to share the code right now, but in future it will be open sourced as we move away to a new, more secure API. However, you can try it out inside some of the games we’ve made, including Duck Simulator 2 and Moderator Simulator, as it powers the account and achievements systems.