# ragul-gunasekaran/operation-blockout architecture

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

- Interactive diagram: https://gitdiagram.com/ragul-gunasekaran/operation-blockout
- Repository: https://github.com/ragul-gunasekaran/operation-blockout

## Overview

Operation Blackout is a cybersecurity investigation game. An agent registers or signs in, starts a timed investigation, follows a clue, submits a six-digit recovery code, and can view completed rankings. The React application presents these stages; a FastAPI application handles authentication, gameplay, verification, and leaderboard requests, backed by SQLAlchemy participant and game-session records. The README also advertises secure authentication and high-concurrency support. Backend internals are summarized where excerpts are incomplete; the frontend-to-API relationship is evidenced by the registration request.

Main entry points: [`backend/app/main.py`](https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/main.py) (Game API), [`backend/app/database.py`](https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/database.py) (Database access), [`frontend/src/App.jsx`](https://github.com/ragul-gunasekaran/operation-blockout/blob/main/frontend/src/App.jsx) (Game interface), [`backend/app/models.py`](https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/models.py) (Agent accounts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Player experience"]
  node_game_ui["Game interface<br/>[App.jsx]"]
end

subgraph group_service["Game service"]
  node_serverless_entry["API entrypoint<br/>[index.py]"]
  node_api["Game API<br/>[main.py]"]
  node_contracts["API schemas<br/>[schemas.py]"]
end

subgraph group_persistence["Persistence"]
  node_participants["Agent accounts<br/>[models.py]"]
  node_sessions["Game records<br/>[models.py]"]
  node_db_access["Database access<br/>[database.py]"]
end

node_agent(("Agent"))
node_sql_store[("SQL database")]
node_clue_repo["Investigation clue"]

node_agent -->|"plays"| node_game_ui
node_game_ui -->|"sends requests"| node_api
node_serverless_entry -->|"loads app"| node_api
node_api -->|"uses schemas"| node_contracts
node_api -->|"gets sessions"| node_db_access
node_db_access -->|"loads models"| node_participants
node_api -->|"reads and writes"| node_participants
node_api -->|"reads and writes"| node_sessions
node_db_access -->|"connects to"| node_sql_store
node_api -->|"returns clue link"| node_clue_repo

click node_game_ui "https://github.com/ragul-gunasekaran/operation-blockout/blob/main/frontend/src/App.jsx"
click node_serverless_entry "https://github.com/ragul-gunasekaran/operation-blockout/blob/main/frontend/api/index.py"
click node_api "https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/main.py"
click node_contracts "https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/schemas.py"
click node_participants "https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/models.py"
click node_sessions "https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/models.py"
click node_db_access "https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/database.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_game_ui toneBlue
class node_serverless_entry,node_api,node_contracts,node_sql_store toneAmber
class node_participants,node_sessions,node_db_access toneMint
class node_agent,node_clue_repo toneIndigo
```

## Components

### Player experience

- [Game interface](https://github.com/ragul-gunasekaran/operation-blockout/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Game service

- [API entrypoint](https://github.com/ragul-gunasekaran/operation-blockout/blob/main/frontend/api/index.py): `frontend/api/index.py`
- [Game API](https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/main.py): `backend/app/main.py`
- [API schemas](https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/schemas.py): `backend/app/schemas.py`

### Persistence

- [Agent accounts](https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/models.py): `backend/app/models.py`
- [Game records](https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/models.py): `backend/app/models.py`
- [Database access](https://github.com/ragul-gunasekaran/operation-blockout/blob/main/backend/app/database.py): `backend/app/database.py`

### Other components

- **Agent**
- **SQL database**
- **Investigation clue**

## Connections

- Agent → Game interface: plays (evidence: `frontend/src/App.jsx`)
- Game interface → Game API: sends requests (evidence: `frontend/src/App.jsx`)
- API entrypoint → Game API: loads app (evidence: `frontend/api/index.py`)
- Game API → API schemas: uses schemas (evidence: `backend/app/main.py`)
- Game API → Database access: gets sessions (evidence: `backend/app/main.py`)
- Database access → Agent accounts: loads models (evidence: `backend/app/database.py`)
- Game API → Agent accounts: reads and writes (evidence: `backend/app/main.py`)
- Game API → Game records: reads and writes (evidence: `backend/app/main.py`)
- Database access → SQL database: connects to (evidence: `backend/app/database.py`)
- Game API → Investigation clue: returns clue link (evidence: `backend/app/main.py`)
