# sreenathkalluri/guessmate architecture

> Architecture diagram of the GitHub repository sreenathkalluri/guessmate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sreenathkalluri/guessmate
- Repository: https://github.com/sreenathkalluri/guessmate

## Overview

GuessMate is a browser-based, in-person party game: players authenticate anonymously, create or join a room, ready up, submit identity guesses, and see final standings. The app routes from room state to lobby, active game, or winner views; a shared context coordinates auth, room listening, and game actions. Firebase Auth and Firestore provide identity and real-time room state. README capability claims include security rules and offline/error handling; those are noted, but unsampled implementations and uncertain links are not expanded.

Main entry points: [`src/context/GameContext.jsx`](https://github.com/sreenathkalluri/guessmate/blob/main/src/context/GameContext.jsx) (Shared game state), [`src/services/roomService.js`](https://github.com/sreenathkalluri/guessmate/blob/main/src/services/roomService.js) (Room lifecycle), [`src/firebase/auth.js`](https://github.com/sreenathkalluri/guessmate/blob/main/src/firebase/auth.js) (Firebase Auth adapter), [`src/App.jsx`](https://github.com/sreenathkalluri/guessmate/blob/main/src/App.jsx) (App state router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Game experience"]
  node_app_router["App state router<br/>[App.jsx]"]
  node_home["Create or join<br/>[Home.jsx]"]
  node_lobby["Ready lobby<br/>[Lobby.jsx]"]
  node_game_view["Live guessing<br/>[Game.jsx]"]
  node_winner_view["Winner standings<br/>[Winner.jsx]"]
  node_guess_modal["Guess search dialog<br/>[GuessModal.jsx]"]
  node_player_list["Player list<br/>[PlayerList.jsx]"]
  node_scoreboard["Scoreboards<br/>[Scoreboard.jsx]"]
end

subgraph group_coordination["App coordination"]
  node_game_context["Shared game state<br/>[GameContext.jsx]"]
  node_auth_hook["Auth state hook<br/>[useAuth.js]"]
  node_room_hook["Room sync hook<br/>[useRoom.js]"]
  node_idle_timer["Idle monitoring<br/>[useIdleTimer.js]"]
  node_session_service["Activity tracking<br/>[sessionService.js]"]
end

subgraph group_game_domain["Game services"]
  node_room_service["Room lifecycle<br/>[roomService.js]"]
  node_game_service["Game rules and scoring<br/>[gameService.js]"]
  node_actor_service["Actor search and assignment<br/>[actorService.js]"]
  node_actor_data["Actor dataset<br/>[actors.json]"]
  node_session_utils["Room and name utilities<br/>[session.js]"]
end

subgraph group_firebase_layer["Firebase infrastructure"]
  node_firebase_auth["Firebase Auth adapter<br/>[auth.js]"]
  node_firebase_config["Firebase app config<br/>[config.js]"]
  node_firestore_adapter["Firestore adapter<br/>[firestore.js]"]
  node_firestore[("Firestore")]
  node_firebase_identity["Firebase Authentication"]
end

node_players(("Players"))

node_players -->|"create or join"| node_home
node_app_router -->|"provides state"| node_game_context
node_app_router -->|"routes to"| node_home
node_app_router -->|"routes to"| node_lobby
node_app_router -->|"routes to"| node_game_view
node_app_router -->|"routes to"| node_winner_view
node_home -->|"requests room actions"| node_game_context
node_game_context -->|"reads auth state"| node_auth_hook
node_game_context -->|"subscribes to room"| node_room_hook
node_game_context -->|"dispatches room actions"| node_room_service
node_game_context -->|"dispatches game actions"| node_game_service
node_auth_hook -->|"subscribes to auth"| node_firebase_auth
node_room_hook -->|"watches room"| node_room_service
node_game_view -->|"submits guesses"| node_game_context
node_game_view -->|"opens dialog"| node_guess_modal
node_game_view -->|"renders scores"| node_scoreboard
node_winner_view -->|"renders standings"| node_scoreboard
node_lobby -->|"renders players"| node_player_list
node_guess_modal -->|"searches actors"| node_actor_service
node_room_service -->|"reads and writes"| node_firestore_adapter
node_room_service -->|"ensures identity"| node_firebase_auth
node_room_service -->|"generates room code"| node_session_utils
node_game_service -->|"reads and writes"| node_firestore_adapter
node_game_service -->|"uses identity"| node_firebase_auth
node_game_service -->|"assigns identities"| node_actor_service
node_actor_service -->|"loads dataset"| node_actor_data
node_idle_timer -->|"tracks activity"| node_session_service
node_session_service -->|"removes idle player"| node_room_service
node_session_service -->|"updates activity"| node_firestore_adapter
node_session_service -->|"ensures identity"| node_firebase_auth
node_firebase_auth -->|"initializes auth"| node_firebase_config
node_firestore_adapter -->|"uses app config"| node_firebase_config
node_firebase_auth -->|"authenticates anonymously"| node_firebase_identity
node_firestore_adapter -->|"stores room state"| node_firestore

click node_app_router "https://github.com/sreenathkalluri/guessmate/blob/main/src/App.jsx"
click node_home "https://github.com/sreenathkalluri/guessmate/blob/main/src/pages/Home/Home.jsx"
click node_lobby "https://github.com/sreenathkalluri/guessmate/blob/main/src/pages/Lobby/Lobby.jsx"
click node_game_view "https://github.com/sreenathkalluri/guessmate/blob/main/src/pages/Game/Game.jsx"
click node_winner_view "https://github.com/sreenathkalluri/guessmate/blob/main/src/pages/Winner/Winner.jsx"
click node_guess_modal "https://github.com/sreenathkalluri/guessmate/blob/main/src/components/GuessModal.jsx"
click node_player_list "https://github.com/sreenathkalluri/guessmate/blob/main/src/components/PlayerList.jsx"
click node_scoreboard "https://github.com/sreenathkalluri/guessmate/blob/main/src/components/Scoreboard.jsx"
click node_game_context "https://github.com/sreenathkalluri/guessmate/blob/main/src/context/GameContext.jsx"
click node_auth_hook "https://github.com/sreenathkalluri/guessmate/blob/main/src/hooks/useAuth.js"
click node_room_hook "https://github.com/sreenathkalluri/guessmate/blob/main/src/hooks/useRoom.js"
click node_idle_timer "https://github.com/sreenathkalluri/guessmate/blob/main/src/hooks/useIdleTimer.js"
click node_session_service "https://github.com/sreenathkalluri/guessmate/blob/main/src/services/sessionService.js"
click node_room_service "https://github.com/sreenathkalluri/guessmate/blob/main/src/services/roomService.js"
click node_game_service "https://github.com/sreenathkalluri/guessmate/blob/main/src/services/gameService.js"
click node_actor_service "https://github.com/sreenathkalluri/guessmate/blob/main/src/services/actorService.js"
click node_actor_data "https://github.com/sreenathkalluri/guessmate/blob/main/src/data/actors.json"
click node_session_utils "https://github.com/sreenathkalluri/guessmate/blob/main/src/utils/session.js"
click node_firebase_auth "https://github.com/sreenathkalluri/guessmate/blob/main/src/firebase/auth.js"
click node_firebase_config "https://github.com/sreenathkalluri/guessmate/blob/main/src/firebase/config.js"
click node_firestore_adapter "https://github.com/sreenathkalluri/guessmate/blob/main/src/firebase/firestore.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_router,node_home,node_lobby,node_game_view,node_winner_view,node_guess_modal,node_player_list,node_scoreboard toneBlue
class node_game_context,node_auth_hook,node_room_hook,node_idle_timer,node_session_service toneAmber
class node_room_service,node_game_service,node_actor_service,node_actor_data,node_session_utils toneMint
class node_firebase_auth,node_firebase_config,node_firestore_adapter,node_firestore,node_firebase_identity toneRose
class node_players toneIndigo
```

## Components

### Game experience

- [App state router](https://github.com/sreenathkalluri/guessmate/blob/main/src/App.jsx): `src/App.jsx`
- [Create or join](https://github.com/sreenathkalluri/guessmate/blob/main/src/pages/Home/Home.jsx): `src/pages/Home/Home.jsx`
- [Ready lobby](https://github.com/sreenathkalluri/guessmate/blob/main/src/pages/Lobby/Lobby.jsx): `src/pages/Lobby/Lobby.jsx`
- [Live guessing](https://github.com/sreenathkalluri/guessmate/blob/main/src/pages/Game/Game.jsx): `src/pages/Game/Game.jsx`
- [Winner standings](https://github.com/sreenathkalluri/guessmate/blob/main/src/pages/Winner/Winner.jsx): `src/pages/Winner/Winner.jsx`
- [Guess search dialog](https://github.com/sreenathkalluri/guessmate/blob/main/src/components/GuessModal.jsx): `src/components/GuessModal.jsx`
- [Player list](https://github.com/sreenathkalluri/guessmate/blob/main/src/components/PlayerList.jsx): `src/components/PlayerList.jsx`
- [Scoreboards](https://github.com/sreenathkalluri/guessmate/blob/main/src/components/Scoreboard.jsx): `src/components/Scoreboard.jsx`

### App coordination

- [Shared game state](https://github.com/sreenathkalluri/guessmate/blob/main/src/context/GameContext.jsx): `src/context/GameContext.jsx`
- [Auth state hook](https://github.com/sreenathkalluri/guessmate/blob/main/src/hooks/useAuth.js): `src/hooks/useAuth.js`
- [Room sync hook](https://github.com/sreenathkalluri/guessmate/blob/main/src/hooks/useRoom.js): `src/hooks/useRoom.js`
- [Idle monitoring](https://github.com/sreenathkalluri/guessmate/blob/main/src/hooks/useIdleTimer.js): `src/hooks/useIdleTimer.js`
- [Activity tracking](https://github.com/sreenathkalluri/guessmate/blob/main/src/services/sessionService.js): `src/services/sessionService.js`

### Game services

- [Room lifecycle](https://github.com/sreenathkalluri/guessmate/blob/main/src/services/roomService.js): `src/services/roomService.js`
- [Game rules and scoring](https://github.com/sreenathkalluri/guessmate/blob/main/src/services/gameService.js): `src/services/gameService.js`
- [Actor search and assignment](https://github.com/sreenathkalluri/guessmate/blob/main/src/services/actorService.js): `src/services/actorService.js`
- [Actor dataset](https://github.com/sreenathkalluri/guessmate/blob/main/src/data/actors.json): `src/data/actors.json`
- [Room and name utilities](https://github.com/sreenathkalluri/guessmate/blob/main/src/utils/session.js): `src/utils/session.js`

### Firebase infrastructure

- [Firebase Auth adapter](https://github.com/sreenathkalluri/guessmate/blob/main/src/firebase/auth.js): `src/firebase/auth.js`
- [Firebase app config](https://github.com/sreenathkalluri/guessmate/blob/main/src/firebase/config.js): `src/firebase/config.js`
- [Firestore adapter](https://github.com/sreenathkalluri/guessmate/blob/main/src/firebase/firestore.js): `src/firebase/firestore.js`
- **Firestore**
- **Firebase Authentication**

### Other components

- **Players**

## Connections

- Players → Create or join: create or join (evidence: `src/pages/Home/Home.jsx`)
- App state router → Shared game state: provides state (evidence: `src/App.jsx`)
- App state router → Create or join: routes to (evidence: `src/App.jsx`)
- App state router → Ready lobby: routes to (evidence: `src/App.jsx`)
- App state router → Live guessing: routes to (evidence: `src/App.jsx`)
- App state router → Winner standings: routes to (evidence: `src/App.jsx`)
- Create or join → Shared game state: requests room actions (evidence: `src/pages/Home/Home.jsx`)
- Shared game state → Auth state hook: reads auth state (evidence: `src/context/GameContext.jsx`)
- Shared game state → Room sync hook: subscribes to room (evidence: `src/context/GameContext.jsx`)
- Shared game state → Room lifecycle: dispatches room actions (evidence: `src/context/GameContext.jsx`)
- Shared game state → Game rules and scoring: dispatches game actions (evidence: `src/context/GameContext.jsx`)
- Auth state hook → Firebase Auth adapter: subscribes to auth (evidence: `src/hooks/useAuth.js`)
- Room sync hook → Room lifecycle: watches room (evidence: `src/hooks/useRoom.js`)
- Live guessing → Shared game state: submits guesses (evidence: `src/pages/Game/Game.jsx`)
- Live guessing → Guess search dialog: opens dialog (evidence: `src/pages/Game/Game.jsx`)
- Live guessing → Scoreboards: renders scores (evidence: `src/pages/Game/Game.jsx`)
- Winner standings → Scoreboards: renders standings (evidence: `src/pages/Winner/Winner.jsx`)
- Ready lobby → Player list: renders players (evidence: `src/pages/Lobby/Lobby.jsx`)
- Guess search dialog → Actor search and assignment: searches actors (evidence: `src/components/GuessModal.jsx`)
- Room lifecycle → Firestore adapter: reads and writes (evidence: `src/services/roomService.js`)
- Room lifecycle → Firebase Auth adapter: ensures identity (evidence: `src/services/roomService.js`)
- Room lifecycle → Room and name utilities: generates room code (evidence: `src/services/roomService.js`)
- Game rules and scoring → Firestore adapter: reads and writes (evidence: `src/services/gameService.js`)
- Game rules and scoring → Firebase Auth adapter: uses identity (evidence: `src/services/gameService.js`)
- Game rules and scoring → Actor search and assignment: assigns identities (evidence: `src/services/gameService.js`)
- Actor search and assignment → Actor dataset: loads dataset (evidence: `src/services/actorService.js`)
- Idle monitoring → Activity tracking: tracks activity (evidence: `src/hooks/useIdleTimer.js`)
- Activity tracking → Room lifecycle: removes idle player (evidence: `src/services/sessionService.js`)
- Activity tracking → Firestore adapter: updates activity (evidence: `src/services/sessionService.js`)
- Activity tracking → Firebase Auth adapter: ensures identity (evidence: `src/services/sessionService.js`)
- Firebase Auth adapter → Firebase app config: initializes auth (evidence: `src/firebase/auth.js`)
- Firestore adapter → Firebase app config: uses app config (evidence: `src/firebase/firestore.js`)
- Firebase Auth adapter → Firebase Authentication: authenticates anonymously (evidence: `README.md`)
- Firestore adapter → Firestore: stores room state (evidence: `README.md`)
