# haza-aios/haza-sms architecture

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

- Interactive diagram: https://gitdiagram.com/haza-aios/haza-sms
- Repository: https://github.com/haza-aios/haza-sms

## Overview

HAZA-SMS is a multi-tenant school management system. The documented journey runs from school registration and campus/academic setup through admissions, daily operations, fees and examinations to leadership reports. The graph preserves those stages and major public, workforce, finance and governance capabilities. Source excerpts show the application entry point and shared authorization/security behavior; most feature panels and API implementations were not sampled, so their UI-to-API connections are omitted rather than inferred.

Main entry points: [`app/DashboardShell.tsx`](https://github.com/haza-aios/haza-sms/blob/main/app/DashboardShell.tsx) (School workspace), [`app/ui/TailwindPrimitives.tsx`](https://github.com/haza-aios/haza-sms/blob/main/app/ui/TailwindPrimitives.tsx) (Shared interface primitives), [`lib/authorization.ts`](https://github.com/haza-aios/haza-sms/blob/main/lib/authorization.ts) (Tenant authorization), [`app/RegistrationForm.tsx`](https://github.com/haza-aios/haza-sms/blob/main/app/RegistrationForm.tsx) (School registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and tenancy"]
  node_registration["School registration"]
  node_identity_service["Sign-in identity<br/>[chatgpt-auth.ts]"]
end

subgraph group_school["School operations"]
  node_dashboard["School workspace<br/>[DashboardShell.tsx]"]
  node_configuration["School configuration"]
  node_academics["Academic structure<br/>[AcademicsPanel.tsx]"]
  node_staff["Staff directory"]
  node_teachers["Teacher assignments<br/>[TeachersPanel.tsx]"]
  node_admissions["Admissions and enrollment"]
  node_students["Student records"]
  node_attendance["Attendance"]
  node_timetable["Timetables<br/>[TimetablePanel.tsx]"]
  node_fees["Fees and receipts<br/>[FeesPanel.tsx]"]
  node_payroll["Payroll<br/>[PayrollPanel.tsx]"]
  node_examinations["Examinations"]
  node_promotion["Student promotion<br/>[PromotionPanel.tsx]"]
  node_ui_primitives["Shared interface primitives"]
end

subgraph group_public["Public and insight"]
  node_reports["Reports and analytics<br/>[AnalyticsPanel.tsx]"]
  node_public_site["Public school experience"]
  node_public_content["Public content management"]
  node_communications["Communications"]
end

subgraph group_governance["Governance and platform"]
  node_authorization["Tenant authorization<br/>[authorization.ts]"]
  node_subscriptions["School subscriptions<br/>[subscriptions.ts]"]
  node_security["Security and audit<br/>[SecurityPanel.tsx]"]
  node_access_control["Roles and access"]
  node_rate_security["Request security<br/>[security.ts]"]
  node_database[("School data<br/>[schema.ts]")]
end

node_school_admin(("School administrator"))

node_school_admin -->|"registers"| node_registration
node_registration -.->|"creates workspace"| node_school_admin
node_school_admin -->|"uses workspace"| node_dashboard
node_dashboard -->|"checks identity"| node_identity_service
node_dashboard -->|"loads access"| node_authorization
node_registration -->|"selects plan"| node_subscriptions
node_dashboard -->|"opens"| node_configuration
node_configuration -.->|"sets structure"| node_academics
node_academics -.->|"prepares teaching"| node_staff
node_staff -.->|"assigns teachers"| node_teachers
node_dashboard -->|"opens"| node_admissions
node_admissions -.->|"converts approved applications"| node_students
node_dashboard -->|"opens"| node_attendance
node_dashboard -->|"opens"| node_timetable
node_dashboard -->|"opens"| node_fees
node_dashboard -->|"opens"| node_payroll
node_dashboard -->|"opens"| node_examinations
node_examinations -.->|"supports progression"| node_promotion
node_dashboard -.->|"reviews"| node_reports
node_school_admin -.->|"visits"| node_public_site
node_dashboard -->|"manages"| node_public_content
node_dashboard -.->|"manages"| node_communications
node_dashboard -->|"opens"| node_security
node_dashboard -->|"opens"| node_access_control
node_access_control -.->|"enforces permissions"| node_authorization
node_authorization -->|"resolves user"| node_identity_service
node_authorization -->|"reads memberships"| node_database
node_rate_security -->|"uses authorization context"| node_authorization
node_fees -.->|"uses controls"| node_ui_primitives
node_academics -->|"uses controls"| node_ui_primitives
node_admissions -->|"uses controls"| node_ui_primitives
node_configuration -->|"uses controls"| node_ui_primitives
node_payroll -->|"uses controls"| node_ui_primitives
node_public_content -->|"uses controls"| node_ui_primitives

click node_registration "https://github.com/haza-aios/haza-sms/blob/main/app/RegistrationForm.tsx"
click node_identity_service "https://github.com/haza-aios/haza-sms/blob/main/app/chatgpt-auth.ts"
click node_authorization "https://github.com/haza-aios/haza-sms/blob/main/lib/authorization.ts"
click node_subscriptions "https://github.com/haza-aios/haza-sms/blob/main/lib/subscriptions.ts"
click node_dashboard "https://github.com/haza-aios/haza-sms/blob/main/app/DashboardShell.tsx"
click node_configuration "https://github.com/haza-aios/haza-sms/blob/main/app/ConfigurationPanel.tsx"
click node_academics "https://github.com/haza-aios/haza-sms/blob/main/app/AcademicsPanel.tsx"
click node_staff "https://github.com/haza-aios/haza-sms/blob/main/app/StaffDirectoryPanel.tsx"
click node_teachers "https://github.com/haza-aios/haza-sms/blob/main/app/TeachersPanel.tsx"
click node_admissions "https://github.com/haza-aios/haza-sms/blob/main/app/AdmissionsPanel.tsx"
click node_students "https://github.com/haza-aios/haza-sms/blob/main/app/StudentDirectoryPanel.tsx"
click node_attendance "https://github.com/haza-aios/haza-sms/blob/main/app/StaffAttendancePanel.tsx"
click node_timetable "https://github.com/haza-aios/haza-sms/blob/main/app/TimetablePanel.tsx"
click node_fees "https://github.com/haza-aios/haza-sms/blob/main/app/FeesPanel.tsx"
click node_payroll "https://github.com/haza-aios/haza-sms/blob/main/app/PayrollPanel.tsx"
click node_examinations "https://github.com/haza-aios/haza-sms/blob/main/app/ExaminationSchedulePanel.tsx"
click node_promotion "https://github.com/haza-aios/haza-sms/blob/main/app/PromotionPanel.tsx"
click node_reports "https://github.com/haza-aios/haza-sms/blob/main/app/AnalyticsPanel.tsx"
click node_public_site "https://github.com/haza-aios/haza-sms/blob/main/app/PublicLandingPage.tsx"
click node_public_content "https://github.com/haza-aios/haza-sms/blob/main/app/PublicContentPanel.tsx"
click node_communications "https://github.com/haza-aios/haza-sms/blob/main/app/CommunicationsPanel.tsx"
click node_security "https://github.com/haza-aios/haza-sms/blob/main/app/SecurityPanel.tsx"
click node_access_control "https://github.com/haza-aios/haza-sms/blob/main/app/AccessControlPanel.tsx"
click node_rate_security "https://github.com/haza-aios/haza-sms/blob/main/lib/security.ts"
click node_database "https://github.com/haza-aios/haza-sms/blob/main/db/schema.ts"
click node_ui_primitives "https://github.com/haza-aios/haza-sms/blob/main/app/ui/TailwindPrimitives.tsx"

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_registration,node_identity_service toneBlue
class node_dashboard,node_configuration,node_academics,node_staff,node_teachers,node_admissions,node_students,node_attendance,node_timetable,node_fees,node_payroll,node_examinations,node_promotion,node_ui_primitives toneAmber
class node_reports,node_public_site,node_public_content,node_communications toneMint
class node_authorization,node_subscriptions,node_security,node_access_control,node_rate_security,node_database toneRose
class node_school_admin toneIndigo
```

## Components

### Identity and tenancy

- [School registration](https://github.com/haza-aios/haza-sms/blob/main/app/RegistrationForm.tsx): `app/RegistrationForm.tsx`
- [Sign-in identity](https://github.com/haza-aios/haza-sms/blob/main/app/chatgpt-auth.ts): `app/chatgpt-auth.ts`

### School operations

- [School workspace](https://github.com/haza-aios/haza-sms/blob/main/app/DashboardShell.tsx): `app/DashboardShell.tsx`
- [School configuration](https://github.com/haza-aios/haza-sms/blob/main/app/ConfigurationPanel.tsx): `app/ConfigurationPanel.tsx`
- [Academic structure](https://github.com/haza-aios/haza-sms/blob/main/app/AcademicsPanel.tsx): `app/AcademicsPanel.tsx`
- [Staff directory](https://github.com/haza-aios/haza-sms/blob/main/app/StaffDirectoryPanel.tsx): `app/StaffDirectoryPanel.tsx`
- [Teacher assignments](https://github.com/haza-aios/haza-sms/blob/main/app/TeachersPanel.tsx): `app/TeachersPanel.tsx`
- [Admissions and enrollment](https://github.com/haza-aios/haza-sms/blob/main/app/AdmissionsPanel.tsx): `app/AdmissionsPanel.tsx`
- [Student records](https://github.com/haza-aios/haza-sms/blob/main/app/StudentDirectoryPanel.tsx): `app/StudentDirectoryPanel.tsx`
- [Attendance](https://github.com/haza-aios/haza-sms/blob/main/app/StaffAttendancePanel.tsx): `app/StaffAttendancePanel.tsx`
- [Timetables](https://github.com/haza-aios/haza-sms/blob/main/app/TimetablePanel.tsx): `app/TimetablePanel.tsx`
- [Fees and receipts](https://github.com/haza-aios/haza-sms/blob/main/app/FeesPanel.tsx): `app/FeesPanel.tsx`
- [Payroll](https://github.com/haza-aios/haza-sms/blob/main/app/PayrollPanel.tsx): `app/PayrollPanel.tsx`
- [Examinations](https://github.com/haza-aios/haza-sms/blob/main/app/ExaminationSchedulePanel.tsx): `app/ExaminationSchedulePanel.tsx`
- [Student promotion](https://github.com/haza-aios/haza-sms/blob/main/app/PromotionPanel.tsx): `app/PromotionPanel.tsx`
- [Shared interface primitives](https://github.com/haza-aios/haza-sms/blob/main/app/ui/TailwindPrimitives.tsx): `app/ui/TailwindPrimitives.tsx`

### Public and insight

- [Reports and analytics](https://github.com/haza-aios/haza-sms/blob/main/app/AnalyticsPanel.tsx): `app/AnalyticsPanel.tsx`
- [Public school experience](https://github.com/haza-aios/haza-sms/blob/main/app/PublicLandingPage.tsx): `app/PublicLandingPage.tsx`
- [Public content management](https://github.com/haza-aios/haza-sms/blob/main/app/PublicContentPanel.tsx): `app/PublicContentPanel.tsx`
- [Communications](https://github.com/haza-aios/haza-sms/blob/main/app/CommunicationsPanel.tsx): `app/CommunicationsPanel.tsx`

### Governance and platform

- [Tenant authorization](https://github.com/haza-aios/haza-sms/blob/main/lib/authorization.ts): `lib/authorization.ts`
- [School subscriptions](https://github.com/haza-aios/haza-sms/blob/main/lib/subscriptions.ts): `lib/subscriptions.ts`
- [Security and audit](https://github.com/haza-aios/haza-sms/blob/main/app/SecurityPanel.tsx): `app/SecurityPanel.tsx`
- [Roles and access](https://github.com/haza-aios/haza-sms/blob/main/app/AccessControlPanel.tsx): `app/AccessControlPanel.tsx`
- [Request security](https://github.com/haza-aios/haza-sms/blob/main/lib/security.ts): `lib/security.ts`
- [School data](https://github.com/haza-aios/haza-sms/blob/main/db/schema.ts): `db/schema.ts`

### Other components

- **School administrator**

## Connections

- School administrator → School registration: registers
- School registration → School administrator: creates workspace
- School administrator → School workspace: uses workspace (evidence: `README.md`)
- School workspace → Sign-in identity: checks identity (evidence: `app/page.tsx`)
- School workspace → Tenant authorization: loads access (evidence: `app/page.tsx`)
- School registration → School subscriptions: selects plan (evidence: `app/register/page.tsx`)
- School workspace → School configuration: opens (evidence: `app/DashboardShell.tsx`)
- School configuration → Academic structure: sets structure
- Academic structure → Staff directory: prepares teaching
- Staff directory → Teacher assignments: assigns teachers
- School workspace → Admissions and enrollment: opens (evidence: `app/DashboardShell.tsx`)
- Admissions and enrollment → Student records: converts approved applications
- School workspace → Attendance: opens (evidence: `app/DashboardShell.tsx`)
- School workspace → Timetables: opens (evidence: `app/DashboardShell.tsx`)
- School workspace → Fees and receipts: opens (evidence: `app/DashboardShell.tsx`)
- School workspace → Payroll: opens (evidence: `app/DashboardShell.tsx`)
- School workspace → Examinations: opens (evidence: `app/DashboardShell.tsx`)
- Examinations → Student promotion: supports progression
- School workspace → Reports and analytics: reviews (evidence: `app/DashboardShell.tsx`)
- School administrator → Public school experience: visits
- School workspace → Public content management: manages (evidence: `app/DashboardShell.tsx`)
- School workspace → Communications: manages (evidence: `app/DashboardShell.tsx`)
- School workspace → Security and audit: opens (evidence: `app/DashboardShell.tsx`)
- School workspace → Roles and access: opens (evidence: `app/DashboardShell.tsx`)
- Roles and access → Tenant authorization: enforces permissions
- Tenant authorization → Sign-in identity: resolves user (evidence: `lib/authorization.ts`)
- Tenant authorization → School data: reads memberships (evidence: `lib/authorization.ts`)
- Request security → Tenant authorization: uses authorization context (evidence: `lib/security.ts`)
- Fees and receipts → Shared interface primitives: uses controls
- Academic structure → Shared interface primitives: uses controls (evidence: `app/AcademicsPanel.tsx`)
- Admissions and enrollment → Shared interface primitives: uses controls (evidence: `app/AdmissionsPanel.tsx`)
- School configuration → Shared interface primitives: uses controls (evidence: `app/ConfigurationPanel.tsx`)
- Payroll → Shared interface primitives: uses controls (evidence: `app/PayrollPanel.tsx`)
- Public content management → Shared interface primitives: uses controls (evidence: `app/PublicContentPanel.tsx`)
