# arcanacorp/ttutis_admin architecture

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

- Interactive diagram: https://gitdiagram.com/arcanacorp/ttutis_admin
- Repository: https://github.com/arcanacorp/ttutis_admin

## Overview

This is a school-institution management web app: users register or sign in, then work with institution-scoped dashboards for attendance, classes and schedules, communications, payments, people, school years, settings, and school profile. The sampled data hooks and services show dashboard reads through Supabase, while profile context loads memberships and supports profile and institution updates. Several page-to-hook relationships are visible in the source index; unsampled route behavior and middleware wiring are not inferred.

Main entry points: [`src/hooks/useInstitutionData.js`](https://github.com/arcanacorp/ttutis_admin/blob/main/src/hooks/useInstitutionData.js) (Institution data hooks), [`src/context/ProfileContext.jsx`](https://github.com/arcanacorp/ttutis_admin/blob/main/src/context/ProfileContext.jsx) (Profile and membership), [`src/context/AuthContext.jsx`](https://github.com/arcanacorp/ttutis_admin/blob/main/src/context/AuthContext.jsx) (Authentication state), [`src/lib/supabase/client.js`](https://github.com/arcanacorp/ttutis_admin/blob/main/src/lib/supabase/client.js) (Supabase browser client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and identity"]
  node_signin["Sign in<br/>[SignInForm.jsx]"]
  node_register["Admin registration"]
  node_registerapi["Registration endpoint<br/>[route.js]"]
  node_auth["Authentication state<br/>[AuthContext.jsx]"]
  node_profile["Profile and membership<br/>[ProfileContext.jsx]"]
end

subgraph group_dash["Institution workspace"]
  node_overview["Dashboard overview<br/>[page.jsx]"]
  node_attendance["Attendance<br/>[page.jsx]"]
  node_classes["Classes and schedules<br/>[page.jsx]"]
  node_communications["Communications<br/>[page.jsx]"]
  node_payments["Payments<br/>[page.jsx]"]
  node_people["People<br/>[page.jsx]"]
  node_schoolyear["School year<br/>[page.jsx]"]
  node_settings["Institution settings<br/>[page.jsx]"]
  node_myschool["My school<br/>[page.jsx]"]
end

subgraph group_data["Data access"]
  node_hook["Institution data hooks"]
  node_resource["Resource loading"]
  node_institutiondata["Institution data service"]
  node_profileservice["Profile service<br/>[profileService.js]"]
  node_browserclient["Supabase browser client<br/>[client.js]"]
end

subgraph group_shell["Application shell"]
  node_providers["Context providers<br/>[index.jsx]"]
  node_navbar["Dashboard navigation<br/>[Navbar.jsx]"]
end

node_visitor(("User"))
node_supabase[("Supabase")]

node_visitor -->|"enters credentials"| node_signin
node_visitor -->|"starts registration"| node_register
node_signin -->|"signs in through"| node_auth
node_register -->|"signs up through"| node_auth
node_register -.->|"submits registration"| node_registerapi
node_auth -->|"uses auth client"| node_browserclient
node_auth -->|"provides user state"| node_profile
node_profile -->|"loads and updates"| node_profileservice
node_profile -->|"service uses client"| node_browserclient
node_overview -->|"loads dashboard data"| node_hook
node_attendance -->|"loads attendance data"| node_hook
node_classes -->|"loads schedule data"| node_hook
node_communications -->|"loads updates"| node_hook
node_payments -->|"loads payment data"| node_hook
node_people -->|"loads people data"| node_hook
node_schoolyear -->|"loads year data"| node_hook
node_settings -->|"loads settings data"| node_hook
node_hook -->|"gets institution context"| node_profile
node_hook -->|"delegates resource state"| node_resource
node_hook -->|"selects data loader"| node_institutiondata
node_institutiondata -->|"queries via client"| node_browserclient
node_browserclient -->|"connects to service"| node_supabase
node_myschool -->|"uses profile state"| node_profile
node_providers -->|"provides auth context"| node_auth
node_providers -->|"provides profile context"| node_profile
node_navbar -->|"uses auth state"| node_auth
node_navbar -->|"uses profile state"| node_profile

click node_signin "https://github.com/arcanacorp/ttutis_admin/blob/main/src/components/auth/SignInForm.jsx"
click node_register "https://github.com/arcanacorp/ttutis_admin/blob/main/src/components/auth/RegisterAdminForm.jsx"
click node_registerapi "https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/api/auth/register/route.js"
click node_auth "https://github.com/arcanacorp/ttutis_admin/blob/main/src/context/AuthContext.jsx"
click node_profile "https://github.com/arcanacorp/ttutis_admin/blob/main/src/context/ProfileContext.jsx"
click node_overview "https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/page.jsx"
click node_attendance "https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/attendance/page.jsx"
click node_classes "https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/classes-schedules/page.jsx"
click node_communications "https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/communications/page.jsx"
click node_payments "https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/payments/page.jsx"
click node_people "https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/people/page.jsx"
click node_schoolyear "https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/school-year/page.jsx"
click node_settings "https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/settings/page.jsx"
click node_myschool "https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/my-school/page.jsx"
click node_hook "https://github.com/arcanacorp/ttutis_admin/blob/main/src/hooks/useInstitutionData.js"
click node_resource "https://github.com/arcanacorp/ttutis_admin/blob/main/src/hooks/useInstitutionResource.js"
click node_institutiondata "https://github.com/arcanacorp/ttutis_admin/blob/main/src/services/institutionDataService.js"
click node_profileservice "https://github.com/arcanacorp/ttutis_admin/blob/main/src/services/profileService.js"
click node_browserclient "https://github.com/arcanacorp/ttutis_admin/blob/main/src/lib/supabase/client.js"
click node_providers "https://github.com/arcanacorp/ttutis_admin/blob/main/src/providers/index.jsx"
click node_navbar "https://github.com/arcanacorp/ttutis_admin/blob/main/src/components/layout/Navbar.jsx"

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_signin,node_register,node_registerapi,node_auth,node_profile,node_visitor toneBlue
class node_overview,node_attendance,node_classes,node_communications,node_payments,node_people,node_schoolyear,node_settings,node_myschool,node_supabase toneAmber
class node_hook,node_resource,node_institutiondata,node_profileservice,node_browserclient toneMint
class node_providers,node_navbar toneRose
```

## Components

### Access and identity

- [Sign in](https://github.com/arcanacorp/ttutis_admin/blob/main/src/components/auth/SignInForm.jsx): `src/components/auth/SignInForm.jsx`
- [Admin registration](https://github.com/arcanacorp/ttutis_admin/blob/main/src/components/auth/RegisterAdminForm.jsx): `src/components/auth/RegisterAdminForm.jsx`
- [Registration endpoint](https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/api/auth/register/route.js): `src/app/api/auth/register/route.js`
- [Authentication state](https://github.com/arcanacorp/ttutis_admin/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Profile and membership](https://github.com/arcanacorp/ttutis_admin/blob/main/src/context/ProfileContext.jsx): `src/context/ProfileContext.jsx`

### Institution workspace

- [Dashboard overview](https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/page.jsx): `src/app/dashboard/page.jsx`
- [Attendance](https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/attendance/page.jsx): `src/app/dashboard/attendance/page.jsx`
- [Classes and schedules](https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/classes-schedules/page.jsx): `src/app/dashboard/classes-schedules/page.jsx`
- [Communications](https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/communications/page.jsx): `src/app/dashboard/communications/page.jsx`
- [Payments](https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/payments/page.jsx): `src/app/dashboard/payments/page.jsx`
- [People](https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/people/page.jsx): `src/app/dashboard/people/page.jsx`
- [School year](https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/school-year/page.jsx): `src/app/dashboard/school-year/page.jsx`
- [Institution settings](https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/settings/page.jsx): `src/app/dashboard/settings/page.jsx`
- [My school](https://github.com/arcanacorp/ttutis_admin/blob/main/src/app/dashboard/my-school/page.jsx): `src/app/dashboard/my-school/page.jsx`

### Data access

- [Institution data hooks](https://github.com/arcanacorp/ttutis_admin/blob/main/src/hooks/useInstitutionData.js): `src/hooks/useInstitutionData.js`
- [Resource loading](https://github.com/arcanacorp/ttutis_admin/blob/main/src/hooks/useInstitutionResource.js): `src/hooks/useInstitutionResource.js`
- [Institution data service](https://github.com/arcanacorp/ttutis_admin/blob/main/src/services/institutionDataService.js): `src/services/institutionDataService.js`
- [Profile service](https://github.com/arcanacorp/ttutis_admin/blob/main/src/services/profileService.js): `src/services/profileService.js`
- [Supabase browser client](https://github.com/arcanacorp/ttutis_admin/blob/main/src/lib/supabase/client.js): `src/lib/supabase/client.js`

### Application shell

- [Context providers](https://github.com/arcanacorp/ttutis_admin/blob/main/src/providers/index.jsx): `src/providers/index.jsx`
- [Dashboard navigation](https://github.com/arcanacorp/ttutis_admin/blob/main/src/components/layout/Navbar.jsx): `src/components/layout/Navbar.jsx`

### Other components

- **User**
- **Supabase**

## Connections

- User → Sign in: enters credentials
- User → Admin registration: starts registration
- Sign in → Authentication state: signs in through (evidence: `src/components/auth/SignInForm.jsx`)
- Admin registration → Authentication state: signs up through (evidence: `src/components/auth/RegisterAdminForm.jsx`)
- Admin registration → Registration endpoint: submits registration
- Authentication state → Supabase browser client: uses auth client (evidence: `src/context/AuthContext.jsx`)
- Authentication state → Profile and membership: provides user state (evidence: `src/context/ProfileContext.jsx`)
- Profile and membership → Profile service: loads and updates (evidence: `src/context/ProfileContext.jsx`)
- Profile and membership → Supabase browser client: service uses client
- Dashboard overview → Institution data hooks: loads dashboard data (evidence: `src/app/dashboard/page.jsx`)
- Attendance → Institution data hooks: loads attendance data (evidence: `src/app/dashboard/attendance/page.jsx`)
- Classes and schedules → Institution data hooks: loads schedule data (evidence: `src/app/dashboard/classes-schedules/page.jsx`)
- Communications → Institution data hooks: loads updates (evidence: `src/app/dashboard/communications/page.jsx`)
- Payments → Institution data hooks: loads payment data (evidence: `src/app/dashboard/payments/page.jsx`)
- People → Institution data hooks: loads people data (evidence: `src/app/dashboard/people/page.jsx`)
- School year → Institution data hooks: loads year data (evidence: `src/app/dashboard/school-year/page.jsx`)
- Institution settings → Institution data hooks: loads settings data (evidence: `src/app/dashboard/settings/page.jsx`)
- Institution data hooks → Profile and membership: gets institution context (evidence: `src/hooks/useInstitutionData.js`)
- Institution data hooks → Resource loading: delegates resource state (evidence: `src/hooks/useInstitutionData.js`)
- Institution data hooks → Institution data service: selects data loader (evidence: `src/hooks/useInstitutionData.js`)
- Institution data service → Supabase browser client: queries via client (evidence: `src/services/institutionDataService.js`)
- Supabase browser client → Supabase: connects to service (evidence: `src/lib/supabase/client.js`)
- My school → Profile and membership: uses profile state (evidence: `src/app/dashboard/my-school/page.jsx`)
- Context providers → Authentication state: provides auth context (evidence: `src/providers/index.jsx`)
- Context providers → Profile and membership: provides profile context (evidence: `src/providers/index.jsx`)
- Dashboard navigation → Authentication state: uses auth state (evidence: `src/components/layout/Navbar.jsx`)
- Dashboard navigation → Profile and membership: uses profile state (evidence: `src/components/layout/Navbar.jsx`)
