# maysan-labs/school-mangment-system architecture

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

- Interactive diagram: https://gitdiagram.com/maysan-labs/school-mangment-system
- Repository: https://github.com/maysan-labs/school-mangment-system

## Overview

Edu Maysan ERP is a role-based school management platform for administrators, teachers, students, and parents. Users authenticate, enter role-oriented portals and dashboards, and access academic, attendance, finance, people, and school-service workflows. Next.js routes and client components provide the interface; server actions and service modules handle domain operations, with Supabase providing authentication and PostgreSQL persistence. The README documents the major capabilities; several are represented at subsystem level because their implementation was not sampled.

Main entry points: [`src/lib/supabase/client.ts`](https://github.com/maysan-labs/school-mangment-system/blob/main/src/lib/supabase/client.ts) (Browser client), [`src/lib/supabase/server.ts`](https://github.com/maysan-labs/school-mangment-system/blob/main/src/lib/supabase/server.ts) (SSR client), [`src/app/login/page.tsx`](https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/login/page.tsx) (Sign-in), [`src/app/actions/auth-accounts.ts`](https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/actions/auth-accounts.ts) (Account actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and portals"]
  node_login["Sign-in<br/>[page.tsx]"]
  node_auth_actions["Account actions<br/>[auth-accounts.ts]"]
  node_portal["Role portal<br/>[page.tsx]"]
  node_user_service["User services<br/>[user.ts]"]
  node_user_admin["User registry"]
  node_user_admin_actions["Access actions<br/>[actions.ts]"]
end

subgraph group_academics["Academic operations"]
  node_academic_routes["Academic management"]
  node_gradebook["Gradebook"]
  node_certificates["Certificates"]
  node_certificate_actions["Certificate actions<br/>[certificates.ts]"]
end

subgraph group_operations["School operations"]
  node_attendance["Attendance tracking"]
  node_student_records["Student records<br/>[StudentList.tsx]"]
  node_inventory["Inventory"]
  node_inventory_actions["Inventory actions<br/>[inventory.ts]"]
end

subgraph group_finance["Finance and analytics"]
  node_finance_routes["Fees and payroll"]
  node_gateway_actions["Gateway actions<br/>[gateways.ts]"]
  node_analytics["Institutional analytics"]
end

subgraph group_platform["Data and platform"]
  node_settings["School settings"]
  node_settings_actions["Settings actions<br/>[settings.ts]"]
  node_supabase[("Supabase database")]
  node_browser_client["Browser client<br/>[client.ts]"]
  node_server_client["SSR client<br/>[server.ts]"]
  node_demo_protection["Demo protection<br/>[demo-protection.ts]"]
  node_domain_types["Domain records<br/>[database.ts]"]
end

node_users(("School users"))

node_users -->|"sign in"| node_login
node_login -->|"calls"| node_auth_actions
node_auth_actions -->|"admin access"| node_supabase
node_users -->|"enter portal"| node_portal
node_portal -->|"uses"| node_user_service
node_users -->|"manage accounts"| node_user_admin
node_user_admin -->|"toggles status"| node_user_admin_actions
node_user_admin_actions -->|"admin access"| node_supabase
node_users -->|"manage academics"| node_academic_routes
node_users -->|"review grades"| node_gradebook
node_users -->|"issue certificates"| node_certificates
node_certificates -->|"issues or revokes"| node_certificate_actions
node_users -->|"track attendance"| node_attendance
node_users -->|"manage students"| node_student_records
node_users -->|"manage resources"| node_inventory
node_inventory -->|"creates or updates"| node_inventory_actions
node_users -->|"manage finances"| node_finance_routes
node_users -->|"review metrics"| node_analytics
node_settings -->|"saves settings"| node_settings_actions
node_browser_client -->|"wraps client"| node_demo_protection
node_server_client -->|"wraps client"| node_demo_protection
node_browser_client -->|"connects to"| node_supabase
node_server_client -->|"connects to"| node_supabase
node_finance_routes -.->|"gateway operations"| node_gateway_actions

click node_login "https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/login/page.tsx"
click node_auth_actions "https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/actions/auth-accounts.ts"
click node_portal "https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/portal/page.tsx"
click node_user_service "https://github.com/maysan-labs/school-mangment-system/blob/main/src/lib/services/user.ts"
click node_user_admin "https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/users/UsersDashboardClient.tsx"
click node_user_admin_actions "https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/(dashboard)/users/actions.ts"
click node_academic_routes "https://github.com/maysan-labs/school-mangment-system/tree/main/src/app/(dashboard)/academics"
click node_gradebook "https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/(dashboard)/academics/gradebook/GradebookClient.tsx"
click node_certificates "https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/academics/certificates/CertificatesDashboardClient.tsx"
click node_certificate_actions "https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/actions/certificates.ts"
click node_attendance "https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/attendance/AttendanceDashboard.tsx"
click node_student_records "https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/students/StudentList.tsx"
click node_inventory "https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/services/inventory/InventoryDashboardClient.tsx"
click node_inventory_actions "https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/actions/inventory.ts"
click node_finance_routes "https://github.com/maysan-labs/school-mangment-system/tree/main/src/app/(dashboard)/finance"
click node_gateway_actions "https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/actions/gateways.ts"
click node_analytics "https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/dashboard/AnalyticsDashboard.tsx"
click node_settings "https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/settings/SettingsDashboardClient.tsx"
click node_settings_actions "https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/actions/settings.ts"
click node_browser_client "https://github.com/maysan-labs/school-mangment-system/blob/main/src/lib/supabase/client.ts"
click node_server_client "https://github.com/maysan-labs/school-mangment-system/blob/main/src/lib/supabase/server.ts"
click node_demo_protection "https://github.com/maysan-labs/school-mangment-system/blob/main/src/lib/supabase/demo-protection.ts"
click node_domain_types "https://github.com/maysan-labs/school-mangment-system/blob/main/src/types/database.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_login,node_auth_actions,node_portal,node_user_service,node_user_admin,node_user_admin_actions,node_users toneBlue
class node_academic_routes,node_gradebook,node_certificates,node_certificate_actions toneAmber
class node_attendance,node_student_records,node_inventory,node_inventory_actions toneMint
class node_finance_routes,node_gateway_actions,node_analytics toneRose
class node_settings,node_settings_actions,node_supabase,node_browser_client,node_server_client,node_demo_protection,node_domain_types toneIndigo
```

## Components

### Access and portals

- [Sign-in](https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Account actions](https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/actions/auth-accounts.ts): `src/app/actions/auth-accounts.ts`
- [Role portal](https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/portal/page.tsx): `src/app/portal/page.tsx`
- [User services](https://github.com/maysan-labs/school-mangment-system/blob/main/src/lib/services/user.ts): `src/lib/services/user.ts`
- [User registry](https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/users/UsersDashboardClient.tsx): `src/components/users/UsersDashboardClient.tsx`
- [Access actions](https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/(dashboard)/users/actions.ts): `src/app/(dashboard)/users/actions.ts`

### Academic operations

- [Academic management](https://github.com/maysan-labs/school-mangment-system/tree/main/src/app/(dashboard)/academics): `src/app/(dashboard)/academics`
- [Gradebook](https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/(dashboard)/academics/gradebook/GradebookClient.tsx): `src/app/(dashboard)/academics/gradebook/GradebookClient.tsx`
- [Certificates](https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/academics/certificates/CertificatesDashboardClient.tsx): `src/components/academics/certificates/CertificatesDashboardClient.tsx`
- [Certificate actions](https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/actions/certificates.ts): `src/app/actions/certificates.ts`

### School operations

- [Attendance tracking](https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/attendance/AttendanceDashboard.tsx): `src/components/attendance/AttendanceDashboard.tsx`
- [Student records](https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/students/StudentList.tsx): `src/components/students/StudentList.tsx`
- [Inventory](https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/services/inventory/InventoryDashboardClient.tsx): `src/components/services/inventory/InventoryDashboardClient.tsx`
- [Inventory actions](https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/actions/inventory.ts): `src/app/actions/inventory.ts`

### Finance and analytics

- [Fees and payroll](https://github.com/maysan-labs/school-mangment-system/tree/main/src/app/(dashboard)/finance): `src/app/(dashboard)/finance`
- [Gateway actions](https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/actions/gateways.ts): `src/app/actions/gateways.ts`
- [Institutional analytics](https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/dashboard/AnalyticsDashboard.tsx): `src/components/dashboard/AnalyticsDashboard.tsx`

### Data and platform

- [School settings](https://github.com/maysan-labs/school-mangment-system/blob/main/src/components/settings/SettingsDashboardClient.tsx): `src/components/settings/SettingsDashboardClient.tsx`
- [Settings actions](https://github.com/maysan-labs/school-mangment-system/blob/main/src/app/actions/settings.ts): `src/app/actions/settings.ts`
- **Supabase database**
- [Browser client](https://github.com/maysan-labs/school-mangment-system/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [SSR client](https://github.com/maysan-labs/school-mangment-system/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- [Demo protection](https://github.com/maysan-labs/school-mangment-system/blob/main/src/lib/supabase/demo-protection.ts): `src/lib/supabase/demo-protection.ts`
- [Domain records](https://github.com/maysan-labs/school-mangment-system/blob/main/src/types/database.ts): `src/types/database.ts`

### Other components

- **School users**

## Connections

- School users → Sign-in: sign in (evidence: `README.md`)
- Sign-in → Account actions: calls (evidence: `src/app/login/page.tsx`)
- Account actions → Supabase database: admin access (evidence: `src/app/actions/auth-accounts.ts`)
- School users → Role portal: enter portal (evidence: `README.md`)
- Role portal → User services: uses (evidence: `src/app/portal/page.tsx`)
- School users → User registry: manage accounts (evidence: `README.md`)
- User registry → Access actions: toggles status (evidence: `src/components/users/UsersDashboardClient.tsx`)
- Access actions → Supabase database: admin access (evidence: `src/app/(dashboard)/users/actions.ts`)
- School users → Academic management: manage academics (evidence: `README.md`)
- School users → Gradebook: review grades (evidence: `README.md`)
- School users → Certificates: issue certificates (evidence: `README.md`)
- Certificates → Certificate actions: issues or revokes (evidence: `src/components/academics/certificates/CertificatesDashboardClient.tsx`)
- School users → Attendance tracking: track attendance (evidence: `README.md`)
- School users → Student records: manage students (evidence: `README.md`)
- School users → Inventory: manage resources (evidence: `README.md`)
- Inventory → Inventory actions: creates or updates (evidence: `src/components/services/inventory/InventoryDashboardClient.tsx`)
- School users → Fees and payroll: manage finances (evidence: `README.md`)
- School users → Institutional analytics: review metrics (evidence: `README.md`)
- School settings → Settings actions: saves settings (evidence: `src/components/settings/SettingsDashboardClient.tsx`)
- Browser client → Demo protection: wraps client (evidence: `src/lib/supabase/client.ts`)
- SSR client → Demo protection: wraps client (evidence: `src/lib/supabase/server.ts`)
- Browser client → Supabase database: connects to (evidence: `README.md`)
- SSR client → Supabase database: connects to (evidence: `README.md`)
- Fees and payroll → Gateway actions: gateway operations
