# argellucas/student-monitoring-system architecture

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

- Interactive diagram: https://gitdiagram.com/argellucas/student-monitoring-system
- Repository: https://github.com/argellucas/student-monitoring-system

## Overview

StudentMonitor is a student attendance and class-management portal. Its main workflow is GitHub sign-in, profile completion and administrator approval, followed by timetable viewing and protected attendance check-in. Administrators manage students and class windows, monitor attendance, and produce filtered reports with CSV export. The React app coordinates these workflows through session and API layers backed by Supabase; database migrations define the security boundary. Edges reflect excerpts or README statements; some unsampled feature wiring is therefore omitted.

Main entry points: [`src/pages/AdminPages.jsx`](https://github.com/argellucas/student-monitoring-system/blob/main/src/pages/AdminPages.jsx) (Admin pages), [`src/pages/StudentPages.jsx`](https://github.com/argellucas/student-monitoring-system/blob/main/src/pages/StudentPages.jsx) (Student pages), [`src/App.jsx`](https://github.com/argellucas/student-monitoring-system/blob/main/src/App.jsx) (Protected routes), [`src/lib/api.js`](https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/api.js) (Supabase API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and session"]
  node_react["React entry<br/>[main.jsx]"]
  node_routes["Protected routes<br/>[App.jsx]"]
  node_session["Session provider"]
  node_ui["Shared UI and motion<br/>[UI.jsx]"]
end

subgraph group_student["Student experience"]
  node_studentpages["Student pages<br/>[StudentPages.jsx]"]
  node_access["Access landing<br/>[AccessLanding.jsx]"]
  node_studentflow["Student workflow<br/>[student-flow.js]"]
  node_studentdash["Student dashboard"]
  node_studentexperience["Student experience"]
end

subgraph group_admin["Administrator workspace"]
  node_adminpages["Admin pages<br/>[AdminPages.jsx]"]
  node_admindash["Dashboard calculations<br/>[admin-dashboard.js]"]
  node_screens["Admin screens<br/>[screens.js]"]
  node_focus["Dashboard focus<br/>[DashboardFocus.jsx]"]
end

subgraph group_data["Data and domain logic"]
  node_auth["OAuth and session<br/>[auth.js]"]
  node_api["Supabase API<br/>[api.js]"]
  node_client["Supabase client<br/>[supabase.js]"]
  node_schedule["Schedule logic<br/>[schedule.js]"]
  node_daily["Daily register<br/>[daily-register.js]"]
  node_reports["Reports and CSV<br/>[report.js]"]
  node_attendanceviews["Attendance views"]
  node_format["Formatting helpers<br/>[format.js]"]
end

node_user(("Student or admin"))
node_backend[("Supabase Auth and database")]

node_user -->|"opens portal"| node_react
node_react -->|"provides session"| node_session
node_react -->|"renders"| node_routes
node_routes -->|"guards routes"| node_session
node_routes -->|"routes to"| node_studentpages
node_routes -->|"routes to"| node_adminpages
node_routes -->|"renders"| node_ui
node_session -->|"loads context and data"| node_api
node_session -->|"starts heartbeat"| node_auth
node_auth -->|"starts OAuth and signs out"| node_client
node_auth -->|"revokes session"| node_api
node_studentpages -->|"loads and submits"| node_api
node_studentpages -->|"renders"| node_access
node_studentpages -->|"uses workflow logic"| node_studentflow
node_studentpages -->|"uses dashboard data"| node_studentdash
node_studentpages -->|"renders"| node_studentexperience
node_studentpages -->|"uses schedule logic"| node_schedule
node_adminpages -->|"loads and updates"| node_api
node_adminpages -->|"uses calculations"| node_admindash
node_adminpages -->|"uses screen logic"| node_screens
node_adminpages -->|"renders focus panel"| node_focus
node_adminpages -->|"builds reports"| node_reports
node_adminpages -->|"uses register logic"| node_daily
node_adminpages -->|"uses schedule logic"| node_schedule
node_adminpages -->|"renders shared controls"| node_ui
node_adminpages -->|"logs out"| node_auth
node_api -->|"queries and invokes RPC"| node_client
node_client -->|"accesses protected services"| node_backend
node_studentflow -->|"uses schedule logic"| node_schedule
node_reports -->|"checks windows"| node_schedule
node_screens -->|"uses calculations"| node_admindash

click node_react "https://github.com/argellucas/student-monitoring-system/blob/main/src/main.jsx"
click node_routes "https://github.com/argellucas/student-monitoring-system/blob/main/src/App.jsx"
click node_session "https://github.com/argellucas/student-monitoring-system/blob/main/src/state/SessionProvider.jsx"
click node_auth "https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/auth.js"
click node_studentpages "https://github.com/argellucas/student-monitoring-system/blob/main/src/pages/StudentPages.jsx"
click node_access "https://github.com/argellucas/student-monitoring-system/blob/main/src/components/AccessLanding.jsx"
click node_studentflow "https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/student-flow.js"
click node_studentdash "https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/student-dashboard.js"
click node_studentexperience "https://github.com/argellucas/student-monitoring-system/blob/main/src/components/StudentExperience.jsx"
click node_adminpages "https://github.com/argellucas/student-monitoring-system/blob/main/src/pages/AdminPages.jsx"
click node_admindash "https://github.com/argellucas/student-monitoring-system/blob/main/src/pages/admin-dashboard.js"
click node_screens "https://github.com/argellucas/student-monitoring-system/blob/main/src/pages/screens.js"
click node_focus "https://github.com/argellucas/student-monitoring-system/blob/main/src/components/DashboardFocus.jsx"
click node_ui "https://github.com/argellucas/student-monitoring-system/blob/main/src/components/UI.jsx"
click node_api "https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/api.js"
click node_client "https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/supabase.js"
click node_schedule "https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/schedule.js"
click node_daily "https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/daily-register.js"
click node_reports "https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/report.js"
click node_attendanceviews "https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/attendance-views.js"
click node_format "https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/format.js"
click node_backend "https://github.com/argellucas/student-monitoring-system/blob/main/supabase/migrations/202611190001_initial.sql"

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_react,node_routes,node_session,node_ui toneBlue
class node_studentpages,node_access,node_studentflow,node_studentdash,node_studentexperience,node_backend toneAmber
class node_adminpages,node_admindash,node_screens,node_focus toneMint
class node_auth,node_api,node_client,node_schedule,node_daily,node_reports,node_attendanceviews,node_format toneRose
class node_user toneIndigo
```

## Components

### Application and session

- [React entry](https://github.com/argellucas/student-monitoring-system/blob/main/src/main.jsx): `src/main.jsx`
- [Protected routes](https://github.com/argellucas/student-monitoring-system/blob/main/src/App.jsx): `src/App.jsx`
- [Session provider](https://github.com/argellucas/student-monitoring-system/blob/main/src/state/SessionProvider.jsx): `src/state/SessionProvider.jsx`
- [Shared UI and motion](https://github.com/argellucas/student-monitoring-system/blob/main/src/components/UI.jsx): `src/components/UI.jsx`

### Student experience

- [Student pages](https://github.com/argellucas/student-monitoring-system/blob/main/src/pages/StudentPages.jsx): `src/pages/StudentPages.jsx`
- [Access landing](https://github.com/argellucas/student-monitoring-system/blob/main/src/components/AccessLanding.jsx): `src/components/AccessLanding.jsx`
- [Student workflow](https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/student-flow.js): `src/lib/student-flow.js`
- [Student dashboard](https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/student-dashboard.js): `src/lib/student-dashboard.js`
- [Student experience](https://github.com/argellucas/student-monitoring-system/blob/main/src/components/StudentExperience.jsx): `src/components/StudentExperience.jsx`

### Administrator workspace

- [Admin pages](https://github.com/argellucas/student-monitoring-system/blob/main/src/pages/AdminPages.jsx): `src/pages/AdminPages.jsx`
- [Dashboard calculations](https://github.com/argellucas/student-monitoring-system/blob/main/src/pages/admin-dashboard.js): `src/pages/admin-dashboard.js`
- [Admin screens](https://github.com/argellucas/student-monitoring-system/blob/main/src/pages/screens.js): `src/pages/screens.js`
- [Dashboard focus](https://github.com/argellucas/student-monitoring-system/blob/main/src/components/DashboardFocus.jsx): `src/components/DashboardFocus.jsx`

### Data and domain logic

- [OAuth and session](https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/auth.js): `src/lib/auth.js`
- [Supabase API](https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/api.js): `src/lib/api.js`
- [Supabase client](https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/supabase.js): `src/lib/supabase.js`
- [Schedule logic](https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/schedule.js): `src/lib/schedule.js`
- [Daily register](https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/daily-register.js): `src/lib/daily-register.js`
- [Reports and CSV](https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/report.js): `src/lib/report.js`
- [Attendance views](https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/attendance-views.js): `src/lib/attendance-views.js`
- [Formatting helpers](https://github.com/argellucas/student-monitoring-system/blob/main/src/lib/format.js): `src/lib/format.js`

### Other components

- **Student or admin**
- [Supabase Auth and database](https://github.com/argellucas/student-monitoring-system/blob/main/supabase/migrations/202611190001_initial.sql): `supabase/migrations/202611190001_initial.sql`

## Connections

- Student or admin → React entry: opens portal (evidence: `README.md`)
- React entry → Session provider: provides session (evidence: `src/main.jsx`)
- React entry → Protected routes: renders (evidence: `src/main.jsx`)
- Protected routes → Session provider: guards routes (evidence: `src/App.jsx`)
- Protected routes → Student pages: routes to (evidence: `src/App.jsx`)
- Protected routes → Admin pages: routes to (evidence: `src/App.jsx`)
- Protected routes → Shared UI and motion: renders (evidence: `src/App.jsx`)
- Session provider → Supabase API: loads context and data (evidence: `src/state/SessionProvider.jsx`)
- Session provider → OAuth and session: starts heartbeat (evidence: `src/state/SessionProvider.jsx`)
- OAuth and session → Supabase client: starts OAuth and signs out (evidence: `src/lib/auth.js`)
- OAuth and session → Supabase API: revokes session (evidence: `src/lib/auth.js`)
- Student pages → Supabase API: loads and submits (evidence: `src/pages/StudentPages.jsx`)
- Student pages → Access landing: renders (evidence: `src/pages/StudentPages.jsx`)
- Student pages → Student workflow: uses workflow logic (evidence: `src/pages/StudentPages.jsx`)
- Student pages → Student dashboard: uses dashboard data (evidence: `src/pages/StudentPages.jsx`)
- Student pages → Student experience: renders (evidence: `src/pages/StudentPages.jsx`)
- Student pages → Schedule logic: uses schedule logic (evidence: `src/pages/StudentPages.jsx`)
- Admin pages → Supabase API: loads and updates (evidence: `src/pages/AdminPages.jsx`)
- Admin pages → Dashboard calculations: uses calculations (evidence: `src/pages/AdminPages.jsx`)
- Admin pages → Admin screens: uses screen logic (evidence: `src/pages/AdminPages.jsx`)
- Admin pages → Dashboard focus: renders focus panel (evidence: `src/pages/AdminPages.jsx`)
- Admin pages → Reports and CSV: builds reports (evidence: `src/pages/AdminPages.jsx`)
- Admin pages → Daily register: uses register logic (evidence: `src/pages/AdminPages.jsx`)
- Admin pages → Schedule logic: uses schedule logic (evidence: `src/pages/AdminPages.jsx`)
- Admin pages → Shared UI and motion: renders shared controls (evidence: `src/pages/AdminPages.jsx`)
- Admin pages → OAuth and session: logs out (evidence: `src/pages/AdminPages.jsx`)
- Supabase API → Supabase client: queries and invokes RPC (evidence: `src/lib/api.js`)
- Supabase client → Supabase Auth and database: accesses protected services (evidence: `README.md`)
- Student workflow → Schedule logic: uses schedule logic (evidence: `src/lib/student-flow.js`)
- Reports and CSV → Schedule logic: checks windows (evidence: `src/lib/report.js`)
- Admin screens → Dashboard calculations: uses calculations (evidence: `src/pages/screens.js`)
