# aksofttech/school-erp-backend architecture

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

- Interactive diagram: https://gitdiagram.com/aksofttech/school-erp-backend
- Repository: https://github.com/aksofttech/school-erp-backend

## Overview

This is a multi-school management API for school administrators, teachers, students, and parents. Its main workflow is authenticated API requests routed to domain services, which apply role and school context and persist or retrieve records through Prisma. The product also includes academic operations, fee and payroll administration, reporting, communication, documents, transport, and platform-level school/license management. The README is empty; links reflect only controller/service calls and service-to-Prisma references visible in the source index or excerpts, so unsampled integration paths are omitted.

Main entry points: [`src/prisma/prisma.service.ts`](https://github.com/aksofttech/school-erp-backend/blob/main/src/prisma/prisma.service.ts) (School database), [`src/students/students.service.ts`](https://github.com/aksofttech/school-erp-backend/blob/main/src/students/students.service.ts) (Student records), [`src/attendance/attendance.service.ts`](https://github.com/aksofttech/school-erp-backend/blob/main/src/attendance/attendance.service.ts) (Attendance), [`src/timetable/timetable.service.ts`](https://github.com/aksofttech/school-erp-backend/blob/main/src/timetable/timetable.service.ts) (Timetable)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and platform"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_schools["Schools and licenses"]
end

subgraph group_academic["Academic operations"]
  node_students["Student records"]
  node_people["Parents and teachers<br/>[parents.service.ts]"]
  node_classes["Classes and subjects<br/>[classes.service.ts]"]
  node_timetable["Timetable"]
  node_attendance["Attendance"]
  node_exams["Exams and marks<br/>[marks.service.ts]"]
  node_homework["Homework"]
end

subgraph group_admin["School administration"]
  node_fees["Fees<br/>[fees.service.ts]"]
  node_payroll["Payroll<br/>[payroll.service.ts]"]
  node_transport["Transport"]
  node_documents["Documents"]
  node_communications["Notices and announcements"]
  node_support["Support tickets<br/>[support.service.ts]"]
end

subgraph group_shared["Shared services"]
  node_dashboard["Dashboards"]
  node_reports["Reports and analytics<br/>[reports.service.ts]"]
  node_settings["Settings"]
  node_notifications["Notifications"]
  node_db[("School database<br/>[prisma.service.ts]")]
  node_authguard["JWT guard<br/>[jwt-auth.guard.ts]"]
  node_rolesguard["Role guard<br/>[roles.guard.ts]"]
  node_currentuser["User context<br/>[user.decorator.ts]"]
end

node_caller(("API users"))

node_caller -.->|"signs in"| node_auth
node_caller -.->|"requests records"| node_students
node_caller -.->|"marks attendance"| node_attendance
node_caller -.->|"manages schedule"| node_timetable
node_authguard -.->|"guards routes"| node_students
node_rolesguard -.->|"checks roles"| node_students
node_currentuser -.->|"provides identity"| node_students
node_students -->|"reads and writes"| node_db
node_attendance -->|"reads and writes"| node_db
node_timetable -->|"reads and writes"| node_db
node_dashboard -->|"queries metrics"| node_db
node_reports -->|"queries reports"| node_db
node_attendance -->|"requests attendance report"| node_reports
node_students -.->|"returns results"| node_caller
node_attendance -.->|"returns results"| node_caller
node_timetable -.->|"returns results"| node_caller
node_fees -.->|"reads and writes"| node_db
node_exams -.->|"reads and writes"| node_db
node_homework -.->|"reads and writes"| node_db
node_people -.->|"reads and writes"| node_db
node_classes -.->|"reads and writes"| node_db
node_payroll -.->|"reads and writes"| node_db
node_transport -.->|"reads and writes"| node_db
node_documents -.->|"reads and writes"| node_db
node_communications -.->|"reads and writes"| node_db
node_support -.->|"reads and writes"| node_db
node_settings -.->|"reads and writes"| node_db
node_notifications -.->|"serves notifications"| node_caller
node_schools -.->|"manages platform records"| node_db

click node_auth "https://github.com/aksofttech/school-erp-backend/blob/main/src/auth/auth.service.ts"
click node_schools "https://github.com/aksofttech/school-erp-backend/tree/main/src/super-admin"
click node_students "https://github.com/aksofttech/school-erp-backend/blob/main/src/students/students.service.ts"
click node_people "https://github.com/aksofttech/school-erp-backend/blob/main/src/parents/parents.service.ts"
click node_classes "https://github.com/aksofttech/school-erp-backend/blob/main/src/classes/classes.service.ts"
click node_timetable "https://github.com/aksofttech/school-erp-backend/blob/main/src/timetable/timetable.service.ts"
click node_attendance "https://github.com/aksofttech/school-erp-backend/blob/main/src/attendance/attendance.service.ts"
click node_exams "https://github.com/aksofttech/school-erp-backend/blob/main/src/exams/marks.service.ts"
click node_homework "https://github.com/aksofttech/school-erp-backend/blob/main/src/homework/homework.service.ts"
click node_fees "https://github.com/aksofttech/school-erp-backend/blob/main/src/fees/fees.service.ts"
click node_payroll "https://github.com/aksofttech/school-erp-backend/blob/main/src/payroll/payroll.service.ts"
click node_transport "https://github.com/aksofttech/school-erp-backend/blob/main/src/transport/transport.service.ts"
click node_documents "https://github.com/aksofttech/school-erp-backend/blob/main/src/documents/documents.service.ts"
click node_communications "https://github.com/aksofttech/school-erp-backend/tree/main/src/communication"
click node_support "https://github.com/aksofttech/school-erp-backend/blob/main/src/support/support.service.ts"
click node_dashboard "https://github.com/aksofttech/school-erp-backend/blob/main/src/dashboard/dashboard.service.ts"
click node_reports "https://github.com/aksofttech/school-erp-backend/blob/main/src/reports/reports.service.ts"
click node_settings "https://github.com/aksofttech/school-erp-backend/blob/main/src/settings/settings.service.ts"
click node_notifications "https://github.com/aksofttech/school-erp-backend/blob/main/src/notifications/notifications.service.ts"
click node_db "https://github.com/aksofttech/school-erp-backend/blob/main/src/prisma/prisma.service.ts"
click node_authguard "https://github.com/aksofttech/school-erp-backend/blob/main/src/common/guards/jwt-auth.guard.ts"
click node_rolesguard "https://github.com/aksofttech/school-erp-backend/blob/main/src/common/guards/roles.guard.ts"
click node_currentuser "https://github.com/aksofttech/school-erp-backend/blob/main/src/common/decorators/user.decorator.ts"

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_auth,node_schools,node_caller toneBlue
class node_students,node_people,node_classes,node_timetable,node_attendance,node_exams,node_homework toneAmber
class node_fees,node_payroll,node_transport,node_documents,node_communications,node_support toneMint
class node_dashboard,node_reports,node_settings,node_notifications,node_db,node_authguard,node_rolesguard,node_currentuser toneRose
```

## Components

### Access and platform

- [Authentication](https://github.com/aksofttech/school-erp-backend/blob/main/src/auth/auth.service.ts): `src/auth/auth.service.ts`
- [Schools and licenses](https://github.com/aksofttech/school-erp-backend/tree/main/src/super-admin): `src/super-admin`

### Academic operations

- [Student records](https://github.com/aksofttech/school-erp-backend/blob/main/src/students/students.service.ts): `src/students/students.service.ts`
- [Parents and teachers](https://github.com/aksofttech/school-erp-backend/blob/main/src/parents/parents.service.ts): `src/parents/parents.service.ts`
- [Classes and subjects](https://github.com/aksofttech/school-erp-backend/blob/main/src/classes/classes.service.ts): `src/classes/classes.service.ts`
- [Timetable](https://github.com/aksofttech/school-erp-backend/blob/main/src/timetable/timetable.service.ts): `src/timetable/timetable.service.ts`
- [Attendance](https://github.com/aksofttech/school-erp-backend/blob/main/src/attendance/attendance.service.ts): `src/attendance/attendance.service.ts`
- [Exams and marks](https://github.com/aksofttech/school-erp-backend/blob/main/src/exams/marks.service.ts): `src/exams/marks.service.ts`
- [Homework](https://github.com/aksofttech/school-erp-backend/blob/main/src/homework/homework.service.ts): `src/homework/homework.service.ts`

### School administration

- [Fees](https://github.com/aksofttech/school-erp-backend/blob/main/src/fees/fees.service.ts): `src/fees/fees.service.ts`
- [Payroll](https://github.com/aksofttech/school-erp-backend/blob/main/src/payroll/payroll.service.ts): `src/payroll/payroll.service.ts`
- [Transport](https://github.com/aksofttech/school-erp-backend/blob/main/src/transport/transport.service.ts): `src/transport/transport.service.ts`
- [Documents](https://github.com/aksofttech/school-erp-backend/blob/main/src/documents/documents.service.ts): `src/documents/documents.service.ts`
- [Notices and announcements](https://github.com/aksofttech/school-erp-backend/tree/main/src/communication): `src/communication`
- [Support tickets](https://github.com/aksofttech/school-erp-backend/blob/main/src/support/support.service.ts): `src/support/support.service.ts`

### Shared services

- [Dashboards](https://github.com/aksofttech/school-erp-backend/blob/main/src/dashboard/dashboard.service.ts): `src/dashboard/dashboard.service.ts`
- [Reports and analytics](https://github.com/aksofttech/school-erp-backend/blob/main/src/reports/reports.service.ts): `src/reports/reports.service.ts`
- [Settings](https://github.com/aksofttech/school-erp-backend/blob/main/src/settings/settings.service.ts): `src/settings/settings.service.ts`
- [Notifications](https://github.com/aksofttech/school-erp-backend/blob/main/src/notifications/notifications.service.ts): `src/notifications/notifications.service.ts`
- [School database](https://github.com/aksofttech/school-erp-backend/blob/main/src/prisma/prisma.service.ts): `src/prisma/prisma.service.ts`
- [JWT guard](https://github.com/aksofttech/school-erp-backend/blob/main/src/common/guards/jwt-auth.guard.ts): `src/common/guards/jwt-auth.guard.ts`
- [Role guard](https://github.com/aksofttech/school-erp-backend/blob/main/src/common/guards/roles.guard.ts): `src/common/guards/roles.guard.ts`
- [User context](https://github.com/aksofttech/school-erp-backend/blob/main/src/common/decorators/user.decorator.ts): `src/common/decorators/user.decorator.ts`

### Other components

- **API users**

## Connections

- API users → Authentication: signs in
- API users → Student records: requests records
- API users → Attendance: marks attendance
- API users → Timetable: manages schedule
- JWT guard → Student records: guards routes
- Role guard → Student records: checks roles
- User context → Student records: provides identity
- Student records → School database: reads and writes (evidence: `src/students/students.service.ts`)
- Attendance → School database: reads and writes (evidence: `src/attendance/attendance.service.ts`)
- Timetable → School database: reads and writes (evidence: `src/timetable/timetable.service.ts`)
- Dashboards → School database: queries metrics (evidence: `src/dashboard/dashboard.service.ts`)
- Reports and analytics → School database: queries reports (evidence: `src/reports/reports.service.ts`)
- Attendance → Reports and analytics: requests attendance report (evidence: `src/attendance/attendance.controller.ts`)
- Student records → API users: returns results
- Attendance → API users: returns results
- Timetable → API users: returns results
- Fees → School database: reads and writes (evidence: `src/fees/fees.service.ts`)
- Exams and marks → School database: reads and writes
- Homework → School database: reads and writes
- Parents and teachers → School database: reads and writes
- Classes and subjects → School database: reads and writes
- Payroll → School database: reads and writes
- Transport → School database: reads and writes
- Documents → School database: reads and writes
- Notices and announcements → School database: reads and writes
- Support tickets → School database: reads and writes
- Settings → School database: reads and writes
- Notifications → API users: serves notifications
- Schools and licenses → School database: manages platform records
