# toto789520/roudelafortune architecture

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

- Interactive diagram: https://gitdiagram.com/toto789520/roudelafortune
- Repository: https://github.com/toto789520/roudelafortune

## Overview

Roudelafortune is a self-hosted, account-free multiplayer Wheel of Fortune web game. Players choose a name, create or join a coded game, wait for the host to start it, take turns guessing letters, and see the finished scores. Flask route handlers in app.py manage these stages and render the HTML views; Redis holds game state, while the app also exposes a game-state update API. The README emphasizes autonomy, but does not document further architecture. Some route logic and CSV-loading code were not shown, so uncertain links are omitted.

Main entry points: [`app.py`](https://github.com/toto789520/roudelafortune/blob/main/app.py) (Gameplay), [`templates/index.html`](https://github.com/toto789520/roudelafortune/blob/main/templates/index.html) (Home view), [`templates/waiting.html`](https://github.com/toto789520/roudelafortune/blob/main/templates/waiting.html) (Waiting view), [`templates/game.html`](https://github.com/toto789520/roudelafortune/blob/main/templates/game.html) (Game view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_web_routes["Web routes<br/>[app.py]"]
  node_name_setup["Name setup<br/>[app.py]"]
  node_home_view["Home view<br/>[index.html]"]
end

subgraph group_game["Game flow"]
  node_new_game["Create game<br/>[app.py]"]
  node_join_game["Join game<br/>[app.py]"]
  node_waiting_room["Waiting room<br/>[app.py]"]
  node_waiting_view["Waiting view<br/>[waiting.html]"]
  node_gameplay["Gameplay<br/>[app.py]"]
  node_game_view["Game view<br/>[game.html]"]
  node_guessing["Letter guesses<br/>[app.py]"]
  node_results["Results<br/>[finished.html]"]
end

subgraph group_state["Game state"]
  node_word_source["Word data<br/>[data.csv]"]
  node_redis[("Redis state")]
  node_state_api["State update API<br/>[app.py]"]
end

node_players(("Players"))

node_players -->|"visits"| node_web_routes
node_web_routes -->|"renders"| node_home_view
node_players -->|"sets name"| node_name_setup
node_name_setup -->|"redirects"| node_home_view
node_players -->|"creates"| node_new_game
node_new_game -->|"stores game"| node_redis
node_players -->|"joins"| node_join_game
node_join_game -->|"checks game"| node_redis
node_players -->|"waits"| node_waiting_room
node_waiting_room -->|"reads and updates"| node_redis
node_waiting_room -->|"renders"| node_waiting_view
node_players -->|"plays"| node_gameplay
node_gameplay -->|"reads game state"| node_redis
node_gameplay -->|"renders"| node_game_view
node_players -->|"submits letters"| node_guessing
node_guessing -->|"updates scores"| node_redis
node_gameplay -->|"renders finished game"| node_results
node_players -->|"requests update"| node_state_api
node_state_api -->|"reads state"| node_redis
node_new_game -.->|"selects word"| node_word_source

click node_web_routes "https://github.com/toto789520/roudelafortune/blob/main/app.py"
click node_name_setup "https://github.com/toto789520/roudelafortune/blob/main/app.py"
click node_home_view "https://github.com/toto789520/roudelafortune/blob/main/templates/index.html"
click node_new_game "https://github.com/toto789520/roudelafortune/blob/main/app.py"
click node_join_game "https://github.com/toto789520/roudelafortune/blob/main/app.py"
click node_waiting_room "https://github.com/toto789520/roudelafortune/blob/main/app.py"
click node_waiting_view "https://github.com/toto789520/roudelafortune/blob/main/templates/waiting.html"
click node_gameplay "https://github.com/toto789520/roudelafortune/blob/main/app.py"
click node_game_view "https://github.com/toto789520/roudelafortune/blob/main/templates/game.html"
click node_guessing "https://github.com/toto789520/roudelafortune/blob/main/app.py"
click node_results "https://github.com/toto789520/roudelafortune/blob/main/templates/finished.html"
click node_word_source "https://github.com/toto789520/roudelafortune/blob/main/data/data.csv"
click node_state_api "https://github.com/toto789520/roudelafortune/blob/main/app.py"

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_web_routes,node_name_setup,node_home_view toneBlue
class node_new_game,node_join_game,node_waiting_room,node_waiting_view,node_gameplay,node_game_view,node_guessing,node_results toneAmber
class node_word_source,node_redis,node_state_api toneMint
class node_players toneIndigo
```

## Components

### Web experience

- [Web routes](https://github.com/toto789520/roudelafortune/blob/main/app.py): `app.py`
- [Name setup](https://github.com/toto789520/roudelafortune/blob/main/app.py): `app.py`
- [Home view](https://github.com/toto789520/roudelafortune/blob/main/templates/index.html): `templates/index.html`

### Game flow

- [Create game](https://github.com/toto789520/roudelafortune/blob/main/app.py): `app.py`
- [Join game](https://github.com/toto789520/roudelafortune/blob/main/app.py): `app.py`
- [Waiting room](https://github.com/toto789520/roudelafortune/blob/main/app.py): `app.py`
- [Waiting view](https://github.com/toto789520/roudelafortune/blob/main/templates/waiting.html): `templates/waiting.html`
- [Gameplay](https://github.com/toto789520/roudelafortune/blob/main/app.py): `app.py`
- [Game view](https://github.com/toto789520/roudelafortune/blob/main/templates/game.html): `templates/game.html`
- [Letter guesses](https://github.com/toto789520/roudelafortune/blob/main/app.py): `app.py`
- [Results](https://github.com/toto789520/roudelafortune/blob/main/templates/finished.html): `templates/finished.html`

### Game state

- [Word data](https://github.com/toto789520/roudelafortune/blob/main/data/data.csv): `data/data.csv`
- **Redis state**
- [State update API](https://github.com/toto789520/roudelafortune/blob/main/app.py): `app.py`

### Other components

- **Players**

## Connections

- Players → Web routes: visits (evidence: `app.py`)
- Web routes → Home view: renders (evidence: `app.py`)
- Players → Name setup: sets name (evidence: `app.py`)
- Name setup → Home view: redirects (evidence: `app.py`)
- Players → Create game: creates (evidence: `app.py`)
- Create game → Redis state: stores game (evidence: `app.py`)
- Players → Join game: joins (evidence: `app.py`)
- Join game → Redis state: checks game (evidence: `app.py`)
- Players → Waiting room: waits (evidence: `app.py`)
- Waiting room → Redis state: reads and updates (evidence: `app.py`)
- Waiting room → Waiting view: renders (evidence: `app.py`)
- Players → Gameplay: plays (evidence: `app.py`)
- Gameplay → Redis state: reads game state (evidence: `app.py`)
- Gameplay → Game view: renders (evidence: `app.py`)
- Players → Letter guesses: submits letters (evidence: `app.py`)
- Letter guesses → Redis state: updates scores (evidence: `app.py`)
- Gameplay → Results: renders finished game (evidence: `app.py`)
- Players → State update API: requests update (evidence: `app.py`)
- State update API → Redis state: reads state (evidence: `app.py`)
- Create game → Word data: selects word
