# pirnavadmin/sms architecture

> Architecture diagram of the GitHub repository pirnavadmin/sms, 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/pirnavadmin/sms
- Repository: https://github.com/pirnavadmin/sms

## Overview

This is a school-management system with a React/TypeScript client and an ASP.NET Core API. A user enters through the client, which selects role-specific views; those views use the API to manage school operations. The backend exposes distinct domains including admissions and identity, academics and timetabling, finance and payroll, transport, hostel, and staff. The sampled excerpts show direct controller-to-database and controller-to-service actions. The README is empty, and unsampled domain wiring is not inferred; dashed links mark unverified client/API interactions.

Main entry points: [`Backend/Data/AppDbContext.cs`](https://github.com/pirnavadmin/sms/blob/main/Backend/Data/AppDbContext.cs) (School database context), [`Backend/Controllers/AcademicManagement/ClassesController.cs`](https://github.com/pirnavadmin/sms/blob/main/Backend/Controllers/AcademicManagement/ClassesController.cs) (Class and section management), [`Frontend/school-management-system/src/App.tsx`](https://github.com/pirnavadmin/sms/blob/main/Frontend/school-management-system/src/App.tsx) (Role-based application), [`Backend/Services/Implementations/AuthService.cs`](https://github.com/pirnavadmin/sms/blob/main/Backend/Services/Implementations/AuthService.cs) (Authentication service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["Role-based application<br/>[App.tsx]"]
  node_api_client["HTTP client<br/>[client.ts]"]
end

subgraph group_api["API runtime"]
  node_startup["API startup<br/>[Program.cs]"]
  node_database[("School database context<br/>[AppDbContext.cs]")]
end

subgraph group_identity["Identity and admissions"]
  node_auth_service["Authentication service<br/>[AuthService.cs]"]
  node_auth_controllers["Authentication and admissions"]
  node_user_model["User and role records<br/>[User.cs]"]
  node_student_model["Student records<br/>[Student.cs]"]
end

subgraph group_academics["Academics"]
  node_classes["Class and section management"]
  node_class_model["Class grades and sections<br/>[ClassGrade.cs]"]
  node_section_model["Section records<br/>[ClassSection.cs]"]
  node_mapping_model["Class subject mappings"]
  node_academic_year["Academic years<br/>[AcademicYear.cs]"]
  node_timetable["Timetable generation"]
  node_timetable_repo["Timetable persistence"]
end

subgraph group_operations["School operations"]
  node_finance["Finance configuration"]
  node_finance_repo["Finance master persistence"]
  node_payroll["Payroll processing"]
  node_hostel["Hostel management"]
  node_transport["Transport management"]
  node_staff_model["Staff records<br/>[Staff.cs]"]
end

node_user(("School user"))

node_user -->|"uses"| node_webapp
node_webapp -.->|"requests data"| node_api_client
node_api_client -.->|"calls API"| node_startup
node_startup -->|"configures"| node_database
node_startup -->|"registers"| node_auth_service
node_auth_service -->|"authenticates"| node_user_model
node_auth_service -->|"checks identity"| node_student_model
node_auth_controllers -.->|"dispatches"| node_auth_service
node_classes -->|"reads and writes"| node_database
node_classes -->|"loads class data"| node_class_model
node_classes -->|"loads sections"| node_section_model
node_classes -->|"manages mappings"| node_mapping_model
node_timetable -->|"uses repository"| node_timetable_repo
node_finance -.->|"persists via"| node_finance_repo
node_finance -->|"delegates to service"| node_database
node_finance_repo -->|"reads and writes"| node_database
node_payroll -->|"reads and writes"| node_database
node_hostel -.->|"delegates to service"| node_database
node_webapp -->|"routes views"| node_hostel
node_webapp -->|"routes views"| node_transport

click node_webapp "https://github.com/pirnavadmin/sms/blob/main/Frontend/school-management-system/src/App.tsx"
click node_api_client "https://github.com/pirnavadmin/sms/blob/main/Frontend/school-management-system/src/api/client.ts"
click node_startup "https://github.com/pirnavadmin/sms/blob/main/Backend/Program.cs"
click node_database "https://github.com/pirnavadmin/sms/blob/main/Backend/Data/AppDbContext.cs"
click node_auth_service "https://github.com/pirnavadmin/sms/blob/main/Backend/Services/Implementations/AuthService.cs"
click node_auth_controllers "https://github.com/pirnavadmin/sms/tree/main/Backend/Controllers/Auth"
click node_user_model "https://github.com/pirnavadmin/sms/blob/main/Backend/Models/User.cs"
click node_student_model "https://github.com/pirnavadmin/sms/blob/main/Backend/Models/Student.cs"
click node_classes "https://github.com/pirnavadmin/sms/blob/main/Backend/Controllers/AcademicManagement/ClassesController.cs"
click node_class_model "https://github.com/pirnavadmin/sms/blob/main/Backend/Models/AcademicManagement/ClassGrade.cs"
click node_section_model "https://github.com/pirnavadmin/sms/blob/main/Backend/Models/AcademicManagement/ClassSection.cs"
click node_mapping_model "https://github.com/pirnavadmin/sms/blob/main/Backend/Models/AcademicManagement/ClassSubjectMapping.cs"
click node_academic_year "https://github.com/pirnavadmin/sms/blob/main/Backend/Models/AcademicYear.cs"
click node_timetable "https://github.com/pirnavadmin/sms/blob/main/Backend/Services/Implementations/AcademicManagement/TimetableGenerationService.cs"
click node_timetable_repo "https://github.com/pirnavadmin/sms/blob/main/Backend/Repositories/Implementations/TimetableRepository.cs"
click node_finance "https://github.com/pirnavadmin/sms/blob/main/Backend/Controllers/FinanceManagement/FinanceMasterController.cs"
click node_finance_repo "https://github.com/pirnavadmin/sms/blob/main/Backend/Repositories/Implementations/FinanceManagement/FinanceMasterRepository.cs"
click node_payroll "https://github.com/pirnavadmin/sms/blob/main/Backend/Controllers/PayrollProcessingController.cs"
click node_hostel "https://github.com/pirnavadmin/sms/blob/main/Backend/Controllers/Hostel/HostelController.cs"
click node_transport "https://github.com/pirnavadmin/sms/tree/main/Backend/Controllers/Transport"
click node_staff_model "https://github.com/pirnavadmin/sms/blob/main/Backend/Models/StaffManagement/Staff.cs"

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_webapp,node_api_client,node_user toneBlue
class node_startup,node_database toneAmber
class node_auth_service,node_auth_controllers,node_user_model,node_student_model toneMint
class node_classes,node_class_model,node_section_model,node_mapping_model,node_academic_year,node_timetable,node_timetable_repo toneRose
class node_finance,node_finance_repo,node_payroll,node_hostel,node_transport,node_staff_model toneIndigo
```

## Components

### Web client

- [Role-based application](https://github.com/pirnavadmin/sms/blob/main/Frontend/school-management-system/src/App.tsx): `Frontend/school-management-system/src/App.tsx`
- [HTTP client](https://github.com/pirnavadmin/sms/blob/main/Frontend/school-management-system/src/api/client.ts): `Frontend/school-management-system/src/api/client.ts`

### API runtime

- [API startup](https://github.com/pirnavadmin/sms/blob/main/Backend/Program.cs): `Backend/Program.cs`
- [School database context](https://github.com/pirnavadmin/sms/blob/main/Backend/Data/AppDbContext.cs): `Backend/Data/AppDbContext.cs`

### Identity and admissions

- [Authentication service](https://github.com/pirnavadmin/sms/blob/main/Backend/Services/Implementations/AuthService.cs): `Backend/Services/Implementations/AuthService.cs`
- [Authentication and admissions](https://github.com/pirnavadmin/sms/tree/main/Backend/Controllers/Auth): `Backend/Controllers/Auth`
- [User and role records](https://github.com/pirnavadmin/sms/blob/main/Backend/Models/User.cs): `Backend/Models/User.cs`
- [Student records](https://github.com/pirnavadmin/sms/blob/main/Backend/Models/Student.cs): `Backend/Models/Student.cs`

### Academics

- [Class and section management](https://github.com/pirnavadmin/sms/blob/main/Backend/Controllers/AcademicManagement/ClassesController.cs): `Backend/Controllers/AcademicManagement/ClassesController.cs`
- [Class grades and sections](https://github.com/pirnavadmin/sms/blob/main/Backend/Models/AcademicManagement/ClassGrade.cs): `Backend/Models/AcademicManagement/ClassGrade.cs`
- [Section records](https://github.com/pirnavadmin/sms/blob/main/Backend/Models/AcademicManagement/ClassSection.cs): `Backend/Models/AcademicManagement/ClassSection.cs`
- [Class subject mappings](https://github.com/pirnavadmin/sms/blob/main/Backend/Models/AcademicManagement/ClassSubjectMapping.cs): `Backend/Models/AcademicManagement/ClassSubjectMapping.cs`
- [Academic years](https://github.com/pirnavadmin/sms/blob/main/Backend/Models/AcademicYear.cs): `Backend/Models/AcademicYear.cs`
- [Timetable generation](https://github.com/pirnavadmin/sms/blob/main/Backend/Services/Implementations/AcademicManagement/TimetableGenerationService.cs): `Backend/Services/Implementations/AcademicManagement/TimetableGenerationService.cs`
- [Timetable persistence](https://github.com/pirnavadmin/sms/blob/main/Backend/Repositories/Implementations/TimetableRepository.cs): `Backend/Repositories/Implementations/TimetableRepository.cs`

### School operations

- [Finance configuration](https://github.com/pirnavadmin/sms/blob/main/Backend/Controllers/FinanceManagement/FinanceMasterController.cs): `Backend/Controllers/FinanceManagement/FinanceMasterController.cs`
- [Finance master persistence](https://github.com/pirnavadmin/sms/blob/main/Backend/Repositories/Implementations/FinanceManagement/FinanceMasterRepository.cs): `Backend/Repositories/Implementations/FinanceManagement/FinanceMasterRepository.cs`
- [Payroll processing](https://github.com/pirnavadmin/sms/blob/main/Backend/Controllers/PayrollProcessingController.cs): `Backend/Controllers/PayrollProcessingController.cs`
- [Hostel management](https://github.com/pirnavadmin/sms/blob/main/Backend/Controllers/Hostel/HostelController.cs): `Backend/Controllers/Hostel/HostelController.cs`
- [Transport management](https://github.com/pirnavadmin/sms/tree/main/Backend/Controllers/Transport): `Backend/Controllers/Transport`
- [Staff records](https://github.com/pirnavadmin/sms/blob/main/Backend/Models/StaffManagement/Staff.cs): `Backend/Models/StaffManagement/Staff.cs`

### Other components

- **School user**

## Connections

- School user → Role-based application: uses (evidence: `Frontend/school-management-system/src/App.tsx`)
- Role-based application → HTTP client: requests data
- HTTP client → API startup: calls API
- API startup → School database context: configures (evidence: `Backend/Program.cs`)
- API startup → Authentication service: registers (evidence: `Backend/Program.cs`)
- Authentication service → User and role records: authenticates (evidence: `Backend/Services/Implementations/AuthService.cs`)
- Authentication service → Student records: checks identity (evidence: `Backend/Services/Implementations/AuthService.cs`)
- Authentication and admissions → Authentication service: dispatches
- Class and section management → School database context: reads and writes (evidence: `Backend/Controllers/AcademicManagement/ClassesController.cs`)
- Class and section management → Class grades and sections: loads class data (evidence: `Backend/Controllers/AcademicManagement/ClassesController.cs`)
- Class and section management → Section records: loads sections (evidence: `Backend/Controllers/AcademicManagement/ClassesController.cs`)
- Class and section management → Class subject mappings: manages mappings (evidence: `Backend/Controllers/AcademicManagement/ClassesController.cs`)
- Timetable generation → Timetable persistence: uses repository
- Finance configuration → Finance master persistence: persists via
- Finance configuration → School database context: delegates to service (evidence: `Backend/Controllers/FinanceManagement/FinanceMasterController.cs`)
- Finance master persistence → School database context: reads and writes (evidence: `Backend/Repositories/Implementations/FinanceManagement/FinanceMasterRepository.cs`)
- Payroll processing → School database context: reads and writes (evidence: `Backend/Controllers/PayrollProcessingController.cs`)
- Hostel management → School database context: delegates to service
- Role-based application → Hostel management: routes views (evidence: `Frontend/school-management-system/src/App.tsx`)
- Role-based application → Transport management: routes views (evidence: `Frontend/school-management-system/src/App.tsx`)
