# dsomnath627/attendance-portal architecture

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

- Interactive diagram: https://gitdiagram.com/dsomnath627/attendance-portal
- Repository: https://github.com/dsomnath627/attendance-portal

## Overview

Dr. Campus is a multi-role academic management portal. Users enter through authentication and an approval/status gate, then the application dispatches them to role-specific workflows: coordinators configure academic structure, teachers manage offerings and attendance, students review enrollment and academic records, and super admins verify users. Attendance supports manual entry and photo-based OCR; Supabase provides authentication and persisted application data. The README documents Gemini OCR and spreadsheet capabilities, though the relevant implementation details were not fully sampled.

Main entry points: [`lib/supabase.ts`](https://github.com/dsomnath627/attendance-portal/blob/main/lib/supabase.ts) (Supabase client), [`components/App.tsx`](https://github.com/dsomnath627/attendance-portal/blob/main/components/App.tsx) (Role-based app), [`app/page.tsx`](https://github.com/dsomnath627/attendance-portal/blob/main/app/page.tsx) (Auth gateway), [`components/StudentDashboard.tsx`](https://github.com/dsomnath627/attendance-portal/blob/main/components/StudentDashboard.tsx) (Student dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and access"]
  node_landing["Product landing<br/>[page.tsx]"]
  node_gateway["Auth gateway<br/>[page.tsx]"]
  node_auth["Sign in / register<br/>[Auth.tsx]"]
  node_app["Role-based app<br/>[App.tsx]"]
end

subgraph group_admin["Administration"]
  node_adminverify["User verification"]
  node_coordinator["Academic setup"]
  node_profile["Profile editor<br/>[MyProfilePage.tsx]"]
end

subgraph group_academics["Academic workflows"]
  node_teacher["Teacher dashboard"]
  node_student["Student dashboard"]
  node_subject["Subject workspace<br/>[SubjectPage.tsx]"]
  node_attendance["Attendance intake"]
  node_studentattendance["Student attendance view"]
  node_timetable["Timetable view"]
end

subgraph group_services["Data and integrations"]
  node_ocr["Gemini OCR route<br/>[route.ts]"]
  node_client["Supabase client<br/>[supabase.ts]"]
  node_supabase[("Supabase platform")]
  node_gemini["Google Gemini"]
end

node_visitor(("Portal user"))

node_visitor -->|"views"| node_landing
node_landing -->|"links to"| node_gateway
node_visitor -.->|"opens"| node_gateway
node_gateway -->|"renders"| node_auth
node_auth -->|"authenticates"| node_client
node_gateway -->|"loads profile"| node_client
node_gateway -->|"renders approved user"| node_app
node_app -->|"queries data"| node_client
node_app -->|"dispatches to"| node_adminverify
node_app -->|"dispatches to"| node_coordinator
node_app -->|"dispatches to"| node_teacher
node_app -->|"dispatches to"| node_student
node_app -->|"dispatches to"| node_profile
node_adminverify -->|"updates profiles"| node_client
node_coordinator -->|"manages records"| node_client
node_teacher -->|"opens offering"| node_subject
node_teacher -->|"renders schedule"| node_timetable
node_student -->|"loads enrollment and attendance"| node_client
node_student -->|"opens offering"| node_subject
node_student -->|"renders routine"| node_timetable
node_subject -->|"renders intake"| node_attendance
node_subject -->|"renders records"| node_studentattendance
node_attendance -.->|"submits photo"| node_ocr
node_ocr -->|"requests OCR"| node_gemini
node_client -->|"connects to"| node_supabase
node_profile -->|"reads and updates"| node_client
node_studentattendance -->|"reads records"| node_client

click node_landing "https://github.com/dsomnath627/attendance-portal/blob/main/app/landing/page.tsx"
click node_gateway "https://github.com/dsomnath627/attendance-portal/blob/main/app/page.tsx"
click node_auth "https://github.com/dsomnath627/attendance-portal/blob/main/components/Auth.tsx"
click node_app "https://github.com/dsomnath627/attendance-portal/blob/main/components/App.tsx"
click node_adminverify "https://github.com/dsomnath627/attendance-portal/blob/main/components/AdminUserVerification.tsx"
click node_coordinator "https://github.com/dsomnath627/attendance-portal/blob/main/components/CoordinatorDashboard.tsx"
click node_profile "https://github.com/dsomnath627/attendance-portal/blob/main/components/MyProfilePage.tsx"
click node_teacher "https://github.com/dsomnath627/attendance-portal/blob/main/components/TeacherDashboard.tsx"
click node_student "https://github.com/dsomnath627/attendance-portal/blob/main/components/StudentDashboard.tsx"
click node_subject "https://github.com/dsomnath627/attendance-portal/blob/main/components/SubjectPage.tsx"
click node_attendance "https://github.com/dsomnath627/attendance-portal/blob/main/components/AttendanceTaking.tsx"
click node_studentattendance "https://github.com/dsomnath627/attendance-portal/blob/main/components/StudentAttendanceView.tsx"
click node_timetable "https://github.com/dsomnath627/attendance-portal/blob/main/components/CalendarTimetable.tsx"
click node_ocr "https://github.com/dsomnath627/attendance-portal/blob/main/app/api/ocr/route.ts"
click node_client "https://github.com/dsomnath627/attendance-portal/blob/main/lib/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_landing,node_gateway,node_auth,node_app,node_visitor toneBlue
class node_adminverify,node_coordinator,node_profile toneAmber
class node_teacher,node_student,node_subject,node_attendance,node_studentattendance,node_timetable toneMint
class node_ocr,node_client,node_supabase,node_gemini toneRose
```

## Components

### Entry and access

- [Product landing](https://github.com/dsomnath627/attendance-portal/blob/main/app/landing/page.tsx): `app/landing/page.tsx`
- [Auth gateway](https://github.com/dsomnath627/attendance-portal/blob/main/app/page.tsx): `app/page.tsx`
- [Sign in / register](https://github.com/dsomnath627/attendance-portal/blob/main/components/Auth.tsx): `components/Auth.tsx`
- [Role-based app](https://github.com/dsomnath627/attendance-portal/blob/main/components/App.tsx): `components/App.tsx`

### Administration

- [User verification](https://github.com/dsomnath627/attendance-portal/blob/main/components/AdminUserVerification.tsx): `components/AdminUserVerification.tsx`
- [Academic setup](https://github.com/dsomnath627/attendance-portal/blob/main/components/CoordinatorDashboard.tsx): `components/CoordinatorDashboard.tsx`
- [Profile editor](https://github.com/dsomnath627/attendance-portal/blob/main/components/MyProfilePage.tsx): `components/MyProfilePage.tsx`

### Academic workflows

- [Teacher dashboard](https://github.com/dsomnath627/attendance-portal/blob/main/components/TeacherDashboard.tsx): `components/TeacherDashboard.tsx`
- [Student dashboard](https://github.com/dsomnath627/attendance-portal/blob/main/components/StudentDashboard.tsx): `components/StudentDashboard.tsx`
- [Subject workspace](https://github.com/dsomnath627/attendance-portal/blob/main/components/SubjectPage.tsx): `components/SubjectPage.tsx`
- [Attendance intake](https://github.com/dsomnath627/attendance-portal/blob/main/components/AttendanceTaking.tsx): `components/AttendanceTaking.tsx`
- [Student attendance view](https://github.com/dsomnath627/attendance-portal/blob/main/components/StudentAttendanceView.tsx): `components/StudentAttendanceView.tsx`
- [Timetable view](https://github.com/dsomnath627/attendance-portal/blob/main/components/CalendarTimetable.tsx): `components/CalendarTimetable.tsx`

### Data and integrations

- [Gemini OCR route](https://github.com/dsomnath627/attendance-portal/blob/main/app/api/ocr/route.ts): `app/api/ocr/route.ts`
- [Supabase client](https://github.com/dsomnath627/attendance-portal/blob/main/lib/supabase.ts): `lib/supabase.ts`
- **Supabase platform**
- **Google Gemini**

### Other components

- **Portal user**

## Connections

- Portal user → Product landing: views (evidence: `app/landing/page.tsx`)
- Product landing → Auth gateway: links to (evidence: `app/landing/page.tsx`)
- Portal user → Auth gateway: opens
- Auth gateway → Sign in / register: renders (evidence: `app/page.tsx`)
- Sign in / register → Supabase client: authenticates (evidence: `components/Auth.tsx`)
- Auth gateway → Supabase client: loads profile (evidence: `app/page.tsx`)
- Auth gateway → Role-based app: renders approved user (evidence: `app/page.tsx`)
- Role-based app → Supabase client: queries data (evidence: `components/App.tsx`)
- Role-based app → User verification: dispatches to (evidence: `components/App.tsx`)
- Role-based app → Academic setup: dispatches to (evidence: `components/App.tsx`)
- Role-based app → Teacher dashboard: dispatches to (evidence: `components/App.tsx`)
- Role-based app → Student dashboard: dispatches to (evidence: `components/App.tsx`)
- Role-based app → Profile editor: dispatches to (evidence: `components/App.tsx`)
- User verification → Supabase client: updates profiles (evidence: `components/AdminUserVerification.tsx`)
- Academic setup → Supabase client: manages records (evidence: `components/CoordinatorDashboard.tsx`)
- Teacher dashboard → Subject workspace: opens offering (evidence: `components/TeacherDashboard.tsx`)
- Teacher dashboard → Timetable view: renders schedule (evidence: `components/TeacherDashboard.tsx`)
- Student dashboard → Supabase client: loads enrollment and attendance (evidence: `components/StudentDashboard.tsx`)
- Student dashboard → Subject workspace: opens offering (evidence: `components/StudentDashboard.tsx`)
- Student dashboard → Timetable view: renders routine (evidence: `components/StudentDashboard.tsx`)
- Subject workspace → Attendance intake: renders intake (evidence: `components/SubjectPage.tsx`)
- Subject workspace → Student attendance view: renders records (evidence: `components/SubjectPage.tsx`)
- Attendance intake → Gemini OCR route: submits photo
- Gemini OCR route → Google Gemini: requests OCR (evidence: `README.md`)
- Supabase client → Supabase platform: connects to (evidence: `lib/supabase.ts`)
- Profile editor → Supabase client: reads and updates (evidence: `components/MyProfilePage.tsx`)
- Student attendance view → Supabase client: reads records (evidence: `components/StudentAttendanceView.tsx`)
