# emmy6-d/student_portal architecture

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

- Interactive diagram: https://gitdiagram.com/emmy6-d/student_portal
- Repository: https://github.com/emmy6-d/student_portal

## Overview

This is a small FastAPI student-management API. Clients send student create, list, read, update, or delete requests through the registered student router; the router validates and shapes payloads with Pydantic schemas, uses SQLAlchemy models and sessions for persistence, and returns results. Startup creates mapped tables. The README provides no additional capability detail, so this map follows the sampled source; database interaction is shown at the router and connection layers.

Main entry points: [`app/routers/students.py`](https://github.com/emmy6-d/student_portal/blob/main/app/routers/students.py) (Student routes), [`app/main.py`](https://github.com/emmy6-d/student_portal/blob/main/app/main.py) (FastAPI application), [`app/database/connection.py`](https://github.com/emmy6-d/student_portal/blob/main/app/database/connection.py) (DB connection), [`app/models/student.py`](https://github.com/emmy6-d/student_portal/blob/main/app/models/student.py) (Student model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_application["FastAPI application<br/>[main.py]"]
  node_student_routes["Student routes<br/>[students.py]"]
end

subgraph group_domain["Student data"]
  node_student_schemas["Student schemas<br/>[student.py]"]
  node_student_model["Student model<br/>[student.py]"]
end

subgraph group_persistence["Persistence"]
  node_db_connection["DB connection<br/>[connection.py]"]
end

node_client(("API client"))
node_mysql[("MySQL database")]

node_client -->|"sends requests"| node_application
node_application -->|"registers routes"| node_student_routes
node_application -->|"creates tables"| node_db_connection
node_application -->|"loads model"| node_student_model
node_student_routes -->|"validates and shapes"| node_student_schemas
node_student_routes -->|"queries and updates"| node_student_model
node_student_routes -->|"gets sessions"| node_db_connection
node_student_routes -->|"reads and writes"| node_mysql
node_db_connection -->|"configures engine"| node_mysql

click node_application "https://github.com/emmy6-d/student_portal/blob/main/app/main.py"
click node_student_routes "https://github.com/emmy6-d/student_portal/blob/main/app/routers/students.py"
click node_student_schemas "https://github.com/emmy6-d/student_portal/blob/main/app/schemas/student.py"
click node_student_model "https://github.com/emmy6-d/student_portal/blob/main/app/models/student.py"
click node_db_connection "https://github.com/emmy6-d/student_portal/blob/main/app/database/connection.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_application,node_student_routes,node_client toneBlue
class node_student_schemas,node_student_model,node_mysql toneAmber
class node_db_connection toneMint
```

## Components

### API

- [FastAPI application](https://github.com/emmy6-d/student_portal/blob/main/app/main.py): `app/main.py`
- [Student routes](https://github.com/emmy6-d/student_portal/blob/main/app/routers/students.py): `app/routers/students.py`

### Student data

- [Student schemas](https://github.com/emmy6-d/student_portal/blob/main/app/schemas/student.py): `app/schemas/student.py`
- [Student model](https://github.com/emmy6-d/student_portal/blob/main/app/models/student.py): `app/models/student.py`

### Persistence

- [DB connection](https://github.com/emmy6-d/student_portal/blob/main/app/database/connection.py): `app/database/connection.py`

### Other components

- **API client**
- **MySQL database**

## Connections

- API client → FastAPI application: sends requests (evidence: `app/main.py`)
- FastAPI application → Student routes: registers routes (evidence: `app/main.py`)
- FastAPI application → DB connection: creates tables (evidence: `app/main.py`)
- FastAPI application → Student model: loads model (evidence: `app/main.py`)
- Student routes → Student schemas: validates and shapes (evidence: `app/routers/students.py`)
- Student routes → Student model: queries and updates (evidence: `app/routers/students.py`)
- Student routes → DB connection: gets sessions (evidence: `app/routers/students.py`)
- Student routes → MySQL database: reads and writes (evidence: `app/routers/students.py`)
- DB connection → MySQL database: configures engine (evidence: `app/database/connection.py`)
