Back to portfolio
WebappStudy / personalFeatured

Ghici Cine (Guess Who)

A multiplayer browser party game with private rooms, words submitted by participants, real-time synchronized turns, per-player filtered state, and reconnection to the active session.

Ghici Cine (Guess Who)

Core stack

React 19
TypeScript 6
Vite 8
Tailwind CSS 3
Socket.IO Client 4vite-plugin-pwaNode.jsExpress 5Socket.IO 4UUIDJestts-jestPM2

The challenge

The main challenge was synchronizing an ephemeral match across multiple browsers without a database, keeping the server as the source of truth and sending each player only the information they are allowed to see. The flow had to handle joining a room, all participants getting ready, turn rotation, avoiding one's own words, the active player disconnecting, transferring host responsibilities, and reconnecting without losing the current state.

The solution

The solution separates game rules from the real-time transport layer. A RoomManager keeps rooms in a server-side Map, and domain functions manage the word pool, the circular turn order, connected players, advancing the turn, and building the per-client filtered state. Socket.IO handlers validate the identity associated with the socket, the host role, the room phase, and the right to perform the action, then emit individual updates to participants. The frontend centralizes listeners and session state in a React hook, saves temporary identifiers in localStorage, and displays distinct screens for creation, lobby, gameplay, reveal, end, and reconnection.

Notable complexity

Ghici Cine digitalizes a social game in which participants try to guess a word that everyone else can see. A player creates a room, sets the number of words per participant, and shares the numeric access code. Each person joins from their own browser, submits their word list, and the game starts automatically once all eligible players are ready.

The backend keeps the authoritative state of each room in memory and coordinates the game via Socket.IO events. Words are gathered into a shared pool, shuffled, and allocated per turn, avoiding, when possible, the words submitted by the active player. For every update, the server builds a different state per participant: the person whose turn it is does not receive the current word, while everyone else sees it and can follow the rotation, the number of remaining words, and connection status.

The player's temporary identity is UUID-based and kept locally in the browser for reconnection. On return, the new socket is associated with the same session, and the word and turn are restored without exposing the active player's information. The host can manage disconnected participants and skip a blocked turn, and the end of the match summarizes the words guessed and abandoned. The React frontend is responsive and configured as a PWA, and the backend includes a health check, graceful shutdown, and PM2 configuration for running on a VPS.

Key results

  • Private rooms generated with a unique six-digit numeric code
  • Multiplayer lobby with a participant list, online/offline status, and readiness progress
  • Shared word pool, shuffling, and selection that avoids one's own submissions when alternatives exist
  • Round-robin turn rotation, skipping disconnected players
  • Authoritative server-side state and a personalized payload for each participant
  • Server-side hiding of the word from the active player
  • Reconnection via a locally persisted UUID and reassociating a new socket with the existing match
  • Host controls for removing participants and unblocking turns for offline players
  • Final summary with all words and the guessed or abandoned outcome
  • PWA configuration with manifest, service worker, icons, and screenshots for desktop and mobile
  • Jest tests for game rules, room state, and reconnection scenarios
  • PM2 configuration, health endpoint, and graceful shutdown for running on a VPS

Related projects

Want something similar?

Start with the estimate wizard — answer a few questions and get a realistic price range and timeline.