# shajudeenkm/imposterpointstable architecture

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

- Interactive diagram: https://gitdiagram.com/shajudeenkm/imposterpointstable
- Repository: https://github.com/shajudeenkm/imposterpointstable

## Overview

Imposter Game is a score-and-statistics platform for social deduction games. Players configure teams, run rounds with imposter selection and voting, and review results; guests can play locally and transfer a game after signing in. The React app uses an API client to reach Express routes backed by MongoDB models. Authentication, history, favorites, team-name generation, privacy, and score settings are additional product capabilities. Relationships are limited to calls and route/model references visible in the excerpts, SOURCE INDEX, or README; unsampled implementation details are not inferred.

Main entry points: [`frontend/src/services/api.js`](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/services/api.js) (API client), [`frontend/src/App.js`](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/App.js) (App routes), [`frontend/src/components/Game/GameSession.js`](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Game/GameSession.js) (Game session), [`backend/routes/games.js`](https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/routes/games.js) (Game routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React application"]
  node_app["App routes<br/>[App.js]"]
end

subgraph group_gameplay["Team and gameplay"]
  node_teamsetup["Team setup<br/>[TeamSetup.js]"]
  node_session["Game session<br/>[GameSession.js]"]
  node_roles["Role selection<br/>[RoleDesignation.js]"]
  node_voting["Voting<br/>[VotingPanel.js]"]
  node_scoreboard["Scoreboard<br/>[Scoreboard.js]"]
  node_scoreconfig["Score settings<br/>[ScoreSettings.js]"]
  node_guest["Guest game logic<br/>[guestGame.js]"]
end

subgraph group_account["Accounts and records"]
  node_authctx["Auth state<br/>[AuthContext.js]"]
  node_authmodal["Sign-in UI<br/>[AuthModal.js]"]
  node_historyui["History review"]
  node_gamedetail["Game detail<br/>[GameDetail.js]"]
  node_favoritesui["Favorites"]
end

subgraph group_backend["API and persistence"]
  node_teams["Team generation<br/>[teams.js]"]
  node_api["API client<br/>[api.js]"]
  node_server["Express API<br/>[server.js]"]
  node_authroute["Auth routes<br/>[auth.js]"]
  node_authmw["JWT middleware<br/>[auth.js]"]
  node_gameroute["Game routes<br/>[games.js]"]
  node_historyroute["History routes<br/>[history.js]"]
  node_favoriteroute["Favorite routes<br/>[favorites.js]"]
end

subgraph group_data["MongoDB models"]
  node_user[("User records<br/>[User.js]")]
  node_game[("Game records<br/>[Game.js]")]
  node_favorite[("Favorite records<br/>[Favorite.js]")]
end

node_player(("Player"))

node_player -->|"opens"| node_app
node_app -->|"reads auth"| node_authctx
node_app -->|"routes to"| node_teamsetup
node_app -->|"routes to"| node_session
node_app -->|"routes to"| node_historyui
node_app -->|"routes to"| node_gamedetail
node_app -->|"routes to"| node_favoritesui
node_app -->|"renders"| node_authmodal
node_authctx -->|"requests auth"| node_api
node_authctx -->|"manages guest save"| node_guest
node_teamsetup -->|"requests teams"| node_api
node_teamsetup -->|"uses guest helpers"| node_guest
node_session -->|"renders"| node_roles
node_session -->|"renders"| node_voting
node_session -->|"renders"| node_scoreboard
node_session -->|"submits game actions"| node_api
node_session -->|"processes guest rounds"| node_guest
node_session -->|"reads auth state"| node_authctx
node_session -.->|"uses settings"| node_scoreconfig
node_historyui -->|"loads history"| node_api
node_gamedetail -->|"loads game"| node_api
node_gamedetail -->|"renders"| node_scoreboard
node_favoritesui -->|"manages favorites"| node_api
node_api -->|"calls auth endpoints"| node_authroute
node_api -->|"calls team endpoints"| node_teams
node_api -->|"calls game endpoints"| node_gameroute
node_api -->|"calls history endpoints"| node_historyroute
node_api -->|"calls favorite endpoints"| node_favoriteroute
node_server -->|"mounts routes"| node_authroute
node_server -->|"mounts routes"| node_gameroute
node_server -->|"mounts routes"| node_historyroute
node_server -->|"mounts routes"| node_favoriteroute
node_authroute -->|"reads and updates"| node_user
node_authroute -->|"protects profile routes"| node_authmw
node_authmw -->|"loads user"| node_user
node_gameroute -->|"uses authentication"| node_authmw
node_gameroute -->|"reads and writes"| node_game
node_gameroute -->|"updates statistics"| node_user
node_historyroute -->|"queries games"| node_game
node_historyroute -->|"uses authentication"| node_authmw
node_favoriteroute -->|"reads and writes"| node_favorite
node_favoriteroute -->|"references games"| node_game
node_favoriteroute -->|"uses authentication"| node_authmw

click node_app "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/App.js"
click node_authctx "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/context/AuthContext.js"
click node_authmodal "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Auth/AuthModal.js"
click node_teamsetup "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Teams/TeamSetup.js"
click node_teams "https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/routes/teams.js"
click node_session "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Game/GameSession.js"
click node_roles "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Game/RoleDesignation.js"
click node_voting "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Game/VotingPanel.js"
click node_scoreboard "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Game/Scoreboard.js"
click node_scoreconfig "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Game/ScoreSettings.js"
click node_guest "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/utils/guestGame.js"
click node_api "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/services/api.js"
click node_server "https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/server.js"
click node_authroute "https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/routes/auth.js"
click node_authmw "https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/middleware/auth.js"
click node_gameroute "https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/routes/games.js"
click node_historyroute "https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/routes/history.js"
click node_historyui "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/History/HistoryDashboard.js"
click node_gamedetail "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/History/GameDetail.js"
click node_favoritesui "https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Favorites/FavoritesManager.js"
click node_favoriteroute "https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/routes/favorites.js"
click node_user "https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/models/User.js"
click node_game "https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/models/Game.js"
click node_favorite "https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/models/Favorite.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 toneBlue
class node_teamsetup,node_session,node_roles,node_voting,node_scoreboard,node_scoreconfig,node_guest toneAmber
class node_authctx,node_authmodal,node_historyui,node_gamedetail,node_favoritesui toneMint
class node_teams,node_api,node_server,node_authroute,node_authmw,node_gameroute,node_historyroute,node_favoriteroute toneRose
class node_user,node_game,node_favorite,node_player toneIndigo
```

## Components

### React application

- [App routes](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/App.js): `frontend/src/App.js`

### Team and gameplay

- [Team setup](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Teams/TeamSetup.js): `frontend/src/components/Teams/TeamSetup.js`
- [Game session](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Game/GameSession.js): `frontend/src/components/Game/GameSession.js`
- [Role selection](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Game/RoleDesignation.js): `frontend/src/components/Game/RoleDesignation.js`
- [Voting](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Game/VotingPanel.js): `frontend/src/components/Game/VotingPanel.js`
- [Scoreboard](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Game/Scoreboard.js): `frontend/src/components/Game/Scoreboard.js`
- [Score settings](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Game/ScoreSettings.js): `frontend/src/components/Game/ScoreSettings.js`
- [Guest game logic](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/utils/guestGame.js): `frontend/src/utils/guestGame.js`

### Accounts and records

- [Auth state](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/context/AuthContext.js): `frontend/src/context/AuthContext.js`
- [Sign-in UI](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Auth/AuthModal.js): `frontend/src/components/Auth/AuthModal.js`
- [History review](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/History/HistoryDashboard.js): `frontend/src/components/History/HistoryDashboard.js`
- [Game detail](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/History/GameDetail.js): `frontend/src/components/History/GameDetail.js`
- [Favorites](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/components/Favorites/FavoritesManager.js): `frontend/src/components/Favorites/FavoritesManager.js`

### API and persistence

- [Team generation](https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/routes/teams.js): `backend/routes/teams.js`
- [API client](https://github.com/shajudeenkm/imposterpointstable/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Express API](https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/server.js): `backend/server.js`
- [Auth routes](https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [JWT middleware](https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [Game routes](https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/routes/games.js): `backend/routes/games.js`
- [History routes](https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/routes/history.js): `backend/routes/history.js`
- [Favorite routes](https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/routes/favorites.js): `backend/routes/favorites.js`

### MongoDB models

- [User records](https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/models/User.js): `backend/models/User.js`
- [Game records](https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/models/Game.js): `backend/models/Game.js`
- [Favorite records](https://github.com/shajudeenkm/imposterpointstable/blob/main/backend/models/Favorite.js): `backend/models/Favorite.js`

### Other components

- **Player**

## Connections

- Player → App routes: opens (evidence: `frontend/src/App.js`)
- App routes → Auth state: reads auth (evidence: `frontend/src/App.js`)
- App routes → Team setup: routes to (evidence: `frontend/src/App.js`)
- App routes → Game session: routes to (evidence: `frontend/src/App.js`)
- App routes → History review: routes to (evidence: `frontend/src/App.js`)
- App routes → Game detail: routes to (evidence: `frontend/src/App.js`)
- App routes → Favorites: routes to (evidence: `frontend/src/App.js`)
- App routes → Sign-in UI: renders (evidence: `frontend/src/App.js`)
- Auth state → API client: requests auth (evidence: `frontend/src/context/AuthContext.js`)
- Auth state → Guest game logic: manages guest save (evidence: `frontend/src/context/AuthContext.js`)
- Team setup → API client: requests teams (evidence: `frontend/src/components/Teams/TeamSetup.js`)
- Team setup → Guest game logic: uses guest helpers (evidence: `frontend/src/components/Teams/TeamSetup.js`)
- Game session → Role selection: renders (evidence: `frontend/src/components/Game/GameSession.js`)
- Game session → Voting: renders (evidence: `frontend/src/components/Game/GameSession.js`)
- Game session → Scoreboard: renders (evidence: `frontend/src/components/Game/GameSession.js`)
- Game session → API client: submits game actions (evidence: `frontend/src/components/Game/GameSession.js`)
- Game session → Guest game logic: processes guest rounds (evidence: `frontend/src/components/Game/GameSession.js`)
- Game session → Auth state: reads auth state (evidence: `frontend/src/components/Game/GameSession.js`)
- Game session → Score settings: uses settings
- History review → API client: loads history (evidence: `frontend/src/components/History/HistoryDashboard.js`)
- Game detail → API client: loads game (evidence: `frontend/src/components/History/GameDetail.js`)
- Game detail → Scoreboard: renders (evidence: `frontend/src/components/History/GameDetail.js`)
- Favorites → API client: manages favorites (evidence: `frontend/src/components/Favorites/FavoritesManager.js`)
- API client → Auth routes: calls auth endpoints (evidence: `frontend/src/services/api.js`)
- API client → Team generation: calls team endpoints (evidence: `frontend/src/services/api.js`)
- API client → Game routes: calls game endpoints (evidence: `frontend/src/services/api.js`)
- API client → History routes: calls history endpoints (evidence: `frontend/src/services/api.js`)
- API client → Favorite routes: calls favorite endpoints (evidence: `frontend/src/services/api.js`)
- Express API → Auth routes: mounts routes (evidence: `backend/server.js`)
- Express API → Game routes: mounts routes (evidence: `backend/server.js`)
- Express API → History routes: mounts routes (evidence: `backend/server.js`)
- Express API → Favorite routes: mounts routes (evidence: `backend/server.js`)
- Auth routes → User records: reads and updates (evidence: `backend/routes/auth.js`)
- Auth routes → JWT middleware: protects profile routes (evidence: `backend/routes/auth.js`)
- JWT middleware → User records: loads user (evidence: `backend/middleware/auth.js`)
- Game routes → JWT middleware: uses authentication (evidence: `backend/routes/games.js`)
- Game routes → Game records: reads and writes (evidence: `backend/routes/games.js`)
- Game routes → User records: updates statistics (evidence: `backend/routes/games.js`)
- History routes → Game records: queries games (evidence: `backend/routes/history.js`)
- History routes → JWT middleware: uses authentication (evidence: `backend/routes/history.js`)
- Favorite routes → Favorite records: reads and writes (evidence: `backend/routes/favorites.js`)
- Favorite routes → Game records: references games (evidence: `backend/routes/favorites.js`)
- Favorite routes → JWT middleware: uses authentication (evidence: `backend/routes/favorites.js`)
