# edomate/be-student-service architecture

> Architecture diagram of the GitHub repository edomate/be-student-service, 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/edomate/be-student-service
- Repository: https://github.com/edomate/be-student-service

## Overview

This is a FastAPI student-and-parent service for school operations. The principal workflow is an authenticated client calling a routed API, which delegates domain work and returns results; its modules cover student records, academics, exams, and learning, alongside broader campus capabilities. Shared SQLAlchemy mappings use the configured MySQL database, while file-handling services can use S3. The README is empty, so capabilities and relationships below are based on the tree and SOURCE INDEX; unsampled subsystems are included without asserting unverified internal calls.

Main entry points: [`main.py`](https://github.com/edomate/be-student-service/blob/main/main.py) (FastAPI app), [`core/database.py`](https://github.com/edomate/be-student-service/blob/main/core/database.py) (MySQL database), [`app/modules/lms/router.py`](https://github.com/edomate/be-student-service/blob/main/app/modules/lms/router.py) (Learning routes), [`app/modules/students/router.py`](https://github.com/edomate/be-student-service/blob/main/app/modules/students/router.py) (Student routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and identity"]
  node_app["FastAPI app<br/>[main.py]"]
  node_auth_routes["Auth routes<br/>[router.py]"]
  node_auth_service["Authentication<br/>[service.py]"]
  node_auth_guard["Student identity<br/>[dependencies.py]"]
end

subgraph group_learning["Learning and academics"]
  node_academics["Academics"]
  node_exams["Exams"]
  node_lms_routes["Learning routes<br/>[router.py]"]
  node_lms_services["Learning services"]
end

subgraph group_student["Student records"]
  node_student_routes["Student routes<br/>[router.py]"]
  node_student_service["Student operations<br/>[service.py]"]
  node_student_repo["Student data access<br/>[repository.py]"]
  node_student_models["Student mappings<br/>[models.py]"]
end

subgraph group_campus["Campus services"]
  node_fees["Fee management"]
  node_hostel["Hostel management"]
  node_library["Library"]
  node_events["Events"]
  node_campus_other["Other campus features"]
  node_dashboard["Dashboard summaries"]
  node_notifications["Notifications"]
end

subgraph group_shared["Shared infrastructure"]
  node_database[("MySQL database<br/>[database.py]")]
  node_storage["S3 storage<br/>[storage.py]"]
  node_grpc["gRPC service<br/>[server.py]"]
end

node_client(("Student or parent"))

node_client -->|"sends requests"| node_app
node_app -->|"registers routes"| node_auth_routes
node_app -->|"registers routes"| node_student_routes
node_app -->|"registers routes"| node_lms_routes
node_app -->|"registers routes"| node_academics
node_app -->|"registers routes"| node_exams
node_app -->|"registers routes"| node_fees
node_app -->|"registers routes"| node_hostel
node_app -->|"registers routes"| node_library
node_app -->|"registers routes"| node_events
node_app -->|"registers routes"| node_dashboard
node_app -->|"registers routes"| node_notifications
node_app -->|"registers routes"| node_campus_other
node_app -->|"starts server"| node_grpc
node_auth_routes -.->|"delegates to"| node_auth_service
node_student_routes -.->|"delegates to"| node_student_service
node_student_service -->|"uses"| node_student_repo
node_student_repo -->|"queries"| node_student_models
node_lms_routes -->|"dispatches to"| node_lms_services
node_lms_routes -->|"authenticates with"| node_auth_guard
node_student_routes -.->|"authenticates with"| node_auth_guard
node_academics -->|"uses mappings"| node_database
node_exams -->|"uses mappings"| node_database
node_fees -->|"uses mappings"| node_database
node_hostel -->|"uses mappings"| node_database
node_library -->|"uses mappings"| node_database
node_student_models -->|"uses mappings"| node_database
node_student_service -->|"stores files"| node_storage
node_app -->|"checks connection"| node_database

click node_app "https://github.com/edomate/be-student-service/blob/main/main.py"
click node_auth_routes "https://github.com/edomate/be-student-service/blob/main/app/modules/auth/router.py"
click node_auth_service "https://github.com/edomate/be-student-service/blob/main/app/modules/auth/service.py"
click node_auth_guard "https://github.com/edomate/be-student-service/blob/main/app/modules/auth/dependencies.py"
click node_student_routes "https://github.com/edomate/be-student-service/blob/main/app/modules/students/router.py"
click node_student_service "https://github.com/edomate/be-student-service/blob/main/app/modules/students/service.py"
click node_student_repo "https://github.com/edomate/be-student-service/blob/main/app/modules/students/repository.py"
click node_student_models "https://github.com/edomate/be-student-service/blob/main/app/modules/students/models.py"
click node_academics "https://github.com/edomate/be-student-service/tree/main/app/modules/academics"
click node_exams "https://github.com/edomate/be-student-service/tree/main/app/modules/exams"
click node_lms_routes "https://github.com/edomate/be-student-service/blob/main/app/modules/lms/router.py"
click node_lms_services "https://github.com/edomate/be-student-service/tree/main/app/modules/lms"
click node_fees "https://github.com/edomate/be-student-service/tree/main/app/modules/fees"
click node_hostel "https://github.com/edomate/be-student-service/tree/main/app/modules/hostel"
click node_library "https://github.com/edomate/be-student-service/tree/main/app/modules/library"
click node_events "https://github.com/edomate/be-student-service/tree/main/app/modules/events"
click node_campus_other "https://github.com/edomate/be-student-service/tree/main/app/modules"
click node_dashboard "https://github.com/edomate/be-student-service/tree/main/app/modules/dashboard"
click node_notifications "https://github.com/edomate/be-student-service/tree/main/app/modules/notifications"
click node_database "https://github.com/edomate/be-student-service/blob/main/core/database.py"
click node_storage "https://github.com/edomate/be-student-service/blob/main/core/storage.py"
click node_grpc "https://github.com/edomate/be-student-service/blob/main/app/grpc/server.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,node_auth_routes,node_auth_service,node_auth_guard toneBlue
class node_academics,node_exams,node_lms_routes,node_lms_services toneAmber
class node_student_routes,node_student_service,node_student_repo,node_student_models toneMint
class node_fees,node_hostel,node_library,node_events,node_campus_other,node_dashboard,node_notifications toneRose
class node_database,node_storage,node_grpc,node_client toneIndigo
```

## Components

### API and identity

- [FastAPI app](https://github.com/edomate/be-student-service/blob/main/main.py): `main.py`
- [Auth routes](https://github.com/edomate/be-student-service/blob/main/app/modules/auth/router.py): `app/modules/auth/router.py`
- [Authentication](https://github.com/edomate/be-student-service/blob/main/app/modules/auth/service.py): `app/modules/auth/service.py`
- [Student identity](https://github.com/edomate/be-student-service/blob/main/app/modules/auth/dependencies.py): `app/modules/auth/dependencies.py`

### Learning and academics

- [Academics](https://github.com/edomate/be-student-service/tree/main/app/modules/academics): `app/modules/academics`
- [Exams](https://github.com/edomate/be-student-service/tree/main/app/modules/exams): `app/modules/exams`
- [Learning routes](https://github.com/edomate/be-student-service/blob/main/app/modules/lms/router.py): `app/modules/lms/router.py`
- [Learning services](https://github.com/edomate/be-student-service/tree/main/app/modules/lms): `app/modules/lms`

### Student records

- [Student routes](https://github.com/edomate/be-student-service/blob/main/app/modules/students/router.py): `app/modules/students/router.py`
- [Student operations](https://github.com/edomate/be-student-service/blob/main/app/modules/students/service.py): `app/modules/students/service.py`
- [Student data access](https://github.com/edomate/be-student-service/blob/main/app/modules/students/repository.py): `app/modules/students/repository.py`
- [Student mappings](https://github.com/edomate/be-student-service/blob/main/app/modules/students/models.py): `app/modules/students/models.py`

### Campus services

- [Fee management](https://github.com/edomate/be-student-service/tree/main/app/modules/fees): `app/modules/fees`
- [Hostel management](https://github.com/edomate/be-student-service/tree/main/app/modules/hostel): `app/modules/hostel`
- [Library](https://github.com/edomate/be-student-service/tree/main/app/modules/library): `app/modules/library`
- [Events](https://github.com/edomate/be-student-service/tree/main/app/modules/events): `app/modules/events`
- [Other campus features](https://github.com/edomate/be-student-service/tree/main/app/modules): `app/modules`
- [Dashboard summaries](https://github.com/edomate/be-student-service/tree/main/app/modules/dashboard): `app/modules/dashboard`
- [Notifications](https://github.com/edomate/be-student-service/tree/main/app/modules/notifications): `app/modules/notifications`

### Shared infrastructure

- [MySQL database](https://github.com/edomate/be-student-service/blob/main/core/database.py): `core/database.py`
- [S3 storage](https://github.com/edomate/be-student-service/blob/main/core/storage.py): `core/storage.py`
- [gRPC service](https://github.com/edomate/be-student-service/blob/main/app/grpc/server.py): `app/grpc/server.py`

### Other components

- **Student or parent**

## Connections

- Student or parent → FastAPI app: sends requests (evidence: `main.py`)
- FastAPI app → Auth routes: registers routes (evidence: `main.py`)
- FastAPI app → Student routes: registers routes (evidence: `main.py`)
- FastAPI app → Learning routes: registers routes (evidence: `main.py`)
- FastAPI app → Academics: registers routes (evidence: `main.py`)
- FastAPI app → Exams: registers routes (evidence: `main.py`)
- FastAPI app → Fee management: registers routes (evidence: `main.py`)
- FastAPI app → Hostel management: registers routes (evidence: `main.py`)
- FastAPI app → Library: registers routes (evidence: `main.py`)
- FastAPI app → Events: registers routes (evidence: `main.py`)
- FastAPI app → Dashboard summaries: registers routes (evidence: `main.py`)
- FastAPI app → Notifications: registers routes (evidence: `main.py`)
- FastAPI app → Other campus features: registers routes (evidence: `main.py`)
- FastAPI app → gRPC service: starts server (evidence: `main.py`)
- Auth routes → Authentication: delegates to
- Student routes → Student operations: delegates to
- Student operations → Student data access: uses (evidence: `app/modules/students/service.py`)
- Student data access → Student mappings: queries (evidence: `app/modules/students/repository.py`)
- Learning routes → Learning services: dispatches to (evidence: `app/modules/lms/router.py`)
- Learning routes → Student identity: authenticates with (evidence: `app/modules/lms/router.py`)
- Student routes → Student identity: authenticates with
- Academics → MySQL database: uses mappings (evidence: `app/modules/academics/models.py`)
- Exams → MySQL database: uses mappings
- Fee management → MySQL database: uses mappings (evidence: `app/modules/fees/models.py`)
- Hostel management → MySQL database: uses mappings (evidence: `app/modules/hostel/models.py`)
- Library → MySQL database: uses mappings (evidence: `app/modules/library/models.py`)
- Student mappings → MySQL database: uses mappings (evidence: `app/modules/students/models.py`)
- Student operations → S3 storage: stores files (evidence: `app/modules/students/service.py`)
- FastAPI app → MySQL database: checks connection (evidence: `main.py`)
