# nikhil3235/snapclass-nikhil-mali architecture

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

- Interactive diagram: https://gitdiagram.com/nikhil3235/snapclass-nikhil-mali
- Repository: https://github.com/nikhil3235/snapclass-nikhil-mali

## Overview

SnapClass is a Streamlit attendance product for teachers and students. The main workflow routes a user into a portal, manages subjects and enrollment, identifies attendance from classroom photos or audio, lets teachers review and export results, and records confirmed logs in Supabase. Students also enroll with face/optional voice profiles and review attendance analytics. The graph includes the indexed screens, dialogs, pipelines, and storage modules; several links to unsampled dialog implementations are supported only by documented capabilities or module references.

Main entry points: [`src/screens/teacher_screen.py`](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/screens/teacher_screen.py) (Teacher portal), [`src/screens/student_screen.py`](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/screens/student_screen.py) (Student portal), [`src/database/db.py`](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/database/db.py) (Attendance data access), [`app.py`](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/app.py) (App router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["User portals"]
  node_app["App router<br/>[app.py]"]
  node_home["Home portal<br/>[home_screen.py]"]
  node_teacher["Teacher portal<br/>[teacher_screen.py]"]
  node_student["Student portal<br/>[student_screen.py]"]
  node_subject_create["Create subject"]
  node_subject_share["Share subject"]
  node_enrollment["Subject enrollment<br/>[dialog_enroll.py]"]
  node_auto_enroll["Code enrollment"]
  node_subject_card["Subject cards<br/>[subject_card.py]"]
end

subgraph group_attendance["Attendance methods"]
  node_face["Face recognition<br/>[face_pipeline.py]"]
  node_photo["Photo attendance"]
  node_voice["Voice analysis<br/>[voice_pipeline.py]"]
  node_voice_dialog["Voice attendance"]
  node_results["Review and export"]
end

subgraph group_records["Records and analytics"]
  node_analytics["Attendance analytics"]
  node_database["Attendance data access<br/>[db.py]"]
  node_supabase[("Supabase store")]
end

subgraph group_foundation["Shared foundation"]
  node_config["Supabase client config<br/>[config.py]"]
  node_layout["Page styling<br/>[base_layout.py]"]
  node_header["Brand header<br/>[header.py]"]
  node_footer["Brand footer<br/>[footer.py]"]
end

node_user(("Teacher or student"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_teacher
node_app -->|"routes to"| node_student
node_app -->|"opens code"| node_auto_enroll
node_teacher -->|"opens"| node_subject_create
node_teacher -->|"opens"| node_subject_share
node_teacher -->|"starts photo flow"| node_photo
node_teacher -->|"requests recognition"| node_face
node_teacher -->|"shows results"| node_results
node_teacher -->|"requests analytics"| node_analytics
node_student -->|"opens"| node_enrollment
node_student -->|"gets embeddings"| node_face
node_student -->|"gets embeddings"| node_voice
node_student -->|"reads and updates"| node_database
node_teacher -->|"reads records"| node_database
node_teacher -->|"renders"| node_subject_card
node_student -->|"renders"| node_subject_card
node_voice_dialog -->|"processes audio"| node_voice
node_voice_dialog -->|"shows results"| node_results
node_results -->|"saves logs"| node_database
node_database -->|"uses client"| node_config
node_config -->|"connects"| node_supabase
node_face -->|"loads students"| node_database
node_database -->|"reads and writes"| node_supabase
node_teacher -->|"styles page"| node_layout
node_student -->|"styles page"| node_layout
node_home -->|"renders"| node_header
node_home -->|"renders"| node_footer
node_teacher -->|"renders"| node_header
node_teacher -->|"renders"| node_footer
node_student -->|"renders"| node_header
node_student -->|"renders"| node_footer

click node_app "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/app.py"
click node_home "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/screens/home_screen.py"
click node_teacher "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/screens/teacher_screen.py"
click node_student "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/screens/student_screen.py"
click node_subject_create "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_create_subject.py"
click node_subject_share "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_share_subject.py"
click node_enrollment "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_enroll.py"
click node_auto_enroll "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_auto_enroll.py"
click node_subject_card "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/subject_card.py"
click node_face "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/pipelines/face_pipeline.py"
click node_photo "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_add_photo.py"
click node_voice "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/pipelines/voice_pipeline.py"
click node_voice_dialog "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_voice_attendance.py"
click node_results "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_attendance_results.py"
click node_analytics "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_attendance_results.py"
click node_database "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/database/db.py"
click node_config "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/database/config.py"
click node_layout "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/ui/base_layout.py"
click node_header "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/header.py"
click node_footer "https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/footer.py"

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_app,node_home,node_teacher,node_student,node_subject_create,node_subject_share,node_enrollment,node_auto_enroll,node_subject_card toneBlue
class node_face,node_photo,node_voice,node_voice_dialog,node_results toneAmber
class node_analytics,node_database,node_supabase toneMint
class node_config,node_layout,node_header,node_footer toneRose
class node_user toneIndigo
```

## Components

### User portals

- [App router](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/app.py): `app.py`
- [Home portal](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/screens/home_screen.py): `src/screens/home_screen.py`
- [Teacher portal](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/screens/teacher_screen.py): `src/screens/teacher_screen.py`
- [Student portal](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/screens/student_screen.py): `src/screens/student_screen.py`
- [Create subject](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_create_subject.py): `src/components/dialog_create_subject.py`
- [Share subject](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_share_subject.py): `src/components/dialog_share_subject.py`
- [Subject enrollment](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_enroll.py): `src/components/dialog_enroll.py`
- [Code enrollment](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_auto_enroll.py): `src/components/dialog_auto_enroll.py`
- [Subject cards](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/subject_card.py): `src/components/subject_card.py`

### Attendance methods

- [Face recognition](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/pipelines/face_pipeline.py): `src/pipelines/face_pipeline.py`
- [Photo attendance](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_add_photo.py): `src/components/dialog_add_photo.py`
- [Voice analysis](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/pipelines/voice_pipeline.py): `src/pipelines/voice_pipeline.py`
- [Voice attendance](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_voice_attendance.py): `src/components/dialog_voice_attendance.py`
- [Review and export](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_attendance_results.py): `src/components/dialog_attendance_results.py`

### Records and analytics

- [Attendance analytics](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/dialog_attendance_results.py): `src/components/dialog_attendance_results.py`
- [Attendance data access](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/database/db.py): `src/database/db.py`
- **Supabase store**

### Shared foundation

- [Supabase client config](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/database/config.py): `src/database/config.py`
- [Page styling](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/ui/base_layout.py): `src/ui/base_layout.py`
- [Brand header](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/header.py): `src/components/header.py`
- [Brand footer](https://github.com/nikhil3235/snapclass-nikhil-mali/blob/main/src/components/footer.py): `src/components/footer.py`

### Other components

- **Teacher or student**

## Connections

- Teacher or student → App router: opens (evidence: `README.md`)
- App router → Home portal: routes to (evidence: `app.py`)
- App router → Teacher portal: routes to (evidence: `app.py`)
- App router → Student portal: routes to (evidence: `app.py`)
- App router → Code enrollment: opens code (evidence: `app.py`)
- Teacher portal → Create subject: opens (evidence: `src/screens/teacher_screen.py`)
- Teacher portal → Share subject: opens (evidence: `src/screens/teacher_screen.py`)
- Teacher portal → Photo attendance: starts photo flow (evidence: `src/screens/teacher_screen.py`)
- Teacher portal → Face recognition: requests recognition (evidence: `src/screens/teacher_screen.py`)
- Teacher portal → Review and export: shows results (evidence: `src/screens/teacher_screen.py`)
- Teacher portal → Attendance analytics: requests analytics (evidence: `src/screens/teacher_screen.py`)
- Student portal → Subject enrollment: opens (evidence: `src/screens/student_screen.py`)
- Student portal → Face recognition: gets embeddings (evidence: `src/screens/student_screen.py`)
- Student portal → Voice analysis: gets embeddings (evidence: `src/screens/student_screen.py`)
- Student portal → Attendance data access: reads and updates (evidence: `src/screens/student_screen.py`)
- Teacher portal → Attendance data access: reads records (evidence: `src/screens/teacher_screen.py`)
- Teacher portal → Subject cards: renders (evidence: `src/screens/teacher_screen.py`)
- Student portal → Subject cards: renders (evidence: `src/screens/student_screen.py`)
- Voice attendance → Voice analysis: processes audio (evidence: `src/components/dialog_voice_attendance.py`)
- Voice attendance → Review and export: shows results (evidence: `src/components/dialog_voice_attendance.py`)
- Review and export → Attendance data access: saves logs (evidence: `src/components/dialog_attendance_results.py`)
- Attendance data access → Supabase client config: uses client (evidence: `src/database/db.py`)
- Supabase client config → Supabase store: connects (evidence: `src/database/config.py`)
- Face recognition → Attendance data access: loads students (evidence: `src/pipelines/face_pipeline.py`)
- Attendance data access → Supabase store: reads and writes (evidence: `src/database/db.py`)
- Teacher portal → Page styling: styles page (evidence: `src/screens/teacher_screen.py`)
- Student portal → Page styling: styles page (evidence: `src/screens/student_screen.py`)
- Home portal → Brand header: renders (evidence: `src/screens/home_screen.py`)
- Home portal → Brand footer: renders (evidence: `src/screens/home_screen.py`)
- Teacher portal → Brand header: renders (evidence: `src/screens/teacher_screen.py`)
- Teacher portal → Brand footer: renders (evidence: `src/screens/teacher_screen.py`)
- Student portal → Brand header: renders (evidence: `src/screens/student_screen.py`)
- Student portal → Brand footer: renders (evidence: `src/screens/student_screen.py`)
