Over two evenings in June I built a small Minecraft clone that runs in the browser: procedurally generated terrain you can mine and build in, an inventory and crafting system, animals and night mobs, real voxel lighting, flowing water and lava, and a save system. It is written in plain JavaScript modules with Three.js, has no build step, and is deployed on Vercel behind a password gate. This note is a plain account of what it is, how it was built, and how it got from a folder on my Mac to a live URL.
The purpose
I wanted to see how far a browser game could get with the simplest possible stack: ES modules served as static files, one rendering library loaded from a CDN, and nothing to install or compile. The design document from the first evening says it directly: “No build step, no install. Open the page and play.” The second goal was to make it a game rather than a tech demo, so the early-game survival loop had to work end to end: gather, craft, build, and survive the first night.
What it is
Voxel Survival is a first-person voxel world generated from seeded noise in 16×16 chunks that stream in around the player, so it feels endless. You break and place blocks with the mouse, craft tools in tiers from wood to diamond, smelt ore in a furnace, hunt animals for food, and fight zombies, skeletons and spiders after dark. An objective chain at the top of the screen walks a new player through the first day. Worlds autosave to the browser as a seed plus a diff of your edits, so a save stays tiny, and you can keep several named worlds and export or import them as files.
By the end of the second day it had more than forty block types, including a stone family and a full ore set with depth-based generation, plants that need ground under them, slabs and stairs with proper collision and auto-step, fences, walls and glass panes that join their neighbours, doors and trapdoors that open, and sand and gravel that fall.
How it was built
The process was the same one I use for client work, applied to a game: talk through what it should be, write a short design document, turn that into a plan of small tasks, and implement each task with a test first. The first evening produced one design document and a playable sandbox. The second day went slice by slice, and each slice got its own document before any code: block expansion, real lighting, liquids, multi-block structures, and a scrolling hotbar. The multi-block slice alone has an 18-task plan.
The commit log tells the story in order. Terrain and controls on the first night; then materials and ores, plants, block orientation, gravity, slabs, stairs and auto-step; then the lighting rewrite; then walls, fences and panes; then seven phases of liquids; then doors, trapdoors, gates and tall plants; and finally a hotbar that scrolls instead of overflowing. Fifty-one commits in about twenty-five hours of wall-clock time, most of them small and named for the slice they belong to.
How it works
1. World and meshing
A seeded noise module shapes the terrain: grass, dirt and stone layers, water at sea level, sand near water, snow on peaks, and trees. The world stores blocks per chunk with one metadata byte each, which carries orientation and open/closed state. A mesher turns each chunk into geometry, emitting only the faces that touch air or water, and re-meshes a chunk only when its blocks change. Textures are drawn procedurally onto a canvas atlas at startup, so the project ships no image files at all.
2. Light
Lighting is baked, not computed by the GPU. Two per-voxel channels, skylight and block light, are flood-filled with a one-per-step falloff and written into each chunk’s mesh as vertex colours. Terrain renders unlit because the bake is the lighting, which is why caves are genuinely dark and a torch glows with a real gradient. Placing or breaking a block relights only the affected area. The algorithm is a pure module with its own unit tests.
3. Liquids
Water and lava flow with a simplified version of Minecraft’s rules: sources spread through thinning levels, prefer to fall before spreading sideways, and two water sources make a third. Flow is derived state. Only sources are saved and the spread is recomputed on load, so a flooded cave costs nothing in the save file. Where water meets lava it makes obsidian or cobblestone. The player swims, drowns without air, takes lava damage and burns for a few seconds afterwards, and a bucket lets you move sources around.
4. Everything else
Collision works on per-block boxes rather than assuming every block is a cube, which is what makes slabs, stairs, fences and open doors behave. Mobs spawn by reading the real light level. The crafting system is a flat ingredient list rather than a grid. Each of these lives in its own module, and the registries are data: adding a block is one entry in the block table plus a tile in the texture module, and the mesher, hotbar, crafting and saving pick it up without further changes.
Testing
Three layers. Unit tests on the pure logic (noise, blocks, items, inventory, crafting, objectives, world, lighting, fluids, multi-block, the login gate) run on Node’s built-in test runner and pass 136 for 136 today. A browser harness boots fixtures instead of the real game and checks physics, mob AI, combat, swimming and drowning. A manual playtest checklist covers the things no automation can judge, like whether jumping feels right or whether the fog hides chunk pop-in.
Getting it live on Vercel
Because there is no build step, deployment is the easy part. The repository is on GitHub and Vercel serves it as static files: the project config sets no framework, no build command and the repository root as the output directory. Three.js arrives through an import map pointing at a CDN, so the first load needs an internet connection and nothing else.
The one piece of server code is the gate. I did not want the game public, so a Vercel Routing Middleware runs at the edge on every request and, unless the request carries a valid cookie, serves a small login page. A single serverless function checks the submitted password against an environment variable and, on success, sets an HttpOnly cookie holding a hash of the password rather than the password itself. If the variable is unset the site fails closed. The whole thing is a few dozen lines, lives in three files, and has its own unit tests. A local static server does not run the middleware, so the gate applies only to the deployed site.
export const config = { runtime: 'edge', matcher: '/((?!api/login).*)' };
By the numbers
| Measure | Value |
|---|---|
| Build window | June 13 to 14, 2026, two evenings and a day |
| Commits | 51 |
| Source | 23 modules, about 3,600 lines |
| Design documents | 5, plus one 18-task plan |
| Unit tests | 136, all passing |
| Block types | 40 and counting |
| Dependencies | Three.js, loaded from a CDN |
| Hosting | Vercel, static files plus one edge middleware and one function |
What is not built
Obsidian exists and needs a diamond pickaxe, but the Nether and End dimensions, portals and end-game tools are only scaffolded as documented hooks. Doors do not swing on a true hinge. Redstone does not exist, so iron doors open by hand. The expensive hole-seeking behaviour of real Minecraft water is deliberately left out. None of this blocks the first-day loop, which was the point.
What I took from it is that the stack was never the limit. Two days of small, specified, tested slices got a playable game with real lighting and flowing water, and the deployment was a git push.