# atanu-giri-localhost/student-management-localhost architecture

> Architecture diagram of the GitHub repository atanu-giri-localhost/student-management-localhost, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/atanu-giri-localhost/student-management-localhost
- Repository: https://github.com/atanu-giri-localhost/student-management-localhost

## Overview

This is a role-based coaching-institute management system covering student lifecycle, academics, attendance, examinations, timetables, finance, reports, and parent/student/teacher portals. The primary workflow is portal users accessing protected API operations, which delegate to domain services and persist to Cloudflare D1; file attachments use R2. The graph combines documented capabilities with relationships visible in the supplied excerpts and source index. Several portal-to-API and domain-to-storage links are documented only at a broad level, so those links are marked unverified.

Main entry points: [`src/app/admin`](https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/admin) (Admin Portal), [`src/app/teacher`](https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/teacher) (Teacher Portal), [`src/app/api/v1/auth`](https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/api/v1/auth) (Authentication API), [`src/modules/performance/performance.service.js`](https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/performance/performance.service.js) (Exams and Performance)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["Role Portals"]
  node_admin["Admin Portal"]
  node_teacher["Teacher Portal"]
  node_student["Student Portal"]
  node_parent["Parent Portal"]
end

subgraph group_access["Access and API"]
  node_authapi["Authentication API"]
  node_authsvc["Authentication Service<br/>[auth.service.js]"]
  node_authrepo["Identity Repository<br/>[auth.repository.js]"]
  node_session["Session and RBAC<br/>[session.js]"]
  node_d1[("Cloudflare D1")]
end

subgraph group_school["School Operations"]
  node_academics["Academics"]
  node_students["Student Lifecycle"]
  node_teachers["Teachers"]
  node_attendance["Attendance"]
  node_timetable["Timetable"]
end

subgraph group_learning["Learning and Reports"]
  node_performance["Exams and Performance"]
  node_reports["Operational Reports"]
end

subgraph group_finance["Finance and Files"]
  node_finance["Fees and Payments"]
  node_files["File Attachments<br/>[files.service.js]"]
  node_r2[("Cloudflare R2")]
end

node_users(("Portal Users"))

node_users -->|"use portal"| node_admin
node_users -->|"use portal"| node_teacher
node_users -->|"use portal"| node_student
node_users -->|"use portal"| node_parent
node_admin -.->|"sign in"| node_authapi
node_teacher -.->|"sign in"| node_authapi
node_student -.->|"sign in"| node_authapi
node_parent -.->|"sign in"| node_authapi
node_authapi -.->|"dispatches to"| node_authsvc
node_authsvc -->|"calls"| node_authrepo
node_authsvc -->|"creates sessions"| node_session
node_session -.->|"loads session"| node_authrepo
node_authsvc -.->|"persists identity"| node_d1
node_academics -.->|"reads and writes"| node_d1
node_students -.->|"reads and writes"| node_d1
node_teachers -.->|"reads and writes"| node_d1
node_attendance -.->|"records attendance"| node_d1
node_timetable -.->|"reads and writes"| node_d1
node_performance -.->|"records results"| node_d1
node_reports -.->|"queries data"| node_d1
node_finance -.->|"records transactions"| node_d1
node_files -.->|"stores attachments"| node_r2
node_admin -.->|"manage operations"| node_academics
node_admin -.->|"manage admissions"| node_students
node_admin -.->|"oversee attendance"| node_attendance
node_admin -.->|"manage examinations"| node_performance
node_admin -.->|"manage fees"| node_finance
node_admin -.->|"view reports"| node_reports
node_teacher -.->|"mark attendance"| node_attendance
node_teacher -.->|"record performance"| node_performance
node_teacher -.->|"view timetable"| node_timetable
node_student -.->|"view results"| node_performance
node_student -.->|"view attendance"| node_attendance
node_parent -.->|"view fee status"| node_finance
node_parent -.->|"view results"| node_performance

