[{"data":1,"prerenderedAt":130},["ShallowReactive",2],{"project-partybox":3},{"id":4,"title":5,"available":6,"badges":7,"body":11,"client":106,"date":107,"description":108,"development":109,"duration":110,"extension":111,"image":112,"meta":113,"navigation":109,"path":114,"preview_type":10,"privacy":115,"role":116,"seo":117,"short_description":118,"status":119,"stem":120,"technology":121,"url":101,"weight":128,"__hash__":129},"projects/projects/partybox.md","PartyBox",false,[8,9,10],"code","design","mobile",{"type":12,"value":13,"toc":100},"minimark",[14,21,24,29,57,61,97],[15,16,17,20],"p",{},[18,19,5],"strong",{}," 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.",[15,22,23],{},"I built it to learn how to make a lobby between users without a permanent game server.",[25,26,28],"h2",{"id":27},"how-the-lobby-works","How the lobby works",[30,31,32,39,45,51],"ul",{},[33,34,35,38],"li",{},[18,36,37],{},"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.",[33,40,41,44],{},[18,42,43],{},"WebRTC data channels through PeerJS."," A signalling broker is used only to exchange addresses. After that the traffic goes directly between phones.",[33,46,47,50],{},[18,48,49],{},"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.",[33,52,53,56],{},[18,54,55],{},"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.",[25,58,60],{"id":59},"code-structure","Code structure",[30,62,63,73,91],{},[33,64,65,68,69,72],{},[18,66,67],{},"The transport is an adapter."," Room and game logic depend on a small ",[8,70,71],{},"Transport"," interface, so WebRTC can be replaced with another implementation (for example socket.io) without changing the games.",[33,74,75,78,79,82,83,86,87,90],{},[18,76,77],{},"Games are state reducers that run on the host."," Each game is a module with ",[8,80,81],{},"createRound"," and ",[8,84,85],{},"handleAction",". Games with hidden roles also define ",[8,88,89],{},"privateCardFor",", and that data is sent only to the player it belongs to.",[33,92,93,96],{},[18,94,95],{},"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.",[15,98,99],{},"The app is a Nuxt 4 SPA with Nuxt UI, available in Polish and English, and packaged for Android with Capacitor.",{"title":101,"searchDepth":102,"depth":102,"links":103},"",2,[104,105],{"id":27,"depth":102,"text":28},{"id":59,"depth":102,"text":60},"Personal Project","2026-09-02","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.",true,"~2 months","md","partybox.webp",{},"/projects/partybox",null,"Fullstack Developer",{"title":5,"description":108},"Mobile party game: one lobby, mini-games, every player on their own phone, connected peer-to-peer without a game server","In development","projects/partybox",[122,123,124,125,126,127],"nuxt","vue","typescript","tailwind","capacitor","webrtc",85,"E_t1JW0On-7ykcaHCsXLbNUtqvmpXXGKbfFRSGabFSA",1795685028863]