# joelleonardt/sdnciater3 architecture

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

- Interactive diagram: https://gitdiagram.com/joelleonardt/sdnciater3
- Repository: https://github.com/joelleonardt/sdnciater3

## Overview

This is a school administration web app: users sign in, enter a role-protected workspace, and manage school records such as classes, students, attendance, schedules, grades, users, and settings; reports provide a cross-domain output. Routes and shared shell mediate access, feature hooks connect UI workflows to services, and Supabase is the backend boundary. The graph preserves the documented-by-source-index feature areas and central stores; several feature pages and services were not excerpted, so their internal calls are shown only where the index supports them.

Main entry points: [`src/app/routes.tsx`](https://github.com/joelleonardt/sdnciater3/blob/main/src/app/routes.tsx) (Role-based routes), [`src/features`](https://github.com/joelleonardt/sdnciater3/tree/main/src/features) (Feature data hooks), [`src/services/reportService.ts`](https://github.com/joelleonardt/sdnciater3/blob/main/src/services/reportService.ts) (Report generation), [`src/services/authService.ts`](https://github.com/joelleonardt/sdnciater3/blob/main/src/services/authService.ts) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry and access"]
  node_root["App root<br/>[App.tsx]"]
  node_routes["Role-based routes<br/>[routes.tsx]"]
  node_shell["Workspace shell<br/>[AppShell.tsx]"]
  node_login["Sign-in<br/>[LoginPage.tsx]"]
end

subgraph group_school["School workflows"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_classes["Class management<br/>[ClassesPage.tsx]"]
  node_students["Student records<br/>[StudentsPage.tsx]"]
  node_attendance["Attendance<br/>[AttendancePage.tsx]"]
  node_schedules["Schedules<br/>[SchedulePage.tsx]"]
  node_grades["Grades<br/>[GradesPage.tsx]"]
  node_notes["Student notes<br/>[useNotes.ts]"]
end

subgraph group_operations["Administration and reporting"]
  node_users["User administration<br/>[UsersPage.tsx]"]
  node_settings["School settings<br/>[SettingsPage.tsx]"]
  node_reports["Reports<br/>[ReportsPage.tsx]"]
  node_reportservice["Report generation<br/>[reportService.ts]"]
end

subgraph group_runtime["Shared runtime"]
  node_auth["Authentication<br/>[authService.ts]"]
  node_authstate["Session state<br/>[authStore.ts]"]
  node_featurehooks["Feature data hooks"]
  node_services["Domain services"]
  node_appstate["School context state<br/>[appStore.ts]"]
  node_uistate["UI state<br/>[uiStore.ts]"]
  node_toast["Toast notifications<br/>[useToast.ts]"]
  node_schema["Database types<br/>[database.types.ts]"]
  node_supabase["Supabase client<br/>[supabase.ts]"]
end

node_user(("School staff"))
node_backend[("Supabase backend")]

node_user -->|"opens app"| node_root
node_root -->|"renders router"| node_routes
node_routes -->|"routes sign-in"| node_login
node_routes -->|"wraps protected pages"| node_shell
node_routes -->|"routes dashboard"| node_dashboard
node_routes -->|"routes classes"| node_classes
node_routes -->|"routes students"| node_students
node_routes -->|"routes attendance"| node_attendance
node_routes -->|"routes schedules"| node_schedules
node_routes -->|"routes grades"| node_grades
node_routes -->|"routes reports"| node_reports
node_routes -->|"routes users"| node_users
node_shell -->|"signs out"| node_auth
node_shell -->|"reads session"| node_authstate
node_authstate -->|"loads profile"| node_auth
node_login -.->|"submits credentials"| node_auth
node_featurehooks -.->|"calls domain operations"| node_services
node_attendance -->|"uses attendance hook"| node_featurehooks
node_classes -->|"uses class hook"| node_featurehooks
node_students -->|"uses student hook"| node_featurehooks
node_schedules -->|"uses schedule hook"| node_featurehooks
node_grades -->|"uses grade hook"| node_featurehooks
node_users -->|"uses user hook"| node_featurehooks
node_settings -->|"uses settings hook"| node_featurehooks
node_featurehooks -->|"shows feedback"| node_toast
node_toast -->|"pushes toast"| node_uistate
node_featurehooks -->|"updates school context"| node_appstate
node_reports -.->|"requests reports"| node_reportservice
node_reportservice -->|"queries backend"| node_supabase
node_reportservice -->|"reads attendance data"| node_attendance
node_reportservice -->|"reads student data"| node_students
node_services -.->|"uses client"| node_supabase
node_auth -->|"auth operations"| node_supabase
node_supabase -->|"queries and updates"| node_backend
node_services -.->|"uses database types"| node_schema

click node_root "https://github.com/joelleonardt/sdnciater3/blob/main/src/app/App.tsx"
click node_routes "https://github.com/joelleonardt/sdnciater3/blob/main/src/app/routes.tsx"
click node_shell "https://github.com/joelleonardt/sdnciater3/blob/main/src/components/ui/AppShell.tsx"
click node_login "https://github.com/joelleonardt/sdnciater3/blob/main/src/features/auth/LoginPage.tsx"
click node_auth "https://github.com/joelleonardt/sdnciater3/blob/main/src/services/authService.ts"
click node_authstate "https://github.com/joelleonardt/sdnciater3/blob/main/src/stores/authStore.ts"
click node_dashboard "https://github.com/joelleonardt/sdnciater3/blob/main/src/features/dashboard/DashboardPage.tsx"
click node_classes "https://github.com/joelleonardt/sdnciater3/blob/main/src/features/classes/ClassesPage.tsx"
click node_students "https://github.com/joelleonardt/sdnciater3/blob/main/src/features/students/StudentsPage.tsx"
click node_attendance "https://github.com/joelleonardt/sdnciater3/blob/main/src/features/attendance/AttendancePage.tsx"
click node_schedules "https://github.com/joelleonardt/sdnciater3/blob/main/src/features/schedules/SchedulePage.tsx"
click node_grades "https://github.com/joelleonardt/sdnciater3/blob/main/src/features/grades/GradesPage.tsx"
click node_notes "https://github.com/joelleonardt/sdnciater3/blob/main/src/features/notes/useNotes.ts"
click node_users "https://github.com/joelleonardt/sdnciater3/blob/main/src/features/users/UsersPage.tsx"
click node_settings "https://github.com/joelleonardt/sdnciater3/blob/main/src/features/settings/SettingsPage.tsx"
click node_reports "https://github.com/joelleonardt/sdnciater3/blob/main/src/features/reports/ReportsPage.tsx"
click node_reportservice "https://github.com/joelleonardt/sdnciater3/blob/main/src/services/reportService.ts"
click node_featurehooks "https://github.com/joelleonardt/sdnciater3/tree/main/src/features"
click node_services "https://github.com/joelleonardt/sdnciater3/tree/main/src/services"
click node_appstate "https://github.com/joelleonardt/sdnciater3/blob/main/src/stores/appStore.ts"
click node_uistate "https://github.com/joelleonardt/sdnciater3/blob/main/src/stores/uiStore.ts"
click node_toast "https://github.com/joelleonardt/sdnciater3/blob/main/src/components/ui/Toast/useToast.ts"
click node_schema "https://github.com/joelleonardt/sdnciater3/blob/main/src/types/database.types.ts"
click node_supabase "https://github.com/joelleonardt/sdnciater3/blob/main/src/services/supabase.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_root,node_routes,node_shell,node_login toneBlue
class node_dashboard,node_classes,node_students,node_attendance,node_schedules,node_grades,node_notes,node_backend toneAmber
class node_users,node_settings,node_reports,node_reportservice toneMint
class node_auth,node_authstate,node_featurehooks,node_services,node_appstate,node_uistate,node_toast,node_schema,node_supabase toneRose
class node_user toneIndigo
```

## Components

### App entry and access

- [App root](https://github.com/joelleonardt/sdnciater3/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Role-based routes](https://github.com/joelleonardt/sdnciater3/blob/main/src/app/routes.tsx): `src/app/routes.tsx`
- [Workspace shell](https://github.com/joelleonardt/sdnciater3/blob/main/src/components/ui/AppShell.tsx): `src/components/ui/AppShell.tsx`
- [Sign-in](https://github.com/joelleonardt/sdnciater3/blob/main/src/features/auth/LoginPage.tsx): `src/features/auth/LoginPage.tsx`

### School workflows

- [Dashboard](https://github.com/joelleonardt/sdnciater3/blob/main/src/features/dashboard/DashboardPage.tsx): `src/features/dashboard/DashboardPage.tsx`
- [Class management](https://github.com/joelleonardt/sdnciater3/blob/main/src/features/classes/ClassesPage.tsx): `src/features/classes/ClassesPage.tsx`
- [Student records](https://github.com/joelleonardt/sdnciater3/blob/main/src/features/students/StudentsPage.tsx): `src/features/students/StudentsPage.tsx`
- [Attendance](https://github.com/joelleonardt/sdnciater3/blob/main/src/features/attendance/AttendancePage.tsx): `src/features/attendance/AttendancePage.tsx`
- [Schedules](https://github.com/joelleonardt/sdnciater3/blob/main/src/features/schedules/SchedulePage.tsx): `src/features/schedules/SchedulePage.tsx`
- [Grades](https://github.com/joelleonardt/sdnciater3/blob/main/src/features/grades/GradesPage.tsx): `src/features/grades/GradesPage.tsx`
- [Student notes](https://github.com/joelleonardt/sdnciater3/blob/main/src/features/notes/useNotes.ts): `src/features/notes/useNotes.ts`

### Administration and reporting

- [User administration](https://github.com/joelleonardt/sdnciater3/blob/main/src/features/users/UsersPage.tsx): `src/features/users/UsersPage.tsx`
- [School settings](https://github.com/joelleonardt/sdnciater3/blob/main/src/features/settings/SettingsPage.tsx): `src/features/settings/SettingsPage.tsx`
- [Reports](https://github.com/joelleonardt/sdnciater3/blob/main/src/features/reports/ReportsPage.tsx): `src/features/reports/ReportsPage.tsx`
- [Report generation](https://github.com/joelleonardt/sdnciater3/blob/main/src/services/reportService.ts): `src/services/reportService.ts`

### Shared runtime

- [Authentication](https://github.com/joelleonardt/sdnciater3/blob/main/src/services/authService.ts): `src/services/authService.ts`
- [Session state](https://github.com/joelleonardt/sdnciater3/blob/main/src/stores/authStore.ts): `src/stores/authStore.ts`
- [Feature data hooks](https://github.com/joelleonardt/sdnciater3/tree/main/src/features): `src/features`
- [Domain services](https://github.com/joelleonardt/sdnciater3/tree/main/src/services): `src/services`
- [School context state](https://github.com/joelleonardt/sdnciater3/blob/main/src/stores/appStore.ts): `src/stores/appStore.ts`
- [UI state](https://github.com/joelleonardt/sdnciater3/blob/main/src/stores/uiStore.ts): `src/stores/uiStore.ts`
- [Toast notifications](https://github.com/joelleonardt/sdnciater3/blob/main/src/components/ui/Toast/useToast.ts): `src/components/ui/Toast/useToast.ts`
- [Database types](https://github.com/joelleonardt/sdnciater3/blob/main/src/types/database.types.ts): `src/types/database.types.ts`
- [Supabase client](https://github.com/joelleonardt/sdnciater3/blob/main/src/services/supabase.ts): `src/services/supabase.ts`

### Other components

- **School staff**
- **Supabase backend**

## Connections

- School staff → App root: opens app
- App root → Role-based routes: renders router (evidence: `src/app/App.tsx`)
- Role-based routes → Sign-in: routes sign-in (evidence: `src/app/routes.tsx`)
- Role-based routes → Workspace shell: wraps protected pages (evidence: `src/app/routes.tsx`)
- Role-based routes → Dashboard: routes dashboard (evidence: `src/app/routes.tsx`)
- Role-based routes → Class management: routes classes (evidence: `src/app/routes.tsx`)
- Role-based routes → Student records: routes students (evidence: `src/app/routes.tsx`)
- Role-based routes → Attendance: routes attendance (evidence: `src/app/routes.tsx`)
- Role-based routes → Schedules: routes schedules (evidence: `src/app/routes.tsx`)
- Role-based routes → Grades: routes grades (evidence: `src/app/routes.tsx`)
- Role-based routes → Reports: routes reports (evidence: `src/app/routes.tsx`)
- Role-based routes → User administration: routes users (evidence: `src/app/routes.tsx`)
- Workspace shell → Authentication: signs out (evidence: `src/components/ui/AppShell.tsx`)
- Workspace shell → Session state: reads session (evidence: `src/components/ui/AppShell.tsx`)
- Session state → Authentication: loads profile (evidence: `src/stores/authStore.ts`)
- Sign-in → Authentication: submits credentials
- Feature data hooks → Domain services: calls domain operations (evidence: `src/features/settings/useSettings.ts`)
- Attendance → Feature data hooks: uses attendance hook (evidence: `src/features/attendance/AttendancePage.tsx`)
- Class management → Feature data hooks: uses class hook (evidence: `src/features/classes/useClasses.ts`)
- Student records → Feature data hooks: uses student hook (evidence: `src/features/students/useStudents.ts`)
- Schedules → Feature data hooks: uses schedule hook (evidence: `src/features/schedules/useSchedules.ts`)
- Grades → Feature data hooks: uses grade hook (evidence: `src/features/grades/useGrades.ts`)
- User administration → Feature data hooks: uses user hook (evidence: `src/features/users/useUsers.ts`)
- School settings → Feature data hooks: uses settings hook (evidence: `src/features/settings/useSettings.ts`)
- Feature data hooks → Toast notifications: shows feedback (evidence: `src/features/attendance/useAttendance.ts`)
- Toast notifications → UI state: pushes toast (evidence: `src/components/ui/Toast/useToast.ts`)
- Feature data hooks → School context state: updates school context (evidence: `src/features/settings/useSettings.ts`)
- Reports → Report generation: requests reports
- Report generation → Supabase client: queries backend (evidence: `src/services/reportService.ts`)
- Report generation → Attendance: reads attendance data (evidence: `src/services/reportService.ts`)
- Report generation → Student records: reads student data (evidence: `src/services/reportService.ts`)
- Domain services → Supabase client: uses client (evidence: `src/services/authService.ts`)
- Authentication → Supabase client: auth operations (evidence: `src/services/authService.ts`)
- Supabase client → Supabase backend: queries and updates (evidence: `src/services/supabase.ts`)
- Domain services → Database types: uses database types (evidence: `src/services/authService.ts`)