click node_admin "https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/admin"
click node_teacher "https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/teacher"
click node_student "https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/student"
click node_parent "https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/parent"
click node_authapi "https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/api/v1/auth"
click node_authsvc "https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/auth/auth.service.js"
click node_authrepo "https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/auth/auth.repository.js"
click node_session "https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/lib/auth/session.js"
click node_academics "https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/academics/academics.service.js"
click node_students "https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/students/students.service.js"
click node_teachers "https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/teachers/teachers.service.js"
click node_attendance "https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/modules/attendance"
click node_timetable "https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/timetable/timetable.service.js"
click node_performance "https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/performance/performance.service.js"
click node_reports "https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/modules/reports"
click node_finance "https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/modules/finance"
click node_files "https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/files/files.service.js"

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_admin,node_teacher,node_student,node_parent,node_users toneBlue
class node_authapi,node_authsvc,node_authrepo,node_session,node_d1 toneAmber
class node_academics,node_students,node_teachers,node_attendance,node_timetable toneMint
class node_performance,node_reports toneRose
class node_finance,node_files,node_r2 toneIndigo
```

## Components

### Role Portals

- [Admin Portal](https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/admin): `src/app/admin`
- [Teacher Portal](https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/teacher): `src/app/teacher`
- [Student Portal](https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/student): `src/app/student`
- [Parent Portal](https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/parent): `src/app/parent`

### Access and API

- [Authentication API](https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/app/api/v1/auth): `src/app/api/v1/auth`
- [Authentication Service](https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/auth/auth.service.js): `src/modules/auth/auth.service.js`
- [Identity Repository](https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/auth/auth.repository.js): `src/modules/auth/auth.repository.js`
- [Session and RBAC](https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/lib/auth/session.js): `src/lib/auth/session.js`
- **Cloudflare D1**

### School Operations

- [Academics](https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/academics/academics.service.js): `src/modules/academics/academics.service.js`
- [Student Lifecycle](https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/students/students.service.js): `src/modules/students/students.service.js`
- [Teachers](https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/teachers/teachers.service.js): `src/modules/teachers/teachers.service.js`
- [Attendance](https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/modules/attendance): `src/modules/attendance`
- [Timetable](https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/timetable/timetable.service.js): `src/modules/timetable/timetable.service.js`

### Learning and Reports

- [Exams and Performance](https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/performance/performance.service.js): `src/modules/performance/performance.service.js`
- [Operational Reports](https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/modules/reports): `src/modules/reports`

### Finance and Files

- [Fees and Payments](https://github.com/atanu-giri-localhost/student-management-localhost/tree/main/src/modules/finance): `src/modules/finance`
- [File Attachments](https://github.com/atanu-giri-localhost/student-management-localhost/blob/main/src/modules/files/files.service.js): `src/modules/files/files.service.js`
- **Cloudflare R2**

### Other components

- **Portal Users**

## Connections

- Portal Users → Admin Portal: use portal
- Portal Users → Teacher Portal: use portal
- Portal Users → Student Portal: use portal
- Portal Users → Parent Portal: use portal
- Admin Portal → Authentication API: sign in
- Teacher Portal → Authentication API: sign in
- Student Portal → Authentication API: sign in
- Parent Portal → Authentication API: sign in
- Authentication API → Authentication Service: dispatches to
- Authentication Service → Identity Repository: calls (evidence: `src/modules/auth/auth.service.js`)
- Authentication Service → Session and RBAC: creates sessions (evidence: `src/modules/auth/auth.service.js`)
- Session and RBAC → Identity Repository: loads session (evidence: `src/lib/auth/session.js`)
- Authentication Service → Cloudflare D1: persists identity
- Academics → Cloudflare D1: reads and writes
- Student Lifecycle → Cloudflare D1: reads and writes
- Teachers → Cloudflare D1: reads and writes
- Attendance → Cloudflare D1: records attendance
- Timetable → Cloudflare D1: reads and writes
- Exams and Performance → Cloudflare D1: records results
- Operational Reports → Cloudflare D1: queries data
- Fees and Payments → Cloudflare D1: records transactions
- File Attachments → Cloudflare R2: stores attachments
- Admin Portal → Academics: manage operations
- Admin Portal → Student Lifecycle: manage admissions
- Admin Portal → Attendance: oversee attendance
- Admin Portal → Exams and Performance: manage examinations
- Admin Portal → Fees and Payments: manage fees
- Admin Portal → Operational Reports: view reports
- Teacher Portal → Attendance: mark attendance
- Teacher Portal → Exams and Performance: record performance
- Teacher Portal → Timetable: view timetable
- Student Portal → Exams and Performance: view results
- Student Portal → Attendance: view attendance
- Parent Portal → Fees and Payments: view fee status
- Parent Portal → Exams and Performance: view results
