Back FoxCode
code design mobile

Project

PartyBox

Mobile party game: one lobby, mini-games, every player on their own phone, connected peer-to-peer without a game server

Nuxt Vue TypeScript Tailwind Capacitor WebRTC

Date

September 2026

Client

Personal Project

Role

Fullstack Developer

Duration

~2 months

Status

In development

PartyBox is a party game for people sitting in one room. The host creates a lobby, everyone else joins with a code or by scanning a QR, and the group plays on their own phones. There are 54+ mini-games in five categories: bluff and deduction, party classics, "think like the group", knowledge and reflex, and tournament mini-games.

I built it to learn how to make a lobby between users without a permanent game server.

How the lobby works

  • The host's phone is the server. It keeps the whole game state and sends it to the other players. The topology is a star: clients talk only to the host.
  • WebRTC data channels through PeerJS. A signalling broker is used only to exchange addresses. After that the traffic goes directly between phones.
  • TURN as a fallback. Phones on mobile data behind CGNAT often cannot open a direct connection, so the app can relay through TURN. I run my own PeerJS broker and coturn on a VPS with short-lived TURN credentials, and the public PeerJS broker stays as a backup.
  • Reconnects. The room uses a hello message, a heartbeat and a reconnect loop on the client. The host saves a snapshot of the room, so after an app restart it can rebuild the same room under the same code and the players rejoin.

Code structure

  • The transport is an adapter. Room and game logic depend on a small Transport interface, so WebRTC can be replaced with another implementation (for example socket.io) without changing the games.
  • Games are state reducers that run on the host. Each game is a module with createRound and handleAction. Games with hidden roles also define privateCardFor, and that data is sent only to the player it belongs to.
  • Tests. The game modules are covered by a Vitest suite of about 390 test cases. In dev mode there is a panel of test bots, which lets me play every game alone by acting as each player in turn.

The app is a Nuxt 4 SPA with Nuxt UI, available in Polish and English, and packaged for Android with Capacitor.

PartyBox screenshot 1