# avzropelos14/dms-sims architecture

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

- Interactive diagram: https://gitdiagram.com/avzropelos14/dms-sims
- Repository: https://github.com/avzropelos14/dms-sims

## Overview

This is a school information system (despite the template README): users sign in, their identity and role are resolved, and the app dispatches them to a role-specific portal. The sampled code supports MFA checks, enrollment-gated student and parent access, teacher scheduling and grading, and cashier payment workflows; the component tree also shows administrative and guard portals. Supabase is the shared backend. Some portal details are inferred only from component names and the tree, so those paths are included without speculative internal data-flow links.

Main entry points: [`src/App.tsx`](https://github.com/avzropelos14/dms-sims/blob/main/src/App.tsx) (App router), [`src/supabase.tsx`](https://github.com/avzropelos14/dms-sims/blob/main/src/supabase.tsx) (Supabase client), [`src/components/TeacherDashboard.tsx`](https://github.com/avzropelos14/dms-sims/blob/main/src/components/TeacherDashboard.tsx) (Teacher dashboard), [`src/components/StudentPortal.tsx`](https://github.com/avzropelos14/dms-sims/blob/main/src/components/StudentPortal.tsx) (Student portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and access"]
  node_mount["React mount<br/>[main.tsx]"]
  node_app["App router<br/>[App.tsx]"]
  node_login["Login screen<br/>[LoginScreen.tsx]"]
  node_mfa["MFA verification"]
  node_password["Password setup"]
  node_identity["Role resolution<br/>[resolveRole.ts]"]
end

subgraph group_school["School operations"]
  node_admin["Admin dashboard<br/>[AdminDashboard.tsx]"]
  node_cashier["Cashier portal<br/>[CashierPortal.tsx]"]
  node_guard["Guard portal<br/>[GuardPortal.tsx]"]
end

subgraph group_portals["User portals"]
  node_teacher["Teacher dashboard"]
  node_student["Student portal<br/>[StudentPortal.tsx]"]
  node_parent["Parent portal<br/>[ParentPortal.tsx]"]
  node_staffprofile["Staff profile"]
  node_layout["Dashboard layout"]
end

subgraph group_services["Shared services"]
  node_supabase_client["Supabase client<br/>[supabase.tsx]"]
  node_mfa_lib["MFA service logic<br/>[mfa.ts]"]
  node_tuition["Tuition breakdown<br/>[tuition.ts]"]
  node_schoolyear["School-year lookup<br/>[schoolYear.ts]"]
  node_schedule["Schedule lookup<br/>[schedule.ts]"]
  node_subjects["Subject catalog<br/>[subjects.ts]"]
  node_rooms["Room utilities<br/>[rooms.ts]"]
  node_settings["School settings<br/>[schoolSettings.ts]"]
end

node_user(("School user"))
node_supabase_service[("Supabase")]

node_user -->|"opens"| node_mount
node_mount -->|"renders"| node_app
node_app -->|"shows"| node_login
node_login -->|"submits credentials"| node_app
node_app -->|"resolves identity"| node_identity
node_app -->|"checks trust"| node_mfa_lib
node_mfa_lib -->|"uses"| node_supabase_client
node_identity -->|"reads identity"| node_supabase_client
node_app -->|"shows verification"| node_mfa
node_app -->|"shows setup"| node_password
node_app -->|"dispatches role"| node_admin
node_app -->|"dispatches role"| node_teacher
node_app -->|"dispatches role"| node_student
node_app -->|"dispatches role"| node_parent
node_teacher -->|"renders within"| node_layout
node_cashier -->|"renders within"| node_layout
node_teacher -->|"renders profile"| node_staffprofile
node_teacher -->|"looks up year"| node_schoolyear
node_teacher -->|"reads classes and grades"| node_supabase_client
node_student -->|"looks up year"| node_schoolyear
node_student -->|"fetches assignments"| node_schedule
node_student -->|"reads schedules and grades"| node_supabase_client
node_parent -->|"reads portal data"| node_supabase_client
node_cashier -->|"looks up year"| node_schoolyear
node_cashier -->|"reads fees and records payments"| node_supabase_client
node_admin -->|"persists fee settings"| node_supabase_client
node_app -->|"reads and writes settings"| node_supabase_client
node_tuition -->|"reads payment data"| node_supabase_client
node_subjects -->|"manages subjects"| node_supabase_client
node_supabase_client -->|"queries and updates"| node_supabase_service

click node_mount "https://github.com/avzropelos14/dms-sims/blob/main/src/main.tsx"
click node_app "https://github.com/avzropelos14/dms-sims/blob/main/src/App.tsx"
click node_login "https://github.com/avzropelos14/dms-sims/blob/main/src/components/LoginScreen.tsx"
click node_mfa "https://github.com/avzropelos14/dms-sims/blob/main/src/components/MfaVerifyScreen.tsx"
click node_password "https://github.com/avzropelos14/dms-sims/blob/main/src/components/SetPasswordScreen.tsx"
click node_identity "https://github.com/avzropelos14/dms-sims/blob/main/src/lib/resolveRole.ts"
click node_admin "https://github.com/avzropelos14/dms-sims/blob/main/src/components/AdminDashboard.tsx"
click node_teacher "https://github.com/avzropelos14/dms-sims/blob/main/src/components/TeacherDashboard.tsx"
click node_student "https://github.com/avzropelos14/dms-sims/blob/main/src/components/StudentPortal.tsx"
click node_parent "https://github.com/avzropelos14/dms-sims/blob/main/src/components/ParentPortal.tsx"
click node_cashier "https://github.com/avzropelos14/dms-sims/blob/main/src/components/CashierPortal.tsx"
click node_guard "https://github.com/avzropelos14/dms-sims/blob/main/src/components/GuardPortal.tsx"
click node_staffprofile "https://github.com/avzropelos14/dms-sims/blob/main/src/components/StaffProfileView.tsx"
click node_layout "https://github.com/avzropelos14/dms-sims/blob/main/src/components/DashboardLayout.tsx"
click node_supabase_client "https://github.com/avzropelos14/dms-sims/blob/main/src/supabase.tsx"
click node_mfa_lib "https://github.com/avzropelos14/dms-sims/blob/main/src/lib/mfa.ts"
click node_tuition "https://github.com/avzropelos14/dms-sims/blob/main/src/lib/tuition.ts"
click node_schoolyear "https://github.com/avzropelos14/dms-sims/blob/main/src/lib/schoolYear.ts"
click node_schedule "https://github.com/avzropelos14/dms-sims/blob/main/src/lib/schedule.ts"
click node_subjects "https://github.com/avzropelos14/dms-sims/blob/main/src/lib/subjects.ts"
click node_rooms "https://github.com/avzropelos14/dms-sims/blob/main/src/lib/rooms.ts"
click node_settings "https://github.com/avzropelos14/dms-sims/blob/main/src/lib/schoolSettings.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_mount,node_app,node_login,node_mfa,node_password,node_identity,node_user toneBlue
class node_admin,node_cashier,node_guard,node_supabase_service toneAmber
class node_teacher,node_student,node_parent,node_staffprofile,node_layout toneMint
class node_supabase_client,node_mfa_lib,node_tuition,node_schoolyear,node_schedule,node_subjects,node_rooms,node_settings toneRose
```

## Components

### App and access

- [React mount](https://github.com/avzropelos14/dms-sims/blob/main/src/main.tsx): `src/main.tsx`
- [App router](https://github.com/avzropelos14/dms-sims/blob/main/src/App.tsx): `src/App.tsx`
- [Login screen](https://github.com/avzropelos14/dms-sims/blob/main/src/components/LoginScreen.tsx): `src/components/LoginScreen.tsx`
- [MFA verification](https://github.com/avzropelos14/dms-sims/blob/main/src/components/MfaVerifyScreen.tsx): `src/components/MfaVerifyScreen.tsx`
- [Password setup](https://github.com/avzropelos14/dms-sims/blob/main/src/components/SetPasswordScreen.tsx): `src/components/SetPasswordScreen.tsx`
- [Role resolution](https://github.com/avzropelos14/dms-sims/blob/main/src/lib/resolveRole.ts): `src/lib/resolveRole.ts`

### School operations

- [Admin dashboard](https://github.com/avzropelos14/dms-sims/blob/main/src/components/AdminDashboard.tsx): `src/components/AdminDashboard.tsx`
- [Cashier portal](https://github.com/avzropelos14/dms-sims/blob/main/src/components/CashierPortal.tsx): `src/components/CashierPortal.tsx`
- [Guard portal](https://github.com/avzropelos14/dms-sims/blob/main/src/components/GuardPortal.tsx): `src/components/GuardPortal.tsx`

### User portals

- [Teacher dashboard](https://github.com/avzropelos14/dms-sims/blob/main/src/components/TeacherDashboard.tsx): `src/components/TeacherDashboard.tsx`
- [Student portal](https://github.com/avzropelos14/dms-sims/blob/main/src/components/StudentPortal.tsx): `src/components/StudentPortal.tsx`
- [Parent portal](https://github.com/avzropelos14/dms-sims/blob/main/src/components/ParentPortal.tsx): `src/components/ParentPortal.tsx`
- [Staff profile](https://github.com/avzropelos14/dms-sims/blob/main/src/components/StaffProfileView.tsx): `src/components/StaffProfileView.tsx`
- [Dashboard layout](https://github.com/avzropelos14/dms-sims/blob/main/src/components/DashboardLayout.tsx): `src/components/DashboardLayout.tsx`

### Shared services

- [Supabase client](https://github.com/avzropelos14/dms-sims/blob/main/src/supabase.tsx): `src/supabase.tsx`
- [MFA service logic](https://github.com/avzropelos14/dms-sims/blob/main/src/lib/mfa.ts): `src/lib/mfa.ts`
- [Tuition breakdown](https://github.com/avzropelos14/dms-sims/blob/main/src/lib/tuition.ts): `src/lib/tuition.ts`
- [School-year lookup](https://github.com/avzropelos14/dms-sims/blob/main/src/lib/schoolYear.ts): `src/lib/schoolYear.ts`
- [Schedule lookup](https://github.com/avzropelos14/dms-sims/blob/main/src/lib/schedule.ts): `src/lib/schedule.ts`
- [Subject catalog](https://github.com/avzropelos14/dms-sims/blob/main/src/lib/subjects.ts): `src/lib/subjects.ts`
- [Room utilities](https://github.com/avzropelos14/dms-sims/blob/main/src/lib/rooms.ts): `src/lib/rooms.ts`
- [School settings](https://github.com/avzropelos14/dms-sims/blob/main/src/lib/schoolSettings.ts): `src/lib/schoolSettings.ts`

### Other components

- **School user**
- **Supabase**

## Connections

- School user → React mount: opens
- React mount → App router: renders
- App router → Login screen: shows
- Login screen → App router: submits credentials
- App router → Role resolution: resolves identity
- App router → MFA service logic: checks trust
- MFA service logic → Supabase client: uses
- Role resolution → Supabase client: reads identity
- App router → MFA verification: shows verification
- App router → Password setup: shows setup
- App router → Admin dashboard: dispatches role
- App router → Teacher dashboard: dispatches role
- App router → Student portal: dispatches role
- App router → Parent portal: dispatches role
- Teacher dashboard → Dashboard layout: renders within
- Cashier portal → Dashboard layout: renders within
- Teacher dashboard → Staff profile: renders profile
- Teacher dashboard → School-year lookup: looks up year
- Teacher dashboard → Supabase client: reads classes and grades
- Student portal → School-year lookup: looks up year
- Student portal → Schedule lookup: fetches assignments
- Student portal → Supabase client: reads schedules and grades
- Parent portal → Supabase client: reads portal data
- Cashier portal → School-year lookup: looks up year
- Cashier portal → Supabase client: reads fees and records payments
- Admin dashboard → Supabase client: persists fee settings
- App router → Supabase client: reads and writes settings
- Tuition breakdown → Supabase client: reads payment data
- Subject catalog → Supabase client: manages subjects
- Supabase client → Supabase: queries and updates
