# ayushdeep117/guess-the-word architecture

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

- Interactive diagram: https://gitdiagram.com/ayushdeep117/guess-the-word
- Repository: https://github.com/ayushdeep117/guess-the-word

## Overview

Guess The Word is a Flask word-guessing game. Players register or log in, start a game, submit guesses, and see evaluated feedback; administrators view daily and per-user reports. Routes coordinate services, validation, and SQLite-backed state. The graph follows the supplied route and service excerpts; template and database internals are represented only where supported by the tree or README.

Main entry points: [`routes/game_routes.py`](https://github.com/ayushdeep117/guess-the-word/blob/main/routes/game_routes.py) (Game routes), [`app.py`](https://github.com/ayushdeep117/guess-the-word/blob/main/app.py) (Flask app), [`routes/auth_routes.py`](https://github.com/ayushdeep117/guess-the-word/blob/main/routes/auth_routes.py) (Account routes), [`routes/admin_routes.py`](https://github.com/ayushdeep117/guess-the-word/blob/main/routes/admin_routes.py) (Admin routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_flask["Flask app<br/>[app.py]"]
  node_pages["Game and account pages"]
  node_game_script["Guess input<br/>[game.js]"]
end

subgraph group_identity["Accounts and access"]
  node_auth_routes["Account routes<br/>[auth_routes.py]"]
  node_auth_service["Account service<br/>[auth_service.py]"]
  node_access["Session access checks<br/>[auth.py]"]
  node_validators["Input validation<br/>[validators.py]"]
end

subgraph group_gameplay["Game workflow"]
  node_game_routes["Game routes<br/>[game_routes.py]"]
  node_game_service["Game rules and state<br/>[game_service.py]"]
  node_evaluator["Guess evaluation<br/>[word_evaluator.py]"]
end

subgraph group_reporting["Administration and reports"]
  node_admin_routes["Admin routes<br/>[admin_routes.py]"]
  node_report_service["Report queries<br/>[report_service.py]"]
  node_report_pages["Admin report pages"]
end

node_player(("Player"))
node_administrator(("Administrator"))
node_sqlite[("SQLite game data<br/>[db.py]")]

node_player -->|"uses"| node_flask
node_administrator -->|"uses"| node_flask
node_flask -->|"registers"| node_auth_routes
node_flask -->|"registers"| node_game_routes
node_flask -->|"registers"| node_admin_routes
node_auth_routes -->|"calls"| node_auth_service
node_auth_routes -->|"checks access"| node_access
node_auth_service -->|"validates"| node_validators
node_auth_service -->|"reads and writes"| node_sqlite
node_auth_routes -->|"renders"| node_pages
node_game_routes -->|"checks access"| node_access
node_game_routes -->|"validates guesses"| node_validators
node_game_routes -->|"calls"| node_game_service
node_game_routes -->|"evaluates history"| node_evaluator
node_game_service -->|"evaluates guess"| node_evaluator
node_game_service -->|"reads and writes"| node_sqlite
node_game_routes -->|"renders"| node_pages
node_pages -->|"loads"| node_game_script
node_admin_routes -->|"checks access"| node_access
node_admin_routes -->|"calls"| node_report_service
node_report_service -->|"queries"| node_sqlite
node_admin_routes -->|"renders"| node_report_pages

click node_flask "https://github.com/ayushdeep117/guess-the-word/blob/main/app.py"
click node_pages "https://github.com/ayushdeep117/guess-the-word/tree/main/templates"
click node_game_script "https://github.com/ayushdeep117/guess-the-word/blob/main/static/js/game.js"
click node_auth_routes "https://github.com/ayushdeep117/guess-the-word/blob/main/routes/auth_routes.py"
click node_auth_service "https://github.com/ayushdeep117/guess-the-word/blob/main/services/auth_service.py"
click node_access "https://github.com/ayushdeep117/guess-the-word/blob/main/utils/auth.py"
click node_validators "https://github.com/ayushdeep117/guess-the-word/blob/main/utils/validators.py"
click node_game_routes "https://github.com/ayushdeep117/guess-the-word/blob/main/routes/game_routes.py"
click node_game_service "https://github.com/ayushdeep117/guess-the-word/blob/main/services/game_service.py"
click node_evaluator "https://github.com/ayushdeep117/guess-the-word/blob/main/utils/word_evaluator.py"
click node_admin_routes "https://github.com/ayushdeep117/guess-the-word/blob/main/routes/admin_routes.py"
click node_report_service "https://github.com/ayushdeep117/guess-the-word/blob/main/services/report_service.py"
click node_report_pages "https://github.com/ayushdeep117/guess-the-word/tree/main/templates"
click node_sqlite "https://github.com/ayushdeep117/guess-the-word/blob/main/database/db.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_flask,node_pages,node_game_script toneBlue
class node_auth_routes,node_auth_service,node_access,node_validators,node_sqlite toneAmber
class node_game_routes,node_game_service,node_evaluator toneMint
class node_admin_routes,node_report_service,node_report_pages toneRose
class node_player,node_administrator toneIndigo
```

## Components

### Web interface

- [Flask app](https://github.com/ayushdeep117/guess-the-word/blob/main/app.py): `app.py`
- [Game and account pages](https://github.com/ayushdeep117/guess-the-word/tree/main/templates): `templates`
- [Guess input](https://github.com/ayushdeep117/guess-the-word/blob/main/static/js/game.js): `static/js/game.js`

### Accounts and access

- [Account routes](https://github.com/ayushdeep117/guess-the-word/blob/main/routes/auth_routes.py): `routes/auth_routes.py`
- [Account service](https://github.com/ayushdeep117/guess-the-word/blob/main/services/auth_service.py): `services/auth_service.py`
- [Session access checks](https://github.com/ayushdeep117/guess-the-word/blob/main/utils/auth.py): `utils/auth.py`
- [Input validation](https://github.com/ayushdeep117/guess-the-word/blob/main/utils/validators.py): `utils/validators.py`

### Game workflow

- [Game routes](https://github.com/ayushdeep117/guess-the-word/blob/main/routes/game_routes.py): `routes/game_routes.py`
- [Game rules and state](https://github.com/ayushdeep117/guess-the-word/blob/main/services/game_service.py): `services/game_service.py`
- [Guess evaluation](https://github.com/ayushdeep117/guess-the-word/blob/main/utils/word_evaluator.py): `utils/word_evaluator.py`

### Administration and reports

- [Admin routes](https://github.com/ayushdeep117/guess-the-word/blob/main/routes/admin_routes.py): `routes/admin_routes.py`
- [Report queries](https://github.com/ayushdeep117/guess-the-word/blob/main/services/report_service.py): `services/report_service.py`
- [Admin report pages](https://github.com/ayushdeep117/guess-the-word/tree/main/templates): `templates`

### Other components

- **Player**
- **Administrator**
- [SQLite game data](https://github.com/ayushdeep117/guess-the-word/blob/main/database/db.py): `database/db.py`

## Connections

- Player → Flask app: uses
- Administrator → Flask app: uses
- Flask app → Account routes: registers
- Flask app → Game routes: registers
- Flask app → Admin routes: registers
- Account routes → Account service: calls
- Account routes → Session access checks: checks access
- Account service → Input validation: validates
- Account service → SQLite game data: reads and writes
- Account routes → Game and account pages: renders
- Game routes → Session access checks: checks access
- Game routes → Input validation: validates guesses
- Game routes → Game rules and state: calls
- Game routes → Guess evaluation: evaluates history
- Game rules and state → Guess evaluation: evaluates guess
- Game rules and state → SQLite game data: reads and writes
- Game routes → Game and account pages: renders
- Game and account pages → Guess input: loads
- Admin routes → Session access checks: checks access
- Admin routes → Report queries: calls
- Report queries → SQLite game data: queries
- Admin routes → Admin report pages: renders
