# princy0605/snapclass-intelligent-ai-attendance-system architecture

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

- Interactive diagram: https://gitdiagram.com/princy0605/snapclass-intelligent-ai-attendance-system
- Repository: https://github.com/princy0605/snapclass-intelligent-ai-attendance-system

## Overview

SnapClass is a Streamlit attendance-management app whose main workflow runs from teacher sign-in and subject selection through classroom photo or voice analysis, review, and saving attendance. Students can register with facial data, enroll in subjects, and view attendance. The README also documents subject sharing/enrollment, teacher dashboards, and attendance history. The graph follows the sampled screen and pipeline calls; some documented features live in unsampled components, so their internal relationships are not expanded. Supabase is the documented cloud store and appears in the database configuration.

Main entry points: [`src/screens/teacher_screen.py`](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/screens/teacher_screen.py) (Teacher dashboard), [`src/screens/student_screen.py`](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/screens/student_screen.py) (Student screen), [`app.py`](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/app.py) (Streamlit entry), [`src/database/db.py`](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/database/db.py) (Database operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App entry and screens"]
  node_app_entry["Streamlit entry<br/>[app.py]"]
  node_home["Home screen<br/>[home_screen.py]"]
  node_landing["Landing page<br/>[app.py]"]
end

subgraph group_teacher["Teacher workflows"]
  node_teacher_screen["Teacher dashboard<br/>[teacher_screen.py]"]
  node_create_subject["Create subject"]
  node_share_subject["Share subject"]
  node_add_photo["Add attendance photos"]
  node_voice_attendance["Voice attendance"]
  node_attendance_results["Review attendance"]
end

subgraph group_student["Student workflows"]
  node_student_screen["Student screen<br/>[student_screen.py]"]
  node_auto_enroll["Auto enrollment"]
  node_enroll["Student enrollment<br/>[dialog_enroll.py]"]
end

subgraph group_recognition["Recognition pipelines"]
  node_face_pipeline["Face recognition<br/>[face_pipeline.py]"]
  node_voice_pipeline["Voice recognition<br/>[voice_pipeline.py]"]
end

subgraph group_data_ui["Data and shared UI"]
  node_database["Database operations<br/>[db.py]"]
  node_db_config["Supabase configuration<br/>[config.py]"]
  node_base_layout["Base layout<br/>[base_layout.py]"]
  node_header["Header<br/>[header.py]"]
  node_footer["Footer<br/>[footer.py]"]
  node_subject_card["Subject card<br/>[subject_card.py]"]
end

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

node_visitor -->|"uses"| node_app_entry
node_app_entry -->|"routes to"| node_home
node_app_entry -->|"routes to"| node_teacher_screen
node_app_entry -->|"routes to"| node_student_screen
node_app_entry -->|"opens"| node_auto_enroll
node_teacher_screen -->|"reads and writes"| node_database
node_teacher_screen -->|"analyzes photos"| node_face_pipeline
node_teacher_screen -->|"opens"| node_create_subject
node_teacher_screen -->|"opens"| node_share_subject
node_teacher_screen -->|"opens"| node_add_photo
node_teacher_screen -->|"opens"| node_voice_attendance
node_teacher_screen -->|"shows results"| node_attendance_results
node_voice_attendance -->|"analyzes audio"| node_voice_pipeline
node_voice_attendance -->|"shows results"| node_attendance_results
node_attendance_results -->|"saves records"| node_database
node_student_screen -->|"recognizes face"| node_face_pipeline
node_student_screen -->|"creates voice profile"| node_voice_pipeline
node_student_screen -->|"reads and writes"| node_database
node_student_screen -->|"opens"| node_enroll
node_student_screen -->|"opens"| node_share_subject
node_student_screen -->|"renders"| node_subject_card
node_face_pipeline -->|"loads students"| node_database
node_database -->|"uses client"| node_db_config
node_db_config -->|"configures"| node_supabase
node_home -->|"uses styling"| node_base_layout
node_home -->|"renders"| node_header
node_home -->|"renders"| node_footer
node_teacher_screen -->|"uses styling"| node_base_layout
node_teacher_screen -->|"renders"| node_header
node_teacher_screen -->|"renders"| node_footer
node_teacher_screen -->|"renders"| node_subject_card
node_student_screen -->|"uses styling"| node_base_layout
node_student_screen -->|"renders"| node_header
node_student_screen -->|"renders"| node_footer
node_visitor -->|"visits"| node_landing

click node_app_entry "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/app.py"
click node_home "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/screens/home_screen.py"
click node_teacher_screen "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/screens/teacher_screen.py"
click node_student_screen "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/screens/student_screen.py"
click node_auto_enroll "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_auto_enroll.py"
click node_create_subject "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_create_subject.py"
click node_share_subject "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_share_subject.py"
click node_add_photo "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_add_photo.py"
click node_voice_attendance "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_voice_attendance.py"
click node_attendance_results "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_attendance_results.py"
click node_enroll "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_enroll.py"
click node_face_pipeline "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/pipelines/face_pipeline.py"
click node_voice_pipeline "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/pipelines/voice_pipeline.py"
click node_database "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/database/db.py"
click node_db_config "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/database/config.py"
click node_base_layout "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/ui/base_layout.py"
click node_header "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/header.py"
click node_footer "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/footer.py"
click node_subject_card "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/subject_card.py"
click node_landing "https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/Landing_Page/app.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_entry,node_home,node_landing,node_visitor toneBlue
class node_teacher_screen,node_create_subject,node_share_subject,node_add_photo,node_voice_attendance,node_attendance_results,node_supabase toneAmber
class node_student_screen,node_auto_enroll,node_enroll toneMint
class node_face_pipeline,node_voice_pipeline toneRose
class node_database,node_db_config,node_base_layout,node_header,node_footer,node_subject_card toneIndigo
```

## Components

### App entry and screens

- [Streamlit entry](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/app.py): `app.py`
- [Home screen](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/screens/home_screen.py): `src/screens/home_screen.py`
- [Landing page](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/Landing_Page/app.py): `Landing_Page/app.py`

### Teacher workflows

- [Teacher dashboard](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/screens/teacher_screen.py): `src/screens/teacher_screen.py`
- [Create subject](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_create_subject.py): `src/components/dialog_create_subject.py`
- [Share subject](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_share_subject.py): `src/components/dialog_share_subject.py`
- [Add attendance photos](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_add_photo.py): `src/components/dialog_add_photo.py`
- [Voice attendance](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_voice_attendance.py): `src/components/dialog_voice_attendance.py`
- [Review attendance](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_attendance_results.py): `src/components/dialog_attendance_results.py`

### Student workflows

- [Student screen](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/screens/student_screen.py): `src/screens/student_screen.py`
- [Auto enrollment](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_auto_enroll.py): `src/components/dialog_auto_enroll.py`
- [Student enrollment](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/dialog_enroll.py): `src/components/dialog_enroll.py`

### Recognition pipelines

- [Face recognition](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/pipelines/face_pipeline.py): `src/pipelines/face_pipeline.py`
- [Voice recognition](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/pipelines/voice_pipeline.py): `src/pipelines/voice_pipeline.py`

### Data and shared UI

- [Database operations](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/database/db.py): `src/database/db.py`
- [Supabase configuration](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/database/config.py): `src/database/config.py`
- [Base layout](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/ui/base_layout.py): `src/ui/base_layout.py`
- [Header](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/header.py): `src/components/header.py`
- [Footer](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/footer.py): `src/components/footer.py`
- [Subject card](https://github.com/princy0605/snapclass-intelligent-ai-attendance-system/blob/main/src/components/subject_card.py): `src/components/subject_card.py`

### Other components

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

## Connections

- User → Streamlit entry: uses (evidence: `README.md`)
- Streamlit entry → Home screen: routes to (evidence: `app.py`)
- Streamlit entry → Teacher dashboard: routes to (evidence: `app.py`)
- Streamlit entry → Student screen: routes to (evidence: `app.py`)
- Streamlit entry → Auto enrollment: opens (evidence: `app.py`)
- Teacher dashboard → Database operations: reads and writes (evidence: `src/screens/teacher_screen.py`)
- Teacher dashboard → Face recognition: analyzes photos (evidence: `src/screens/teacher_screen.py`)
- Teacher dashboard → Create subject: opens (evidence: `src/screens/teacher_screen.py`)
- Teacher dashboard → Share subject: opens (evidence: `src/screens/teacher_screen.py`)
- Teacher dashboard → Add attendance photos: opens (evidence: `src/screens/teacher_screen.py`)
- Teacher dashboard → Voice attendance: opens (evidence: `src/screens/teacher_screen.py`)
- Teacher dashboard → Review attendance: shows results (evidence: `src/screens/teacher_screen.py`)
- Voice attendance → Voice recognition: analyzes audio (evidence: `src/components/dialog_voice_attendance.py`)
- Voice attendance → Review attendance: shows results (evidence: `src/components/dialog_voice_attendance.py`)
- Review attendance → Database operations: saves records (evidence: `src/components/dialog_attendance_results.py`)
- Student screen → Face recognition: recognizes face (evidence: `src/screens/student_screen.py`)
- Student screen → Voice recognition: creates voice profile (evidence: `src/screens/student_screen.py`)
- Student screen → Database operations: reads and writes (evidence: `src/screens/student_screen.py`)
- Student screen → Student enrollment: opens (evidence: `src/screens/student_screen.py`)
- Student screen → Share subject: opens (evidence: `src/screens/student_screen.py`)
- Student screen → Subject card: renders (evidence: `src/screens/student_screen.py`)
- Face recognition → Database operations: loads students (evidence: `src/pipelines/face_pipeline.py`)
- Database operations → Supabase configuration: uses client (evidence: `src/database/db.py`)
- Supabase configuration → Supabase: configures (evidence: `src/database/config.py`)
- Home screen → Base layout: uses styling (evidence: `src/screens/home_screen.py`)
- Home screen → Header: renders (evidence: `src/screens/home_screen.py`)
- Home screen → Footer: renders (evidence: `src/screens/home_screen.py`)
- Teacher dashboard → Base layout: uses styling (evidence: `src/screens/teacher_screen.py`)
- Teacher dashboard → Header: renders (evidence: `src/screens/teacher_screen.py`)
- Teacher dashboard → Footer: renders (evidence: `src/screens/teacher_screen.py`)
- Teacher dashboard → Subject card: renders (evidence: `src/screens/teacher_screen.py`)
- Student screen → Base layout: uses styling (evidence: `src/screens/student_screen.py`)
- Student screen → Header: renders (evidence: `src/screens/student_screen.py`)
- Student screen → Footer: renders (evidence: `src/screens/student_screen.py`)
- User → Landing page: visits (evidence: `README.md`)
