# winayyy/hackathon architecture

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

- Interactive diagram: https://gitdiagram.com/winayyy/hackathon
- Repository: https://github.com/winayyy/hackathon

## Overview

DataOps Console is a local-first dashboard for issuing read-only SQL queries against MySQL, reviewing bounded and masked results, viewing redacted query history, and exporting CSV. The main workflow runs from the browser through the React interface and API, where SQL is validated before database execution; results and query metadata then return to the interface or are stored separately. The graph also shows documented Nginx routing and demo-data initialization. Backend details are based on a partial excerpt; deployment manifests are not runtime product components here.

Main entry points: [`backend/main.py`](https://github.com/winayyy/hackathon/blob/main/backend/main.py) (FastAPI Routes), [`frontend/src/App.jsx`](https://github.com/winayyy/hackathon/blob/main/frontend/src/App.jsx) (Dashboard UI), [`frontend/nginx.conf`](https://github.com/winayyy/hackathon/blob/main/frontend/nginx.conf) (Nginx Proxy), [`frontend/src/main.jsx`](https://github.com/winayyy/hackathon/blob/main/frontend/src/main.jsx) (React Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard"]
  node_react_app["Dashboard UI<br/>[App.jsx]"]
  node_query_workflow["Query Editor<br/>[App.jsx]"]
  node_results_export["Results &amp; CSV<br/>[App.jsx]"]
  node_history_view["History View<br/>[App.jsx]"]
  node_react_entry["React Entry<br/>[main.jsx]"]
end

subgraph group_api["Query API"]
  node_api_routes["FastAPI Routes<br/>[main.py]"]
  node_sql_validation["SQL Validation<br/>[main.py]"]
  node_result_protection["Mask &amp; Serialize<br/>[main.py]"]
end

subgraph group_data["Data Stores"]
  node_mysql[("MySQL Database")]
  node_history_store[("SQLite History<br/>[main.py]")]
  node_demo_seed["Demo Records<br/>[init.sql]"]
end

subgraph group_web["Web Serving"]
  node_nginx["Nginx Proxy<br/>[nginx.conf]"]
end

node_browser(("Browser User"))

node_browser -->|"uses dashboard"| node_react_app
node_react_entry -->|"renders"| node_react_app
node_react_app -->|"renders"| node_query_workflow
node_react_app -->|"renders"| node_results_export
node_react_app -->|"renders"| node_history_view
node_react_app -->|"serves through"| node_nginx
node_nginx -->|"forwards API"| node_api_routes
node_query_workflow -->|"submits query"| node_api_routes
node_history_view -->|"requests history"| node_api_routes
node_api_routes -->|"validates query"| node_sql_validation
node_api_routes -->|"executes SQL"| node_mysql
node_api_routes -->|"masks results"| node_result_protection
node_api_routes -->|"records and reads"| node_history_store
node_results_export -->|"downloads CSV"| node_browser
node_demo_seed -->|"initializes records"| node_mysql

click node_react_app "https://github.com/winayyy/hackathon/blob/main/frontend/src/App.jsx"
click node_query_workflow "https://github.com/winayyy/hackathon/blob/main/frontend/src/App.jsx"
click node_results_export "https://github.com/winayyy/hackathon/blob/main/frontend/src/App.jsx"
click node_history_view "https://github.com/winayyy/hackathon/blob/main/frontend/src/App.jsx"
click node_react_entry "https://github.com/winayyy/hackathon/blob/main/frontend/src/main.jsx"
click node_nginx "https://github.com/winayyy/hackathon/blob/main/frontend/nginx.conf"
click node_api_routes "https://github.com/winayyy/hackathon/blob/main/backend/main.py"
click node_sql_validation "https://github.com/winayyy/hackathon/blob/main/backend/main.py"
click node_result_protection "https://github.com/winayyy/hackathon/blob/main/backend/main.py"
click node_history_store "https://github.com/winayyy/hackathon/blob/main/backend/main.py"
click node_demo_seed "https://github.com/winayyy/hackathon/blob/main/db/init.sql"

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_react_app,node_query_workflow,node_results_export,node_history_view,node_react_entry,node_browser toneBlue
class node_api_routes,node_sql_validation,node_result_protection toneAmber
class node_mysql,node_history_store,node_demo_seed toneMint
class node_nginx toneRose
```

## Components

### Dashboard

- [Dashboard UI](https://github.com/winayyy/hackathon/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Query Editor](https://github.com/winayyy/hackathon/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Results & CSV](https://github.com/winayyy/hackathon/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [History View](https://github.com/winayyy/hackathon/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [React Entry](https://github.com/winayyy/hackathon/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`

### Query API

- [FastAPI Routes](https://github.com/winayyy/hackathon/blob/main/backend/main.py): `backend/main.py`
- [SQL Validation](https://github.com/winayyy/hackathon/blob/main/backend/main.py): `backend/main.py`
- [Mask & Serialize](https://github.com/winayyy/hackathon/blob/main/backend/main.py): `backend/main.py`

### Data Stores

- **MySQL Database**
- [SQLite History](https://github.com/winayyy/hackathon/blob/main/backend/main.py): `backend/main.py`
- [Demo Records](https://github.com/winayyy/hackathon/blob/main/db/init.sql): `db/init.sql`

### Web Serving

- [Nginx Proxy](https://github.com/winayyy/hackathon/blob/main/frontend/nginx.conf): `frontend/nginx.conf`

### Other components

- **Browser User**

## Connections

- Browser User → Dashboard UI: uses dashboard (evidence: `README.md`)
- React Entry → Dashboard UI: renders (evidence: `frontend/src/main.jsx`)
- Dashboard UI → Query Editor: renders (evidence: `frontend/src/App.jsx`)
- Dashboard UI → Results & CSV: renders (evidence: `frontend/src/App.jsx`)
- Dashboard UI → History View: renders (evidence: `frontend/src/App.jsx`)
- Dashboard UI → Nginx Proxy: serves through (evidence: `README.md`)
- Nginx Proxy → FastAPI Routes: forwards API (evidence: `README.md`)
- Query Editor → FastAPI Routes: submits query (evidence: `README.md`)
- History View → FastAPI Routes: requests history (evidence: `README.md`)
- FastAPI Routes → SQL Validation: validates query (evidence: `backend/main.py`)
- FastAPI Routes → MySQL Database: executes SQL (evidence: `backend/main.py`)
- FastAPI Routes → Mask & Serialize: masks results (evidence: `backend/main.py`)
- FastAPI Routes → SQLite History: records and reads (evidence: `backend/main.py`)
- Results & CSV → Browser User: downloads CSV (evidence: `frontend/src/App.jsx`)
- Demo Records → MySQL Database: initializes records (evidence: `README.md`)
