# dalouuu/distributed-database-system-stadvdb architecture

> Architecture diagram of the GitHub repository dalouuu/distributed-database-system-stadvdb, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dalouuu/distributed-database-system-stadvdb
- Repository: https://github.com/dalouuu/distributed-database-system-stadvdb

## Overview

GameVault is a React dashboard backed by an Express API and a three-node MySQL deployment. Users browse CRUD, search, and reporting views; requests pass through the API to a distributed coordinator that routes queries and manages master writes and fragment replication. The coordinator, database adapter, replication log, and API routes are sampled; several page and report modules are indexed but not excerpted, so their UI-to-service links rely on the index. The Flask prototype is outside the documented primary runtime.

Main entry points: [`frontend/src/App.js`](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/App.js) (Route dispatcher), [`backend/coordinator.js`](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/backend/coordinator.js) (Query and write coordinator), [`frontend/src/services/api.js`](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/services/api.js) (HTTP client), [`frontend/src/pages`](https://github.com/dalouuu/distributed-database-system-stadvdb/tree/main/frontend/src/pages) (CRUD views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web application"]
  node_home["Home dashboard<br/>[HomePage.js]"]
  node_app["Route dispatcher<br/>[App.js]"]
  node_crud["CRUD views"]
  node_search["Search view<br/>[SearchPage.js]"]
  node_reports["Analytics reports"]
  node_addpanel["Record entry form<br/>[AddPanel.js]"]
  node_searchinputs["Node selector<br/>[SearchInputs.js]"]
  node_table["Record table<br/>[TableComponent.js]"]
  node_homebutton["Home navigation<br/>[HomeButton.js]"]
  node_api_client["HTTP client<br/>[api.js]"]
end

subgraph group_api["API and coordination"]
  node_express["Express API<br/>[server2.js]"]
  node_coordinator["Query and write coordinator<br/>[coordinator.js]"]
end

subgraph group_replication["Replication and storage"]
  node_db_adapter["Database adapter<br/>[db.js]"]
  node_replication_log["Replication queue<br/>[replicationLog.js]"]
  node_queue_file["Queue persistence"]
  node_mysql[("Three MySQL nodes")]
end

node_user(("GameVault user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_crud
node_app -->|"routes to"| node_search
node_app -->|"routes to"| node_reports
node_home -->|"checks node"| node_api_client
node_crud -->|"renders"| node_addpanel
node_crud -->|"renders"| node_table
node_crud -->|"loads records"| node_api_client
node_search -->|"executes query"| node_api_client
node_search -.->|"shows results"| node_table
node_reports -->|"accepts filters"| node_searchinputs
node_reports -->|"requests reports"| node_api_client
node_searchinputs -->|"switches node"| node_express
node_api_client -->|"sends HTTP"| node_express
node_express -->|"dispatches requests"| node_coordinator
node_coordinator -->|"queries nodes"| node_db_adapter
node_coordinator -->|"records replication"| node_replication_log
node_replication_log -->|"reads and updates log"| node_db_adapter
node_replication_log -->|"persists queue"| node_queue_file
node_db_adapter -->|"connects and transacts"| node_mysql
node_coordinator -->|"routes fragments"| node_mysql
node_express -->|"replays on recovery"| node_coordinator
node_home -.->|"offers navigation"| node_homebutton

click node_home "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/pages/HomePage.js"
click node_app "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/App.js"
click node_crud "https://github.com/dalouuu/distributed-database-system-stadvdb/tree/main/frontend/src/pages"
click node_search "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/pages/SearchPage.js"
click node_reports "https://github.com/dalouuu/distributed-database-system-stadvdb/tree/main/frontend/src/pages"
click node_addpanel "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/components/AddPanel.js"
click node_searchinputs "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/components/SearchInputs.js"
click node_table "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/components/TableComponent.js"
click node_homebutton "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/components/HomeButton.js"
click node_api_client "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/services/api.js"
click node_express "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/backend/server2.js"
click node_coordinator "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/backend/coordinator.js"
click node_db_adapter "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/backend/db.js"
click node_replication_log "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/backend/replicationLog.js"
click node_queue_file "https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/backend/logs/replication_queue.json"

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_home,node_app,node_crud,node_search,node_reports,node_addpanel,node_searchinputs,node_table,node_homebutton,node_api_client,node_user toneBlue
class node_express,node_coordinator toneAmber
class node_db_adapter,node_replication_log,node_queue_file,node_mysql toneMint
```

## Components

### Web application

- [Home dashboard](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/pages/HomePage.js): `frontend/src/pages/HomePage.js`
- [Route dispatcher](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [CRUD views](https://github.com/dalouuu/distributed-database-system-stadvdb/tree/main/frontend/src/pages): `frontend/src/pages`
- [Search view](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/pages/SearchPage.js): `frontend/src/pages/SearchPage.js`
- [Analytics reports](https://github.com/dalouuu/distributed-database-system-stadvdb/tree/main/frontend/src/pages): `frontend/src/pages`
- [Record entry form](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/components/AddPanel.js): `frontend/src/components/AddPanel.js`
- [Node selector](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/components/SearchInputs.js): `frontend/src/components/SearchInputs.js`
- [Record table](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/components/TableComponent.js): `frontend/src/components/TableComponent.js`
- [Home navigation](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/components/HomeButton.js): `frontend/src/components/HomeButton.js`
- [HTTP client](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API and coordination

- [Express API](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/backend/server2.js): `backend/server2.js`
- [Query and write coordinator](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/backend/coordinator.js): `backend/coordinator.js`

### Replication and storage

- [Database adapter](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/backend/db.js): `backend/db.js`
- [Replication queue](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/backend/replicationLog.js): `backend/replicationLog.js`
- [Queue persistence](https://github.com/dalouuu/distributed-database-system-stadvdb/blob/main/backend/logs/replication_queue.json): `backend/logs/replication_queue.json`
- **Three MySQL nodes**

### Other components

- **GameVault user**

## Connections

- GameVault user → Route dispatcher: uses (evidence: `README.md`)
- Route dispatcher → Home dashboard: routes to (evidence: `frontend/src/App.js`)
- Route dispatcher → CRUD views: routes to (evidence: `frontend/src/App.js`)
- Route dispatcher → Search view: routes to (evidence: `frontend/src/App.js`)
- Route dispatcher → Analytics reports: routes to (evidence: `frontend/src/App.js`)
- Home dashboard → HTTP client: checks node (evidence: `frontend/src/pages/HomePage.js`)
- CRUD views → Record entry form: renders (evidence: `frontend/src/pages/AddPage.js`)
- CRUD views → Record table: renders (evidence: `frontend/src/pages/DeletePage.js`)
- CRUD views → HTTP client: loads records (evidence: `frontend/src/pages/DeletePage.js`)
- Search view → HTTP client: executes query (evidence: `frontend/src/pages/SearchPage.js`)
- Search view → Record table: shows results
- Analytics reports → Node selector: accepts filters (evidence: `frontend/src/pages/Report1.js`)
- Analytics reports → HTTP client: requests reports (evidence: `frontend/src/pages/Report1.js`)
- Node selector → Express API: switches node (evidence: `frontend/src/components/SearchInputs.js`)
- HTTP client → Express API: sends HTTP (evidence: `frontend/src/services/api.js`)
- Express API → Query and write coordinator: dispatches requests (evidence: `backend/server2.js`)
- Query and write coordinator → Database adapter: queries nodes (evidence: `backend/coordinator.js`)
- Query and write coordinator → Replication queue: records replication (evidence: `backend/coordinator.js`)
- Replication queue → Database adapter: reads and updates log (evidence: `backend/replicationLog.js`)
- Replication queue → Queue persistence: persists queue (evidence: `backend/replicationLog.js`)
- Database adapter → Three MySQL nodes: connects and transacts (evidence: `README.md`)
- Query and write coordinator → Three MySQL nodes: routes fragments (evidence: `README.md`)
- Express API → Query and write coordinator: replays on recovery (evidence: `backend/server2.js`)
- Home dashboard → Home navigation: offers navigation
