# eshwarkothapalli11/bingopremium architecture

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

- Interactive diagram: https://gitdiagram.com/eshwarkothapalli11/bingopremium
- Repository: https://github.com/eshwarkothapalli11/bingopremium

## Overview

BINGO is a browser-based multiplayer game: players start a session, create or join a shareable room, ready up, privately enter boards, then compete in live play and view results and history. The README describes Supabase, while the sampled runtime and central modules use Firebase; the graph reflects the sampled implementation. Some feature components and persistence details are unsampled, so their internal connections are omitted unless documented or indexed.

Main entry points: [`components/game/GameView.tsx`](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/GameView.tsx) (Live Game View), [`lib/firebase/firestore.ts`](https://github.com/eshwarkothapalli11/bingopremium/blob/main/lib/firebase/firestore.ts) (Firestore Operations), [`app/room/[code]/RoomPageClient.tsx`](https://github.com/eshwarkothapalli11/bingopremium/blob/main/app/room/%5Bcode%5D/RoomPageClient.tsx) (Room Route), [`context/RoomContext.tsx`](https://github.com/eshwarkothapalli11/bingopremium/blob/main/context/RoomContext.tsx) (Room Coordinator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and Rooms"]
  node_authgate["Session Gate<br/>[AuthGate.tsx]"]
  node_dashboard["Player Dashboard"]
  node_roomcreate["Room Creation<br/>[CreateRoomPage.tsx]"]
  node_joinmodal["Join by Code<br/>[JoinRoomModal.tsx]"]
  node_roomroute["Room Route<br/>[RoomPageClient.tsx]"]
end

subgraph group_game["Game Experience"]
  node_lobby["Ready Lobby<br/>[LobbyView.tsx]"]
  node_matrix["Private Board Entry<br/>[MatrixEntry.tsx]"]
  node_gameview["Live Game View<br/>[GameView.tsx]"]
  node_board["Board Grid<br/>[BoardGrid.tsx]"]
  node_progress["BINGO Progress<br/>[BingoProgress.tsx]"]
  node_opponents["Opponent Tracking<br/>[OpponentCard.tsx]"]
  node_chat["Game Chat<br/>[GameChat.tsx]"]
  node_leaderboard["Leaderboard<br/>[Leaderboard.tsx]"]
  node_moves["Live Moves Feed<br/>[LiveMovesFeed.tsx]"]
  node_win["Win Screen<br/>[WinModal.tsx]"]
end

subgraph group_runtime["Game Runtime"]
  node_roomstate["Room Coordinator<br/>[RoomContext.tsx]"]
  node_roomhook["Room Operations<br/>[useRoom.ts]"]
  node_rules["BINGO Rules<br/>[bingo-logic.ts]"]
  node_gamehook["Game Actions<br/>[useGame.ts]"]
end

subgraph group_services["Identity and Data"]
  node_auth["Firebase Auth<br/>[auth.ts]"]
  node_firestore["Firestore Operations<br/>[firestore.ts]"]
  node_realtime["Realtime Subscriptions<br/>[realtime.ts]"]
  node_firebase["Firebase Client<br/>[firebase.ts]"]
  node_db[("Firestore Store")]
end

node_player(("Player"))

node_player -->|"opens app"| node_authgate
node_authgate -->|"gets profile"| node_auth
node_player -->|"chooses room"| node_dashboard
node_dashboard -->|"opens create"| node_roomcreate
node_dashboard -->|"opens join"| node_joinmodal
node_roomcreate -->|"creates room"| node_roomhook
node_roomhook -->|"loads and writes"| node_firestore
node_player -->|"opens room link"| node_roomroute
node_roomroute -->|"provides room state"| node_roomstate
node_roomstate -->|"loads room data"| node_firestore
node_roomstate -->|"subscribes to room"| node_realtime
node_roomroute -->|"renders waiting stage"| node_lobby
node_roomroute -->|"renders matrix stage"| node_matrix
node_roomroute -->|"renders game stage"| node_gameview
node_matrix -->|"validates board"| node_rules
node_roomstate -->|"submits boards"| node_firestore
node_gameview -->|"uses game actions"| node_gamehook
node_gamehook -->|"persists moves"| node_firestore
node_gameview -->|"renders board"| node_board
node_board -->|"checks winning lines"| node_rules
node_gameview -->|"shows progression"| node_progress
node_gameview -->|"shows opponents"| node_opponents
node_gameview -->|"loads chat"| node_chat
node_gameview -->|"loads standings"| node_leaderboard
node_gameview -->|"shows live moves"| node_moves
node_gameview -->|"shows result"| node_win
node_auth -->|"uses client"| node_firebase
node_firestore -->|"uses client"| node_firebase
node_realtime -->|"uses client"| node_firebase
node_firestore -->|"reads and writes"| node_db

click node_authgate "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/auth/AuthGate.tsx"
click node_dashboard "https://github.com/eshwarkothapalli11/bingopremium/blob/main/app/dashboard/DashboardClient.tsx"
click node_roomcreate "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/lobby/CreateRoomPage.tsx"
click node_joinmodal "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/lobby/JoinRoomModal.tsx"
click node_roomroute "https://github.com/eshwarkothapalli11/bingopremium/blob/main/app/room/%5Bcode%5D/RoomPageClient.tsx"
click node_roomstate "https://github.com/eshwarkothapalli11/bingopremium/blob/main/context/RoomContext.tsx"
click node_roomhook "https://github.com/eshwarkothapalli11/bingopremium/blob/main/hooks/useRoom.ts"
click node_lobby "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/lobby/LobbyView.tsx"
click node_matrix "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/MatrixEntry.tsx"
click node_gameview "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/GameView.tsx"
click node_board "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/BoardGrid.tsx"
click node_progress "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/BingoProgress.tsx"
click node_opponents "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/OpponentCard.tsx"
click node_chat "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/GameChat.tsx"
click node_leaderboard "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/Leaderboard.tsx"
click node_moves "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/LiveMovesFeed.tsx"
click node_win "https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/WinModal.tsx"
click node_rules "https://github.com/eshwarkothapalli11/bingopremium/blob/main/lib/bingo-logic.ts"
click node_gamehook "https://github.com/eshwarkothapalli11/bingopremium/blob/main/hooks/useGame.ts"
click node_auth "https://github.com/eshwarkothapalli11/bingopremium/blob/main/lib/firebase/auth.ts"
click node_firestore "https://github.com/eshwarkothapalli11/bingopremium/blob/main/lib/firebase/firestore.ts"
click node_realtime "https://github.com/eshwarkothapalli11/bingopremium/blob/main/lib/firebase/realtime.ts"
click node_firebase "https://github.com/eshwarkothapalli11/bingopremium/blob/main/lib/firebase/firebase.ts"

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_authgate,node_dashboard,node_roomcreate,node_joinmodal,node_roomroute toneBlue
class node_lobby,node_matrix,node_gameview,node_board,node_progress,node_opponents,node_chat,node_leaderboard,node_moves,node_win toneAmber
class node_roomstate,node_roomhook,node_rules,node_gamehook toneMint
class node_auth,node_firestore,node_realtime,node_firebase,node_db toneRose
class node_player toneIndigo
```

## Components

### Entry and Rooms

- [Session Gate](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/auth/AuthGate.tsx): `components/auth/AuthGate.tsx`
- [Player Dashboard](https://github.com/eshwarkothapalli11/bingopremium/blob/main/app/dashboard/DashboardClient.tsx): `app/dashboard/DashboardClient.tsx`
- [Room Creation](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/lobby/CreateRoomPage.tsx): `components/lobby/CreateRoomPage.tsx`
- [Join by Code](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/lobby/JoinRoomModal.tsx): `components/lobby/JoinRoomModal.tsx`
- [Room Route](https://github.com/eshwarkothapalli11/bingopremium/blob/main/app/room/%5Bcode%5D/RoomPageClient.tsx): `app/room/[code]/RoomPageClient.tsx`

### Game Experience

- [Ready Lobby](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/lobby/LobbyView.tsx): `components/lobby/LobbyView.tsx`
- [Private Board Entry](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/MatrixEntry.tsx): `components/game/MatrixEntry.tsx`
- [Live Game View](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/GameView.tsx): `components/game/GameView.tsx`
- [Board Grid](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/BoardGrid.tsx): `components/game/BoardGrid.tsx`
- [BINGO Progress](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/BingoProgress.tsx): `components/game/BingoProgress.tsx`
- [Opponent Tracking](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/OpponentCard.tsx): `components/game/OpponentCard.tsx`
- [Game Chat](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/GameChat.tsx): `components/game/GameChat.tsx`
- [Leaderboard](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/Leaderboard.tsx): `components/game/Leaderboard.tsx`
- [Live Moves Feed](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/LiveMovesFeed.tsx): `components/game/LiveMovesFeed.tsx`
- [Win Screen](https://github.com/eshwarkothapalli11/bingopremium/blob/main/components/game/WinModal.tsx): `components/game/WinModal.tsx`

### Game Runtime

- [Room Coordinator](https://github.com/eshwarkothapalli11/bingopremium/blob/main/context/RoomContext.tsx): `context/RoomContext.tsx`
- [Room Operations](https://github.com/eshwarkothapalli11/bingopremium/blob/main/hooks/useRoom.ts): `hooks/useRoom.ts`
- [BINGO Rules](https://github.com/eshwarkothapalli11/bingopremium/blob/main/lib/bingo-logic.ts): `lib/bingo-logic.ts`
- [Game Actions](https://github.com/eshwarkothapalli11/bingopremium/blob/main/hooks/useGame.ts): `hooks/useGame.ts`

### Identity and Data

- [Firebase Auth](https://github.com/eshwarkothapalli11/bingopremium/blob/main/lib/firebase/auth.ts): `lib/firebase/auth.ts`
- [Firestore Operations](https://github.com/eshwarkothapalli11/bingopremium/blob/main/lib/firebase/firestore.ts): `lib/firebase/firestore.ts`
- [Realtime Subscriptions](https://github.com/eshwarkothapalli11/bingopremium/blob/main/lib/firebase/realtime.ts): `lib/firebase/realtime.ts`
- [Firebase Client](https://github.com/eshwarkothapalli11/bingopremium/blob/main/lib/firebase/firebase.ts): `lib/firebase/firebase.ts`
- **Firestore Store**

### Other components

- **Player**

## Connections

- Player → Session Gate: opens app
- Session Gate → Firebase Auth: gets profile (evidence: `components/auth/AuthGate.tsx`)
- Player → Player Dashboard: chooses room
- Player Dashboard → Room Creation: opens create (evidence: `app/dashboard/DashboardClient.tsx`)
- Player Dashboard → Join by Code: opens join (evidence: `app/dashboard/DashboardClient.tsx`)
- Room Creation → Room Operations: creates room (evidence: `components/lobby/CreateRoomPage.tsx`)
- Room Operations → Firestore Operations: loads and writes (evidence: `hooks/useRoom.ts`)
- Player → Room Route: opens room link
- Room Route → Room Coordinator: provides room state (evidence: `app/room/[code]/RoomPageClient.tsx`)
- Room Coordinator → Firestore Operations: loads room data (evidence: `context/RoomContext.tsx`)
- Room Coordinator → Realtime Subscriptions: subscribes to room (evidence: `context/RoomContext.tsx`)
- Room Route → Ready Lobby: renders waiting stage (evidence: `app/room/[code]/RoomPageClient.tsx`)
- Room Route → Private Board Entry: renders matrix stage (evidence: `app/room/[code]/RoomPageClient.tsx`)
- Room Route → Live Game View: renders game stage (evidence: `app/room/[code]/RoomPageClient.tsx`)
- Private Board Entry → BINGO Rules: validates board (evidence: `components/game/MatrixEntry.tsx`)
- Room Coordinator → Firestore Operations: submits boards (evidence: `context/RoomContext.tsx`)
- Live Game View → Game Actions: uses game actions (evidence: `components/game/GameView.tsx`)
- Game Actions → Firestore Operations: persists moves (evidence: `hooks/useGame.ts`)
- Live Game View → Board Grid: renders board (evidence: `components/game/GameView.tsx`)
- Board Grid → BINGO Rules: checks winning lines (evidence: `components/game/BoardGrid.tsx`)
- Live Game View → BINGO Progress: shows progression (evidence: `components/game/GameView.tsx`)
- Live Game View → Opponent Tracking: shows opponents (evidence: `components/game/GameView.tsx`)
- Live Game View → Game Chat: loads chat (evidence: `components/game/GameView.tsx`)
- Live Game View → Leaderboard: loads standings (evidence: `components/game/GameView.tsx`)
- Live Game View → Live Moves Feed: shows live moves (evidence: `components/game/GameView.tsx`)
- Live Game View → Win Screen: shows result (evidence: `components/game/GameView.tsx`)
- Firebase Auth → Firebase Client: uses client (evidence: `lib/firebase/auth.ts`)
- Firestore Operations → Firebase Client: uses client (evidence: `lib/firebase/firestore.ts`)
- Realtime Subscriptions → Firebase Client: uses client (evidence: `lib/firebase/realtime.ts`)
- Firestore Operations → Firestore Store: reads and writes (evidence: `lib/firebase/firestore.ts`)
