# mjuniorahamad-collab/school-management-system architecture

> Architecture diagram of the GitHub repository mjuniorahamad-collab/school-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mjuniorahamad-collab/school-management-system
- Repository: https://github.com/mjuniorahamad-collab/school-management-system

## Overview

This repository is a school-management web application: staff authenticate, select a school context, and use the admin UI to manage school records and view operational data; parent portal and other domain modules extend the product. The documented data path is UI hooks/services through a shared API client to a tenant-scoped Express API and PostgreSQL. The README describes students, dashboard, and RBAC in detail; other capabilities are represented by their listed module paths, but their internal wiring was not sampled, so uncertain links are omitted.

Main entry points: [`src/app/App.tsx`](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/app/App.tsx) (React application), [`src/hooks/useAcademicSessions.ts`](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/hooks/useAcademicSessions.ts) (Data hooks), [`src/services/academicSessionsService.ts`](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/services/academicSessionsService.ts) (API service seam), [`src/lib/apiClient.ts`](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/lib/apiClient.ts) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Admin interface"]
  node_app["React application<br/>[App.tsx]"]
  node_authui["Auth context<br/>[AuthContext.tsx]"]
  node_hook["Data hooks"]
  node_service["API service seam"]
  node_client["HTTP client<br/>[apiClient.ts]"]
end

subgraph group_api["API and identity"]
  node_api_entry["Express API<br/>[app.ts]"]
  node_routes["API routers<br/>[index.ts]"]
  node_auth_controller["Auth handlers<br/>[auth.controller.ts]"]
  node_auth_service["Session and RBAC<br/>[auth.service.ts]"]
end

subgraph group_school["School operations"]
  node_students["Student records<br/>[student.service.ts]"]
  node_sessions["Academic sessions"]
  node_admissions["Admissions"]
  node_fees["Fees and payments"]
  node_dashboard["Dashboard insights"]
end

subgraph group_learning["Learning and engagement"]
  node_learning_ops["Attendance and results"]
  node_classwork["Classes and tasks"]
  node_portal["Family portal<br/>[portal.service.ts]"]
  node_communications["Notices and messages<br/>[message.service.ts]"]
  node_library["Library and transport<br/>[library.service.ts]"]
end

subgraph group_platform["Shared platform"]
  node_db[("PostgreSQL data<br/>[database.ts]")]
  node_storage["Photo storage<br/>[storage.ts]"]
end

node_staff(("School staff"))
node_parent(("Family user"))

node_staff -->|"uses"| node_app
node_app -->|"provides auth"| node_authui
node_app -->|"renders workflows"| node_hook
node_hook -->|"queries and mutates"| node_service
node_service -->|"sends requests"| node_client
node_client -->|"HTTP API"| node_api_entry
node_api_entry -->|"mounts"| node_routes
node_routes -->|"dispatches auth"| node_auth_controller
node_auth_controller -->|"invokes"| node_auth_service
node_auth_service -->|"reads and writes sessions"| node_db
node_staff -->|"manages records"| node_students
node_staff -->|"configures terms"| node_sessions
node_staff -->|"reviews applicants"| node_admissions
node_staff -->|"manages billing"| node_fees
node_staff -->|"views insights"| node_dashboard
node_staff -->|"records attendance and results"| node_learning_ops
node_staff -->|"assigns work"| node_classwork
node_parent -->|"views child information"| node_portal
node_staff -->|"publishes and messages"| node_communications
node_staff -->|"manages resources"| node_library

