# figureitoutshiv/snapclass-attendance architecture

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

- Interactive diagram: https://gitdiagram.com/figureitoutshiv/snapclass-attendance
- Repository: https://github.com/figureitoutshiv/snapclass-attendance

## Overview

SnapClass Attendance is a Streamlit app for teacher-managed classes and student attendance. The main workflow is teacher sign-in, subject selection, photo or audio attendance analysis, and attendance recording; students can register or sign in, enroll, and review class attendance. The graph also preserves subject management, sharing, enrollment, and dashboards. Evidence is limited to the supplied excerpts, SOURCE INDEX references, and README; unsampled implementations are represented by their exact tree paths, with only documented or indexed relationships connected.

Main entry points: [`src/screens/teacher_dashboard.py`](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/teacher_dashboard.py) (Teacher portal), [`src/screens/database/db.py`](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/database/db.py) (Attendance and class data), [`src/screens/student_dashboard.py`](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/student_dashboard.py) (Student portal), [`app.py`](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/app.py) (Streamlit entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry and home"]
  node_app["Streamlit entry<br/>[app.py]"]
  node_home["Role selection<br/>[home_dashboard.py]"]
  node_layout["Shared layout styling<br/>[base_layout.py]"]
  node_header["Home header<br/>[header.py]"]
end

subgraph group_dashboards["Teacher and student portals"]
  node_teacher["Teacher portal"]
  node_student["Student portal"]
  node_navigation["Dashboard navigation<br/>[navigation.py]"]
  node_subject_card["Subject card<br/>[subject_card.py]"]
end

subgraph group_attendance["Attendance recognition"]
  node_face["Face attendance pipeline<br/>[face_pipeline.py]"]
  node_voice["Voice attendance pipeline<br/>[voice_pipeline.py]"]
  node_voice_dialog["Voice attendance dialog"]
  node_results["Attendance results"]
  node_photo["Add attendance photos"]
end

subgraph group_class_tools["Class and enrollment tools"]
  node_auto_enroll["Join-code enrollment"]
  node_create_subject["Create subject dialog"]
  node_enroll["Enroll dialog<br/>[dialog_enroll.py]"]
  node_share["Share subject dialog"]
end

subgraph group_data["Persistence and configuration"]
  node_db["Attendance and class data<br/>[db.py]"]
  node_db_config["Supabase configuration<br/>[config.py]"]
end

node_user(("Teacher or student"))
node_supabase[("Supabase")]

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 -->|"styles with"| node_layout
node_app -->|"opens"| node_auto_enroll
node_home -->|"renders"| node_header
node_home -->|"styles with"| node_layout
node_teacher -->|"renders"| node_navigation
node_student -->|"renders"| node_navigation
node_teacher -->|"renders"| node_subject_card
node_student -->|"renders"| node_subject_card
node_teacher -->|"styles with"| node_layout
node_teacher -->|"opens"| node_photo
node_teacher -->|"opens"| node_create_subject
node_teacher -->|"opens"| node_share
node_teacher -->|"opens"| node_voice_dialog
node_teacher -->|"uses"| node_results
node_teacher -->|"analyzes photos"| node_face
node_teacher -->|"reads and records"| node_db
node_student -->|"opens"| node_enroll
node_student -->|"verifies faces"| node_face
node_student -->|"registers voice"| node_voice
node_student -->|"reads and updates"| node_db
node_voice_dialog -->|"loads students"| node_db
node_voice_dialog -->|"analyzes audio"| node_voice
node_voice_dialog -->|"shows results"| node_results
node_face -->|"loads student data"| node_db
node_auto_enroll -->|"manages enrollment"| node_db
node_create_subject -->|"creates subject"| node_db
node_enroll -->|"manages enrollment"| node_db
node_share -->|"shares subject"| node_db
node_db -->|"loads client config"| node_db_config
node_db_config -->|"creates client"| node_supabase
node_db -->|"queries data"| node_supabase

click node_app "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/app.py"
click node_home "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/home_dashboard.py"
click node_layout "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/ui/base_layout.py"
click node_header "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/header.py"
click node_teacher "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/teacher_dashboard.py"
click node_student "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/student_dashboard.py"
click node_navigation "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/navigation.py"
click node_subject_card "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/subject_card.py"
click node_face "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/pipeline/face_pipeline.py"
click node_voice "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/pipeline/voice_pipeline.py"
click node_voice_dialog "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/dialog_voice_attendance.py"
click node_results "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/dialog_attendance_results.py"
click node_photo "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/dialog_add_photo.py"
click node_auto_enroll "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/auto_enroll_dialog.py"
click node_create_subject "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/dialog_create_subject.py"
click node_enroll "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/dialog_enroll.py"
click node_share "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/dialog_share_subject.py"
click node_db "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/database/db.py"
click node_db_config "https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/database/config.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_layout,node_header toneBlue
class node_teacher,node_student,node_navigation,node_subject_card,node_supabase toneAmber
class node_face,node_voice,node_voice_dialog,node_results,node_photo toneMint
class node_auto_enroll,node_create_subject,node_enroll,node_share toneRose
class node_db,node_db_config,node_user toneIndigo
```

## Components

### App entry and home

- [Streamlit entry](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/app.py): `app.py`
- [Role selection](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/home_dashboard.py): `src/screens/home_dashboard.py`
- [Shared layout styling](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/ui/base_layout.py): `src/screens/ui/base_layout.py`
- [Home header](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/header.py): `src/screens/components/header.py`

### Teacher and student portals

- [Teacher portal](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/teacher_dashboard.py): `src/screens/teacher_dashboard.py`
- [Student portal](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/student_dashboard.py): `src/screens/student_dashboard.py`
- [Dashboard navigation](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/navigation.py): `src/screens/components/navigation.py`
- [Subject card](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/subject_card.py): `src/screens/components/subject_card.py`

### Attendance recognition

- [Face attendance pipeline](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/pipeline/face_pipeline.py): `src/screens/pipeline/face_pipeline.py`
- [Voice attendance pipeline](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/pipeline/voice_pipeline.py): `src/screens/pipeline/voice_pipeline.py`
- [Voice attendance dialog](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/dialog_voice_attendance.py): `src/screens/components/dialog_voice_attendance.py`
- [Attendance results](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/dialog_attendance_results.py): `src/screens/components/dialog_attendance_results.py`
- [Add attendance photos](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/dialog_add_photo.py): `src/screens/components/dialog_add_photo.py`

### Class and enrollment tools

- [Join-code enrollment](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/auto_enroll_dialog.py): `src/screens/components/auto_enroll_dialog.py`
- [Create subject dialog](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/dialog_create_subject.py): `src/screens/components/dialog_create_subject.py`
- [Enroll dialog](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/dialog_enroll.py): `src/screens/components/dialog_enroll.py`
- [Share subject dialog](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/components/dialog_share_subject.py): `src/screens/components/dialog_share_subject.py`

### Persistence and configuration

- [Attendance and class data](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/database/db.py): `src/screens/database/db.py`
- [Supabase configuration](https://github.com/figureitoutshiv/snapclass-attendance/blob/main/src/screens/database/config.py): `src/screens/database/config.py`

### Other components

- **Teacher or student**
- **Supabase**

## Connections

- Teacher or student → Streamlit entry: opens
- Streamlit entry → Role selection: routes to (evidence: `app.py`)
- Streamlit entry → Teacher portal: routes to (evidence: `app.py`)
- Streamlit entry → Student portal: routes to (evidence: `app.py`)
- Streamlit entry → Shared layout styling: styles with (evidence: `app.py`)
- Streamlit entry → Join-code enrollment: opens (evidence: `app.py`)
- Role selection → Home header: renders (evidence: `src/screens/home_dashboard.py`)
- Role selection → Shared layout styling: styles with (evidence: `src/screens/home_dashboard.py`)
- Teacher portal → Dashboard navigation: renders (evidence: `src/screens/teacher_dashboard.py`)
- Student portal → Dashboard navigation: renders (evidence: `src/screens/student_dashboard.py`)
- Teacher portal → Subject card: renders (evidence: `src/screens/teacher_dashboard.py`)
- Student portal → Subject card: renders (evidence: `src/screens/student_dashboard.py`)
- Teacher portal → Shared layout styling: styles with (evidence: `src/screens/teacher_dashboard.py`)
- Teacher portal → Add attendance photos: opens (evidence: `src/screens/teacher_dashboard.py`)
- Teacher portal → Create subject dialog: opens (evidence: `src/screens/teacher_dashboard.py`)
- Teacher portal → Share subject dialog: opens (evidence: `src/screens/teacher_dashboard.py`)
- Teacher portal → Voice attendance dialog: opens (evidence: `src/screens/teacher_dashboard.py`)
- Teacher portal → Attendance results: uses (evidence: `src/screens/teacher_dashboard.py`)
- Teacher portal → Face attendance pipeline: analyzes photos (evidence: `src/screens/teacher_dashboard.py`)
- Teacher portal → Attendance and class data: reads and records (evidence: `src/screens/teacher_dashboard.py`)
- Student portal → Enroll dialog: opens (evidence: `src/screens/student_dashboard.py`)
- Student portal → Face attendance pipeline: verifies faces (evidence: `src/screens/student_dashboard.py`)
- Student portal → Voice attendance pipeline: registers voice (evidence: `src/screens/student_dashboard.py`)
- Student portal → Attendance and class data: reads and updates (evidence: `src/screens/student_dashboard.py`)
- Voice attendance dialog → Attendance and class data: loads students (evidence: `src/screens/components/dialog_voice_attendance.py`)
- Voice attendance dialog → Voice attendance pipeline: analyzes audio (evidence: `src/screens/components/dialog_voice_attendance.py`)
- Voice attendance dialog → Attendance results: shows results (evidence: `src/screens/components/dialog_voice_attendance.py`)
- Face attendance pipeline → Attendance and class data: loads student data (evidence: `src/screens/pipeline/face_pipeline.py`)
- Join-code enrollment → Attendance and class data: manages enrollment (evidence: `src/screens/components/auto_enroll_dialog.py`)
- Create subject dialog → Attendance and class data: creates subject (evidence: `src/screens/components/dialog_create_subject.py`)
- Enroll dialog → Attendance and class data: manages enrollment (evidence: `src/screens/components/dialog_enroll.py`)
- Share subject dialog → Attendance and class data: shares subject (evidence: `src/screens/components/dialog_share_subject.py`)
- Attendance and class data → Supabase configuration: loads client config (evidence: `src/screens/database/db.py`)
- Supabase configuration → Supabase: creates client (evidence: `src/screens/database/config.py`)
- Attendance and class data → Supabase: queries data (evidence: `src/screens/database/db.py`)
