# locitanit/ket-igaz-egy-hamis architecture

> Architecture diagram of the GitHub repository locitanit/ket-igaz-egy-hamis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/locitanit/ket-igaz-egy-hamis
- Repository: https://github.com/locitanit/ket-igaz-egy-hamis

## Overview

Két igaz, egy hamis is a real-time classroom party game. The main workflow is creating or joining a room, submitting shuffled statements, waiting for the host to start, voting on each player’s lie, then revealing answers and displaying scores. Firebase Realtime Database carries shared room state; live updates keep players’ views synchronized. The app also documents room reconnection and an admin room-wipe capability. The source excerpt is partial, so links for voting, final ranking, and some view updates rely on the README’s documented behavior rather than inspected implementation details.

Main entry points: [`index.html`](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/index.html) (Single-page shell), [`app.js`](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js) (Room live sync), [`style.css`](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/style.css) (Game styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and rooms"]
  node_room_entry["Create or join<br/>[app.js]"]
  node_room_state["Room lifecycle<br/>[app.js]"]
  node_admin["Admin wipe<br/>[app.js]"]
end

subgraph group_play["Game stages"]
  node_submission["Statement submission<br/>[app.js]"]
  node_lobby["Submission lobby<br/>[app.js]"]
  node_turn_order["Turn ordering<br/>[app.js]"]
  node_lie_vote["Lie voting<br/>[app.js]"]
  node_reveal["Answer reveal<br/>[app.js]"]
  node_scoring["Scores and ranking<br/>[app.js]"]
end

subgraph group_presentation["User interface"]
  node_page["Single-page shell<br/>[index.html]"]
  node_styles["Game styling<br/>[style.css]"]
end

subgraph group_services["Shared services"]
  node_live_sync["Room live sync<br/>[app.js]"]
  node_room_store[("Room data")]
  node_firebase[("Firebase Realtime Database")]
  node_browser_storage[("Reconnect storage")]
end

node_players(("Students and host"))

node_players -->|"use game"| node_page
node_page -->|"submit room actions"| node_room_entry
node_room_entry -->|"check and create rooms"| node_room_store
node_room_entry -->|"enter room"| node_room_state
node_room_state -->|"save room code"| node_browser_storage
node_room_state -->|"subscribe to room"| node_live_sync
node_live_sync -->|"receive room updates"| node_room_store
node_live_sync -->|"refresh room view"| node_lobby
node_live_sync -->|"refresh game view"| node_lie_vote
node_page -->|"submit statements"| node_submission
node_submission -->|"write player data"| node_room_store
node_lobby -->|"read player submissions"| node_room_store
node_page -->|"host starts game"| node_lobby
node_lobby -->|"start with submitted players"| node_turn_order
node_turn_order -->|"write order and game state"| node_room_store
node_page -->|"cast vote"| node_lie_vote
node_lie_vote -->|"write votes"| node_room_store
node_page -->|"host closes and reveals"| node_reveal
node_reveal -->|"write reveal and scores"| node_room_store
node_scoring -->|"read scores"| node_room_store
node_scoring -->|"display ranking"| node_page
node_page -->|"enter admin code"| node_admin
node_admin -->|"delete all rooms"| node_room_store
node_room_store -->|"persist shared state"| node_firebase
node_page -->|"apply styles"| node_styles

click node_room_entry "https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js"
click node_room_state "https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js"
click node_submission "https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js"
click node_lobby "https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js"
click node_turn_order "https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js"
click node_lie_vote "https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js"
click node_reveal "https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js"
click node_scoring "https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js"
click node_admin "https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js"
click node_page "https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/index.html"
click node_styles "https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/style.css"
click node_live_sync "https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.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_room_entry,node_room_state,node_admin toneBlue
class node_submission,node_lobby,node_turn_order,node_lie_vote,node_reveal,node_scoring toneAmber
class node_page,node_styles toneMint
class node_live_sync,node_room_store,node_firebase,node_browser_storage toneRose
class node_players toneIndigo
```

## Components

### Entry and rooms

- [Create or join](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js): `app.js`
- [Room lifecycle](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js): `app.js`
- [Admin wipe](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js): `app.js`

### Game stages

- [Statement submission](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js): `app.js`
- [Submission lobby](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js): `app.js`
- [Turn ordering](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js): `app.js`
- [Lie voting](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js): `app.js`
- [Answer reveal](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js): `app.js`
- [Scores and ranking](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js): `app.js`

### User interface

- [Single-page shell](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/index.html): `index.html`
- [Game styling](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/style.css): `style.css`

### Shared services

- [Room live sync](https://github.com/locitanit/ket-igaz-egy-hamis/blob/main/app.js): `app.js`
- **Room data**
- **Firebase Realtime Database**
- **Reconnect storage**

### Other components

- **Students and host**

## Connections

- Students and host → Single-page shell: use game
- Single-page shell → Create or join: submit room actions
- Create or join → Room data: check and create rooms
- Create or join → Room lifecycle: enter room
- Room lifecycle → Reconnect storage: save room code
- Room lifecycle → Room live sync: subscribe to room
- Room live sync → Room data: receive room updates
- Room live sync → Submission lobby: refresh room view
- Room live sync → Lie voting: refresh game view
- Single-page shell → Statement submission: submit statements
- Statement submission → Room data: write player data
- Submission lobby → Room data: read player submissions
- Single-page shell → Submission lobby: host starts game
- Submission lobby → Turn ordering: start with submitted players
- Turn ordering → Room data: write order and game state
- Single-page shell → Lie voting: cast vote
- Lie voting → Room data: write votes
- Single-page shell → Answer reveal: host closes and reveals
- Answer reveal → Room data: write reveal and scores
- Scores and ranking → Room data: read scores
- Scores and ranking → Single-page shell: display ranking
- Single-page shell → Admin wipe: enter admin code
- Admin wipe → Room data: delete all rooms
- Room data → Firebase Realtime Database: persist shared state
- Single-page shell → Game styling: apply styles