click node_app "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/app/App.tsx"
click node_authui "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/auth/AuthContext.tsx"
click node_hook "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/hooks/useAcademicSessions.ts"
click node_service "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/services/academicSessionsService.ts"
click node_client "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/lib/apiClient.ts"
click node_api_entry "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/app.ts"
click node_routes "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/routes/index.ts"
click node_auth_controller "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/controllers/auth.controller.ts"
click node_auth_service "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/services/auth.service.ts"
click node_students "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/students/student.service.ts"
click node_sessions "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/academic-sessions/academic-session.service.ts"
click node_admissions "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/admissions/admission.service.ts"
click node_fees "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/fee-invoices/fee-invoice.service.ts"
click node_dashboard "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/dashboard/dashboard.service.ts"
click node_learning_ops "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/attendance/attendance.service.ts"
click node_classwork "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/assignments/assignment.service.ts"
click node_portal "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/portal/portal.service.ts"
click node_communications "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/messages/message.service.ts"
click node_library "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/library/library.service.ts"
click node_db "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/lib/database.ts"
click node_storage "https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/lib/storage/storage.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_app,node_authui,node_hook,node_service,node_client,node_parent toneBlue
class node_api_entry,node_routes,node_auth_controller,node_auth_service toneAmber
class node_students,node_sessions,node_admissions,node_fees,node_dashboard toneMint
class node_learning_ops,node_classwork,node_portal,node_communications,node_library toneRose
class node_db,node_storage,node_staff toneIndigo
```

## Components

### Admin interface

- [React application](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Auth context](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/auth/AuthContext.tsx): `src/auth/AuthContext.tsx`
- [Data hooks](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/hooks/useAcademicSessions.ts): `src/hooks/useAcademicSessions.ts`
- [API service seam](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/services/academicSessionsService.ts): `src/services/academicSessionsService.ts`
- [HTTP client](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/src/lib/apiClient.ts): `src/lib/apiClient.ts`

### API and identity

- [Express API](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/app.ts): `server/src/app.ts`
- [API routers](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/routes/index.ts): `server/src/routes/index.ts`
- [Auth handlers](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/controllers/auth.controller.ts): `server/src/controllers/auth.controller.ts`
- [Session and RBAC](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/services/auth.service.ts): `server/src/services/auth.service.ts`

### School operations

- [Student records](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/students/student.service.ts): `server/src/modules/students/student.service.ts`
- [Academic sessions](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/academic-sessions/academic-session.service.ts): `server/src/modules/academic-sessions/academic-session.service.ts`
- [Admissions](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/admissions/admission.service.ts): `server/src/modules/admissions/admission.service.ts`
- [Fees and payments](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/fee-invoices/fee-invoice.service.ts): `server/src/modules/fee-invoices/fee-invoice.service.ts`
- [Dashboard insights](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/dashboard/dashboard.service.ts): `server/src/modules/dashboard/dashboard.service.ts`

### Learning and engagement

- [Attendance and results](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/attendance/attendance.service.ts): `server/src/modules/attendance/attendance.service.ts`
- [Classes and tasks](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/assignments/assignment.service.ts): `server/src/modules/assignments/assignment.service.ts`
- [Family portal](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/portal/portal.service.ts): `server/src/modules/portal/portal.service.ts`
- [Notices and messages](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/messages/message.service.ts): `server/src/modules/messages/message.service.ts`
- [Library and transport](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/modules/library/library.service.ts): `server/src/modules/library/library.service.ts`

### Shared platform

- [PostgreSQL data](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/lib/database.ts): `server/src/lib/database.ts`
- [Photo storage](https://github.com/mjuniorahamad-collab/school-management-system/blob/main/server/src/lib/storage/storage.ts): `server/src/lib/storage/storage.ts`

### Other components

- **School staff**
- **Family user**

## Connections

- School staff → React application: uses
- React application → Auth context: provides auth
- React application → Data hooks: renders workflows
- Data hooks → API service seam: queries and mutates
- API service seam → HTTP client: sends requests
- HTTP client → Express API: HTTP API
- Express API → API routers: mounts
- API routers → Auth handlers: dispatches auth
- Auth handlers → Session and RBAC: invokes
- Session and RBAC → PostgreSQL data: reads and writes sessions
- School staff → Student records: manages records
- School staff → Academic sessions: configures terms
- School staff → Admissions: reviews applicants
- School staff → Fees and payments: manages billing
- School staff → Dashboard insights: views insights
- School staff → Attendance and results: records attendance and results
- School staff → Classes and tasks: assigns work
- Family user → Family portal: views child information
- School staff → Notices and messages: publishes and messages
- School staff → Library and transport: manages resources
