Skip to content
Ridho KurniawanWeb + DataContact me on Upwork
01Multiplayer game platformIndependent project

Main Berdua

A browser game platform for two people, with five games, private rooms, and chat. Players join with a nickname and room code, and each game shares the same session system.

  • Next.js
  • TypeScript
  • Neon Postgres
  • Drizzle ORM
  • Tailwind CSS
  • Vitest
Main Berdua catalog showing five games for couples
Live demoOpen in browser
01 / Context

The problem

The project started as a single snakes-and-ladders game. As I added more games, I needed a shared system for rooms, players, and chat, while keeping each game’s rules separate.

Both browsers also needed the same current state. Quiz answers had to stay hidden until both players submitted, turn-based games had to track the active player, and the maze needed to save shared resources and progress.

02 / Approach

How I built it

I separated the shared multiplayer system from the individual game engines.

Next.js handles the interface and server-side operations. A common platform layer manages rooms, players, chat, game selection, and session status. Each game module owns its own rules, state transitions, and UI.

Drizzle maps the data model to Neon Postgres. Stable data such as room identity, players, messages, turns, and status uses relational columns. Game-specific state is stored as JSONB because the board game, quizzes, streak game, and maze require different data structures.

03 / Product highlights

How people use it

01

Join a private room

A host chooses a game, enters a nickname, and receives a room code to share. The second player joins from another browser without creating an account. Both clients connect to the same room record and persisted game session.

02

Choose from five games

The catalog includes a story-led board game, two hidden-answer couple quizzes, a choice-and-streak game, and a cooperative 7×7 maze. A game registry connects each catalog entry to an isolated game module, while room and chat behavior stays shared.

03

Keep both players in sync

Hidden-answer games store each submission separately and reveal the result only when both players are ready. Turn-based games persist the active player and current state. The maze adds shared resources, protective abilities, and cooperative progress without requiring a separate multiplayer foundation.

5Playable game modes
2Players in each room
0Accounts required
04 / Evidence

What the app does now

The app has five playable games using the same room, player, and chat system. New games can reuse that foundation.

I deployed it on Vercel with Neon Postgres. A production smoke test covered creating a room, loading the board, and checking that its data remained available after a page reload.

05 / Engineering decisions

Technical choices

01

Separate platform responsibilities from game rules

Room creation, joining, chat, reusable UI, and the game registry belong to the shared platform. Rules and state transitions stay inside each game module. This limits coupling and makes individual games easier to change.

02

Combine relational data with flexible game state

Rooms, players, turns, and messages have predictable structures, so they use relational fields. JSONB stores the parts that vary between games. This avoids forcing five different rule systems into one rigid schema.

03

Save sessions without requiring accounts

Players join with a room code and nickname. The server stores the session state so both browsers use the same room data.

04

Test reusable game behavior

Vitest covers shared configurable question-selection behavior. TypeScript and production builds catch integration problems across the platform and individual game modules.

06 / Validation

Checks I ran

  • Verified the five game entries and their room-onboarding flows in the deployed application.
  • Created a production room and confirmed that its state survived a browser reload.
  • Ran TypeScript, lint, production-build, and targeted Vitest checks before deployment.
07 / Next iteration

Next steps

  1. 01Measure room creation, successful joins, game completion, and reconnect failures for each game.
  2. 02Add clearer room-expiration and reconnection behavior for interrupted sessions.
  3. 03Audit keyboard navigation, focus states, motion, and screen-reader behavior across every game.

Work with me

Tell me what you’d like to build.