Git, not SQL.
That’s the headline, isn’t it? For a free, public Minecraft data API, the creator ditched the entire database apparatus. No PostgreSQL. No Redis. Not even a cloud function. Just a VPS, Next.js, TypeScript, and a whole lot of .ts files. It’s a bold move. It’s also, surprisingly, brilliant.
The Problem They Solved
Look, if you need structured data for Minecraft – think mob HP, drop tables, biome temperatures, enchantment caps – your options are grim. Scrape the wiki and spend a week bathing in your own tears of data-cleaning despair. Or use Mojang’s official APIs, which are laughably limited to player profiles and skins. Neither is ideal for anything beyond a hobby project. Our developer needed more. Much more.
The requirement was simple: a free, no-signup, CORS-open JSON API for everything. Mobs, biomes, items, enchantments, structures, commands, you name it. And it had to be free. And easy to use. Hosted on a single, unassuming VPS. What could possibly go wrong?
Why the ‘No Database’ Bet Pays Off
This is where things get spicy. The core of the API’s data lives in flat TypeScript files. export const MOBS: Mob[] = [...]. Every mob, every biome, every item is a constant defined right there in the code. Why? Three solid reasons.
1. Static Data, Static Life. Minecraft data is, for the most part, static. A Creeper’s HP today is its HP tomorrow. The only real changes come with game patches, which happen maybe four times a year. Write performance is a non-issue. Durability? Git handles that beautifully.
2. Git Diffs Are Your Friend. When Mojang nerfs something, you get a clean Git diff. A pull request. A history. You can git revert with a smile. Try doing that with a row in a mobs table updated via pgAdmin. Good luck.
3. TypeScript Catches Your Blunders. Forget a field? Forget to type something correctly? Your IDE screams at you before deployment. No runtime errors. No 500s because someone forgot to validate an incoming data point. A database would require an extra layer of validation – Zod, perhaps – adding complexity.
The only real cost? Loading the entire dataset into memory on startup. For now, it’s a laughably small 4MB. If this scales to a colossal 100,000 records, then, maybe, just maybe, we revisit the database question. Until then, why add overhead?
The Plumbing: Next.js, Nginx, and Zero Frills
So, how does it actually work? Next.js 15’s App Router is the backbone. TypeScript keeps things clean. Nginx handles TLS and URL rewrites, directing traffic to a simple next start process. No queues. No complex orchestration. It’s pure, unadulterated server-side rendering goodness, albeit for an API.
Each endpoint is a distinct file. This might sound like duplication, but it’s a deliberate choice. It allows for endpoint-specific filters, unique type signatures, and tailored validation. The extra six lines of code per file are a small price for clarity, apparently. And the ?pretty=true parameter? A small but brilliant touch for anyone peeking at the API in a browser. Developer experience matters, even for public APIs.
The trade-off you accept with
*[for CORS]: you cannot ever attach auth without changing the policy. That’s a problem for future-me. Future-me can deal with it.
That CORS policy. Access-Control-Allow-Origin: *. It’s essential for a public API. Anyone can hit it from anywhere, no proxy needed. Discord bots, static sites, you name it. The author is refreshingly pragmatic about the security implication: if auth is ever needed, this policy breaks. But for now? It’s perfect. It’s a problem for future him. And that’s a mindset we can all appreciate.
Is This The Future? Probably Not. But It’s Smart.
Will every public API now abandon databases for flat files and Git? Unlikely. When you’re dealing with user-generated content, real-time updates, or massive, dynamic datasets, a database is non-negotiable. But for this specific niche – a well-defined, relatively static public dataset – this approach is a masterclass in efficiency. It strips away unnecessary complexity, embraces the tools at hand, and delivers a performant, maintainable solution.
It’s a reminder that sometimes, the simplest solution is the best. And for Minecraft players needing data, this free API is a godsend. No fuss. No fees. Just data. Built on the bedrock of Git and TypeScript. Clever.