# datarishavrathore/sms-backend architecture

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

- Interactive diagram: https://gitdiagram.com/datarishavrathore/sms-backend
- Repository: https://github.com/datarishavrathore/sms-backend

## Overview

This is a small FastAPI student-management API. A client submits student data to the routes in `app/main.py`; create and update validate it with a Pydantic schema, then query or modify SQLAlchemy student records using a database session. The API also lists and deletes records and exposes a database health check. `app/database.py` configures the MySQL connection and session lifecycle. The README is empty, so capabilities and relationships here are based on the shown source; no separate deployment or integration workflow is evidenced.

Main entry points: [`app/main.py`](https://github.com/datarishavrathore/sms-backend/blob/main/app/main.py) (Student routes), [`app/database.py`](https://github.com/datarishavrathore/sms-backend/blob/main/app/database.py) (DB sessions), [`app/models.py`](https://github.com/datarishavrathore/sms-backend/blob/main/app/models.py) (Student record), [`app/schema.py`](https://github.com/datarishavrathore/sms-backend/blob/main/app/schema.py) (Student input)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_routes["Student routes<br/>[main.py]"]
end

subgraph group_domain["Student data"]
  node_input["Student input<br/>[schema.py]"]
  node_student["Student record<br/>[models.py]"]
end

subgraph group_persistence["Persistence"]
  node_session["DB sessions<br/>[database.py]"]
  node_mysql[("MySQL database")]
end

node_client(("API client"))

node_client -->|"calls routes"| node_routes
node_routes -->|"validates input"| node_input
node_routes -->|"queries records"| node_student
node_routes -->|"gets session"| node_session
node_student -->|"uses base"| node_session
node_session -->|"connects to"| node_mysql
node_routes -->|"checks health"| node_mysql

click node_routes "https://github.com/datarishavrathore/sms-backend/blob/main/app/main.py"
click node_input "https://github.com/datarishavrathore/sms-backend/blob/main/app/schema.py"
click node_student "https://github.com/datarishavrathore/sms-backend/blob/main/app/models.py"
click node_session "https://github.com/datarishavrathore/sms-backend/blob/main/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_routes,node_client toneBlue
class node_input,node_student toneAmber
class node_session,node_mysql toneMint
```

## Components

### API

- [Student routes](https://github.com/datarishavrathore/sms-backend/blob/main/app/main.py): `app/main.py`

### Student data

- [Student input](https://github.com/datarishavrathore/sms-backend/blob/main/app/schema.py): `app/schema.py`
- [Student record](https://github.com/datarishavrathore/sms-backend/blob/main/app/models.py): `app/models.py`

### Persistence

- [DB sessions](https://github.com/datarishavrathore/sms-backend/blob/main/app/database.py): `app/database.py`
- **MySQL database**

### Other components

- **API client**

## Connections

- API client → Student routes: calls routes (evidence: `app/main.py`)
- Student routes → Student input: validates input (evidence: `app/main.py`)
- Student routes → Student record: queries records (evidence: `app/main.py`)
- Student routes → DB sessions: gets session (evidence: `app/main.py`)
- Student record → DB sessions: uses base (evidence: `app/models.py`)
- DB sessions → MySQL database: connects to (evidence: `app/database.py`)
- Student routes → MySQL database: checks health (evidence: `app/main.py`)
