# datarishavrathore/fastapi-mysql-ecs architecture

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

- Interactive diagram: https://gitdiagram.com/datarishavrathore/fastapi-mysql-ecs
- Repository: https://github.com/datarishavrathore/fastapi-mysql-ecs

## Overview

This is a student-management web application: users view a dashboard, register students, and browse, search, edit, or delete records. The React interface routes these tasks to an Axios client, which communicates with a FastAPI service; the service validates student input and performs CRUD operations against a MySQL database through SQLAlchemy. The tree contains a second, largely duplicated frontend under `frontend/src/src`, with a different API host; it is shown as a parallel copy. Backend schema and some frontend behavior were not excerpted, so uncertain internal links are omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/App.jsx) (Page router), [`backend/app/main.py`](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/backend/app/main.py) (FastAPI service), [`frontend/src/src/App.jsx`](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/App.jsx) (Copy page router), [`frontend/src/api/api.js`](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/api/api.js) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_app_entry["React entry<br/>[main.jsx]"]
  node_router["Page router<br/>[App.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_create_page["Student registration<br/>[CreateStudent.jsx]"]
  node_student_list["Student directory<br/>[AllStudents.jsx]"]
  node_api_client["HTTP client<br/>[api.js]"]
  node_copy_entry["Copy React entry<br/>[main.jsx]"]
  node_copy_router["Copy page router<br/>[App.jsx]"]
  node_copy_dashboard["Copy dashboard<br/>[Dashboard.jsx]"]
  node_copy_create["Copy registration<br/>[CreateStudent.jsx]"]
  node_copy_list["Copy directory<br/>[AllStudents.jsx]"]
  node_copy_api["Copy HTTP client<br/>[api.js]"]
end

subgraph group_backend["Student API"]
  node_api["FastAPI service<br/>[main.py]"]
  node_student_schema["Input schema<br/>[schema.py]"]
end

subgraph group_persistence["Persistence"]
  node_student_model["Student model<br/>[models.py]"]
  node_db_session["DB session setup<br/>[database.py]"]
  node_mysql[("MySQL database<br/>[database.py]")]
end

node_user(("User"))

node_user -->|"uses"| node_router
node_app_entry -->|"renders"| node_router
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_create_page
node_router -->|"routes to"| node_student_list
node_dashboard -->|"fetches records"| node_api_client
node_create_page -->|"submits student"| node_api_client
node_student_list -->|"fetches, deletes"| node_api_client
node_api_client -->|"HTTP requests"| node_api
node_copy_entry -->|"renders"| node_copy_router
node_copy_router -->|"routes to"| node_copy_dashboard
node_copy_router -->|"routes to"| node_copy_create
node_copy_router -->|"routes to"| node_copy_list
node_copy_dashboard -->|"fetches records"| node_copy_api
node_copy_create -->|"submits student"| node_copy_api
node_copy_list -->|"fetches records"| node_copy_api
node_copy_api -.->|"HTTP requests"| node_api
node_api -->|"validates input"| node_student_schema
node_api -->|"queries and writes"| node_student_model
node_student_model -->|"uses base"| node_db_session
node_api -->|"opens sessions"| node_db_session
node_db_session -->|"connects"| node_mysql

click node_app_entry "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/main.jsx"
click node_router "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/pages/Dashboard.jsx"
click node_create_page "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/pages/CreateStudent.jsx"
click node_student_list "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/pages/AllStudents.jsx"
click node_api_client "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/api/api.js"
click node_copy_entry "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/main.jsx"
click node_copy_router "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/App.jsx"
click node_copy_dashboard "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/pages/Dashboard.jsx"
click node_copy_create "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/pages/CreateStudent.jsx"
click node_copy_list "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/pages/AllStudents.jsx"
click node_copy_api "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/api/api.js"
click node_api "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/backend/app/main.py"
click node_student_schema "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/backend/app/schema.py"
click node_student_model "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/backend/app/models.py"
click node_db_session "https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/backend/app/database.py"
click node_mysql "https://github.com/datarishavrathore/fastapi-mysql-ecs/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_app_entry,node_router,node_dashboard,node_create_page,node_student_list,node_api_client,node_copy_entry,node_copy_router,node_copy_dashboard,node_copy_create,node_copy_list,node_copy_api,node_user toneBlue
class node_api,node_student_schema toneAmber
class node_student_model,node_db_session,node_mysql toneMint
```

## Components

### Web interface

- [React entry](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Page router](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Student registration](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/pages/CreateStudent.jsx): `frontend/src/pages/CreateStudent.jsx`
- [Student directory](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/pages/AllStudents.jsx): `frontend/src/pages/AllStudents.jsx`
- [HTTP client](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/api/api.js): `frontend/src/api/api.js`
- [Copy React entry](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/main.jsx): `frontend/src/src/main.jsx`
- [Copy page router](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/App.jsx): `frontend/src/src/App.jsx`
- [Copy dashboard](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/pages/Dashboard.jsx): `frontend/src/src/pages/Dashboard.jsx`
- [Copy registration](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/pages/CreateStudent.jsx): `frontend/src/src/pages/CreateStudent.jsx`
- [Copy directory](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/pages/AllStudents.jsx): `frontend/src/src/pages/AllStudents.jsx`
- [Copy HTTP client](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/frontend/src/src/api/api.js): `frontend/src/src/api/api.js`

### Student API

- [FastAPI service](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/backend/app/main.py): `backend/app/main.py`
- [Input schema](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/backend/app/schema.py): `backend/app/schema.py`

### Persistence

- [Student model](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/backend/app/models.py): `backend/app/models.py`
- [DB session setup](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/backend/app/database.py): `backend/app/database.py`
- [MySQL database](https://github.com/datarishavrathore/fastapi-mysql-ecs/blob/main/backend/app/database.py): `backend/app/database.py`

### Other components

- **User**

## Connections

- User → Page router: uses
- React entry → Page router: renders (evidence: `frontend/src/main.jsx`)
- Page router → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Student registration: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Student directory: routes to (evidence: `frontend/src/App.jsx`)
- Dashboard → HTTP client: fetches records (evidence: `frontend/src/pages/Dashboard.jsx`)
- Student registration → HTTP client: submits student (evidence: `frontend/src/pages/CreateStudent.jsx`)
- Student directory → HTTP client: fetches, deletes (evidence: `frontend/src/pages/AllStudents.jsx`)
- HTTP client → FastAPI service: HTTP requests (evidence: `frontend/src/api/api.js`)
- Copy React entry → Copy page router: renders (evidence: `frontend/src/src/main.jsx`)
- Copy page router → Copy dashboard: routes to (evidence: `frontend/src/src/App.jsx`)
- Copy page router → Copy registration: routes to (evidence: `frontend/src/src/App.jsx`)
- Copy page router → Copy directory: routes to (evidence: `frontend/src/src/App.jsx`)
- Copy dashboard → Copy HTTP client: fetches records (evidence: `frontend/src/src/pages/Dashboard.jsx`)
- Copy registration → Copy HTTP client: submits student (evidence: `frontend/src/src/pages/CreateStudent.jsx`)
- Copy directory → Copy HTTP client: fetches records (evidence: `frontend/src/src/pages/AllStudents.jsx`)
- Copy HTTP client → FastAPI service: HTTP requests
- FastAPI service → Input schema: validates input (evidence: `backend/app/main.py`)
- FastAPI service → Student model: queries and writes (evidence: `backend/app/main.py`)
- Student model → DB session setup: uses base (evidence: `backend/app/models.py`)
- FastAPI service → DB session setup: opens sessions (evidence: `backend/app/main.py`)
- DB session setup → MySQL database: connects (evidence: `backend/app/database.py`)
