← BACK TO HOME
CASE STUDYDEPLOYED

hyprverse

Real-timeROLE — FULL-STACK BUILD

A cozy 2D pixel campus for people who study together online — voice fades up as you approach someone, side conversations happen by stepping away, and key-gated rooms hold seated video calls.

TYPESCRIPTSOCKET.IOLIVEKITPHASER
space.raja-dev.me
hyprverse — live preview

PROOF

MEASURED, SOURCED
125
COMMITS ON MAIN
GitHub API — repos/Anuraj-dev/2d-metaverse/commits
78 / 87
PULL REQUESTS MERGED / OPENED
GitHub search API — repo:Anuraj-dev/2d-metaverse is:pr
34 DAYS
FIRST COMMIT TO LATEST
GitHub API — 21 Jun to 25 Jul 2026
OPEN REPOSITORY EVIDENCE (3)
86.8%
TYPESCRIPT BY BYTES
GitHub API — /languages, 1.59 MB of 1.83 MB
478
FILES TRACKED ON MAIN
GitHub API — git/trees/main?recursive=1
3
WORKSPACES SHARING ONE WIRE CONTRACT
Repository README — shared, backend, frontend

THE PROBLEM

WHAT NEEDED SOLVING

An online degree means the people you study with are people you never stand next to. A video call is the obvious substitute and it is a poor one, because a call permits exactly one conversation and puts everybody inside it. Nobody drifts to the side of the room, nobody leans over for a quiet word, and leaving is a visible event rather than a step. What is missing is not video quality — it is presence and the ordinary social freedom of a shared space: being near some people and not others, and being able to change that by moving. The objective was a space that restores those affordances in a browser tab, for a group that has no shared building to meet in.

THE APPROACH

HOW IT WAS BUILT

The space is a styled 2D campus rendered in Phaser, which each person walks as a character. Audio is positional: LiveKit tracks are mixed by distance, so a voice rises as you approach and fades as you leave, and privacy becomes a matter of walking somewhere else rather than of finding a menu. Two other conversation shapes sit on top of that — key-gated meeting rooms with seated video for a deliberate huddle, and a stage that broadcasts one speaker to everybody in the world at once. Underneath, the build is an npm-workspaces monorepo whose defining rule is that every wire payload exists exactly once: the shared package holds zod schemas, the backend validates against them at runtime, and the frontend imports only the inferred types, which are erased at compile time so zod never ships to the browser.

FIELD NOTES

PROBLEMS HIT — AND RESOLVED
  1. 01

    ONE CONVERSATION IS THE DEFECT

    The thing to fix was not fidelity but topology. A call is a single room everyone shares; a real space is a continuum where distance decides who can hear you. Audio is therefore mixed as a function of position rather than routed to a room, which is what makes a side conversation possible without a UI for it — two people walk away from the group and are simply no longer audible to it. Privacy stops being a feature and becomes a consequence of geometry.

  2. 02

    ONE CONTRACT, NOT TWO COPIES OF IT

    A realtime app is a stream of socket payloads, and the usual failure is a frontend and backend that each keep their own idea of a payload's shape until a field is renamed on one side only. That mismatch cannot be caught by either codebase alone and surfaces in production. Every event payload and REST shape is declared once as a zod schema in the shared workspace; the server safeParses it, the client imports the inferred type. A disagreement about a field is now a compile error, and adding an event is a fixed six-step path the type checker walks you through.

  3. 03

    THREE WAYS TO TALK, ONE WORLD

    Proximity audio alone cannot carry every kind of conversation — an intentional meeting needs to exclude passers-by, and an announcement needs to reach a whole campus that is spread across it. Rather than overloading proximity with exceptions, two explicit modes sit beside it: rooms whose access is key-gated and which switch participants to seated video, and a stage that promotes one participant to everybody. Each mode has its own membership rules, so the audio model never has to special-case itself.

  4. 04

    A SHARED WORKSPACE BREAKS EVERY DEPLOY ASSUMPTION

    The single-source contract that fixes the runtime bugs quietly breaks every build tool that assumes a package is self-contained. The backend's Docker image has to be built with the repository root as its context, not the backend directory, because it depends on a sibling workspace; the Vercel project's root directory has to be the repo root for the same reason; and the shared package must be built before either consumer will even typecheck. CI encodes that ordering in every job — lint, typecheck, tests, integration compose, a contract smoke test, and Playwright end-to-end against the composed backend.

CAPABILITIES

WHAT IT ACTUALLY DOES
  • Walkable 2D pixel campus in Phaser — you move a character, not a cursor
  • Named places to be, not just a map: a hostel, a stage, a game arcade
  • Distance-mixed proximity audio over LiveKit: voices rise and fade as you move
  • Key-gated meeting rooms that switch participants to seated video
  • A stage that broadcasts one speaker to everyone in the world
  • Every socket and REST payload defined once as a zod schema in a shared workspace