# bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql architecture

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

- Interactive diagram: https://gitdiagram.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql
- Repository: https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql

## Overview

School Web Application is a React/FastAPI school-management system described as four microservices: a UI and separate student, teacher, and admin backends, each with its own MySQL database. The main workflow is a user working through the UI to authenticate or manage school records through a role-specific API. Backend entry points delegate authentication and token handling to services and use schemas, ORM models, and database sessions for record operations. Backend sources are sampled; the frontend implementation and some role-specific modules are not, so frontend-to-API links are documented at the architecture level.

Main entry points: [`backend/teacher/main.py`](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/teacher/main.py) (Teacher API), [`backend/student/main.py`](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/student/main.py) (Student API), [`backend/admin/main.py`](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/admin/main.py) (Admin API), [`frontend`](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/tree/main/frontend) (React frontend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_frontend["React frontend"]
end

subgraph group_student["Student service"]
  node_student_api["Student API<br/>[main.py]"]
  node_student_auth["Student auth services<br/>[services.py]"]
  node_student_schemas["Student schemas<br/>[schemas.py]"]
  node_student_models["Student records<br/>[models.py]"]
  node_student_db[("Student database<br/>[database.py]")]
end

subgraph group_teacher["Teacher service"]
  node_teacher_api["Teacher API<br/>[main.py]"]
  node_teacher_auth["Teacher auth services<br/>[services.py]"]
  node_teacher_schemas["Teacher schemas<br/>[schemas.py]"]
  node_teacher_models["Teacher records<br/>[models.py]"]
  node_teacher_db[("Teacher database<br/>[database.py]")]
end

subgraph group_admin["Admin service"]
  node_admin_api["Admin API<br/>[main.py]"]
  node_admin_auth["Admin auth services<br/>[services.py]"]
  node_admin_schemas["Admin schemas<br/>[schemas.py]"]
  node_admin_models["Admin records<br/>[models.py]"]
  node_admin_db[("Admin database<br/>[database.py]")]
end

node_user(("School user"))
node_mysql[("MySQL")]

node_user -->|"uses"| node_frontend
node_frontend -.->|"requests records"| node_student_api
node_frontend -.->|"requests records"| node_teacher_api
node_frontend -.->|"requests records"| node_admin_api
node_student_api -->|"delegates auth"| node_student_auth
node_student_api -->|"validates data"| node_student_schemas
node_student_api -->|"queries records"| node_student_models
node_student_api -->|"opens sessions"| node_student_db
node_student_auth -->|"authenticates users"| node_student_models
node_student_auth -->|"opens sessions"| node_student_db
node_student_api -.->|"stores records"| node_mysql
node_teacher_api -->|"delegates auth"| node_teacher_auth
node_teacher_api -->|"validates data"| node_teacher_schemas
node_teacher_api -->|"queries records"| node_teacher_models
node_teacher_api -->|"opens sessions"| node_teacher_db
node_teacher_auth -->|"authenticates users"| node_teacher_models
node_teacher_auth -->|"opens sessions"| node_teacher_db
node_teacher_api -->|"fetches students"| node_student_api
node_teacher_api -.->|"stores records"| node_mysql
node_admin_api -->|"delegates auth"| node_admin_auth
node_admin_api -->|"validates data"| node_admin_schemas
node_admin_api -->|"queries records"| node_admin_models
node_admin_api -->|"opens sessions"| node_admin_db
node_admin_auth -->|"authenticates users"| node_admin_models
node_admin_auth -->|"opens sessions"| node_admin_db
node_admin_api -->|"stores records"| node_mysql

click node_frontend "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/tree/main/frontend"
click node_student_api "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/student/main.py"
click node_student_auth "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/student/services.py"
click node_student_schemas "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/student/schemas.py"
click node_student_models "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/student/models.py"
click node_student_db "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/student/database.py"
click node_teacher_api "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/teacher/main.py"
click node_teacher_auth "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/teacher/services.py"
click node_teacher_schemas "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/teacher/schemas.py"
click node_teacher_models "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/teacher/models.py"
click node_teacher_db "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/teacher/database.py"
click node_admin_api "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/admin/main.py"
click node_admin_auth "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/admin/services.py"
click node_admin_schemas "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/admin/schemas.py"
click node_admin_models "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/admin/models.py"
click node_admin_db "https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/admin/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_frontend,node_user toneBlue
class node_student_api,node_student_auth,node_student_schemas,node_student_models,node_student_db,node_mysql toneAmber
class node_teacher_api,node_teacher_auth,node_teacher_schemas,node_teacher_models,node_teacher_db toneMint
class node_admin_api,node_admin_auth,node_admin_schemas,node_admin_models,node_admin_db toneRose
```

## Components

### User interface

- [React frontend](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/tree/main/frontend): `frontend`

### Student service

- [Student API](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/student/main.py): `backend/student/main.py`
- [Student auth services](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/student/services.py): `backend/student/services.py`
- [Student schemas](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/student/schemas.py): `backend/student/schemas.py`
- [Student records](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/student/models.py): `backend/student/models.py`
- [Student database](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/student/database.py): `backend/student/database.py`

### Teacher service

- [Teacher API](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/teacher/main.py): `backend/teacher/main.py`
- [Teacher auth services](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/teacher/services.py): `backend/teacher/services.py`
- [Teacher schemas](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/teacher/schemas.py): `backend/teacher/schemas.py`
- [Teacher records](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/teacher/models.py): `backend/teacher/models.py`
- [Teacher database](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/teacher/database.py): `backend/teacher/database.py`

### Admin service

- [Admin API](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/admin/main.py): `backend/admin/main.py`
- [Admin auth services](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/admin/services.py): `backend/admin/services.py`
- [Admin schemas](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/admin/schemas.py): `backend/admin/schemas.py`
- [Admin records](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/admin/models.py): `backend/admin/models.py`
- [Admin database](https://github.com/bhaskar-guthula-137/schoolwebapp-reactjs-fastapi-mysql/blob/main/backend/admin/database.py): `backend/admin/database.py`

### Other components

- **School user**
- **MySQL**

## Connections

- School user → React frontend: uses (evidence: `README.md`)
- React frontend → Student API: requests records
- React frontend → Teacher API: requests records
- React frontend → Admin API: requests records
- Student API → Student auth services: delegates auth (evidence: `backend/student/main.py`)
- Student API → Student schemas: validates data (evidence: `backend/student/main.py`)
- Student API → Student records: queries records (evidence: `backend/student/main.py`)
- Student API → Student database: opens sessions (evidence: `backend/student/main.py`)
- Student auth services → Student records: authenticates users (evidence: `backend/student/services.py`)
- Student auth services → Student database: opens sessions (evidence: `backend/student/services.py`)
- Student API → MySQL: stores records (evidence: `README.md`)
- Teacher API → Teacher auth services: delegates auth (evidence: `backend/teacher/main.py`)
- Teacher API → Teacher schemas: validates data (evidence: `backend/teacher/main.py`)
- Teacher API → Teacher records: queries records (evidence: `backend/teacher/main.py`)
- Teacher API → Teacher database: opens sessions (evidence: `backend/teacher/main.py`)
- Teacher auth services → Teacher records: authenticates users (evidence: `backend/teacher/services.py`)
- Teacher auth services → Teacher database: opens sessions (evidence: `backend/teacher/services.py`)
- Teacher API → Student API: fetches students (evidence: `backend/teacher/main.py`)
- Teacher API → MySQL: stores records (evidence: `README.md`)
- Admin API → Admin auth services: delegates auth (evidence: `backend/admin/main.py`)
- Admin API → Admin schemas: validates data (evidence: `backend/admin/main.py`)
- Admin API → Admin records: queries records (evidence: `backend/admin/main.py`)
- Admin API → Admin database: opens sessions (evidence: `backend/admin/main.py`)
- Admin auth services → Admin records: authenticates users (evidence: `backend/admin/services.py`)
- Admin auth services → Admin database: opens sessions (evidence: `backend/admin/services.py`)
- Admin API → MySQL: stores records
