# shravan12092005/snapclass architecture

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

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

## Overview

SnapClass is a Streamlit attendance system: teachers manage courses and review face- or voice-detected attendance, while students register or authenticate by face and view course attendance. The app routes into role-specific screens; those screens coordinate biometric pipelines, dialogs, and database operations. The README documents additional course-sharing, enrollment, roster, and reporting capabilities whose implementation details were not sampled. Edges for those features are documented rather than inferred from unsampled source.

Main entry points: [`src/screens/teacher_screen.py`](https://github.com/shravan12092005/snapclass/blob/master/src/screens/teacher_screen.py) (Teacher portal), [`src/screens/student_screen.py`](https://github.com/shravan12092005/snapclass/blob/master/src/screens/student_screen.py) (Student portal), [`src/database/db.py`](https://github.com/shravan12092005/snapclass/blob/master/src/database/db.py) (Attendance data operations), [`app.py`](https://github.com/shravan12092005/snapclass/blob/master/app.py) (App routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and portals"]
  node_app["App routing<br/>[app.py]"]
  node_home["Home portal<br/>[home_screen.py]"]
  node_student["Student portal<br/>[student_screen.py]"]
  node_teacher["Teacher portal<br/>[teacher_screen.py]"]
  node_layout["Shared layout<br/>[base_layout.py]"]
end

subgraph group_course["Courses and attendance"]
  node_course_dialogs["Course dialogs"]
  node_enrollment["Enrollment dialogs<br/>[dialog_enroll.py]"]
  node_sharing["Course sharing"]
  node_photo_dialog["Photo attendance input"]
  node_voice_dialog["Voice attendance input"]
  node_review["Attendance review"]
  node_subject_card["Course summaries<br/>[subject_card.py]"]
end

subgraph group_biometrics["Biometric processing"]
  node_face["Face recognition<br/>[face_pipeline.py]"]
  node_voice["Voice recognition<br/>[voice_pipeline.py]"]
end

subgraph group_data["Data access"]
  node_db["Attendance data operations<br/>[db.py]"]
  node_config["Supabase client<br/>[config.py]"]
  node_supabase[("Supabase database")]
  node_logger["Application logging<br/>[logger.py]"]
end

node_user(("Teacher or student"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_student
node_app -->|"routes to"| node_teacher
node_home -->|"styles with"| node_layout
node_student -->|"styles with"| node_layout
node_teacher -->|"styles with"| node_layout
node_student -->|"authenticates with"| node_face
node_student -->|"registers voice with"| node_voice
node_teacher -->|"scans with"| node_face
node_teacher -->|"opens"| node_photo_dialog
node_teacher -->|"opens"| node_voice_dialog
node_teacher -->|"manages courses with"| node_course_dialogs
node_teacher -->|"shares courses with"| node_sharing
node_teacher -->|"renders"| node_subject_card
node_student -->|"opens"| node_enrollment
node_student -->|"renders"| node_subject_card
node_student -->|"reads and updates"| node_db
node_teacher -->|"reads and updates"| node_db
node_face -->|"loads student profiles"| node_db
node_voice_dialog -->|"analyzes audio with"| node_voice
node_voice_dialog -->|"passes results to"| node_review
node_photo_dialog -.->|"reviews detection"| node_review
node_review -->|"saves attendance"| node_db
node_db -->|"uses client"| node_config
node_voice_dialog -->|"queries enrollment"| node_config
node_config -->|"connects to"| node_supabase
node_db -->|"logs errors"| node_logger
node_teacher -.->|"inspects roster"| node_enrollment
node_teacher -->|"views records and statistics"| node_db
node_student -->|"views attendance history"| node_db

click node_app "https://github.com/shravan12092005/snapclass/blob/master/app.py"
click node_home "https://github.com/shravan12092005/snapclass/blob/master/src/screens/home_screen.py"
click node_student "https://github.com/shravan12092005/snapclass/blob/master/src/screens/student_screen.py"
click node_teacher "https://github.com/shravan12092005/snapclass/blob/master/src/screens/teacher_screen.py"
click node_layout "https://github.com/shravan12092005/snapclass/blob/master/src/ui/base_layout.py"
click node_course_dialogs "https://github.com/shravan12092005/snapclass/tree/master/src/components"
click node_enrollment "https://github.com/shravan12092005/snapclass/blob/master/src/components/dialog_enroll.py"
click node_sharing "https://github.com/shravan12092005/snapclass/blob/master/src/components/dialog_share_subject.py"
click node_photo_dialog "https://github.com/shravan12092005/snapclass/blob/master/src/components/dialog_add_photo.py"
click node_voice_dialog "https://github.com/shravan12092005/snapclass/blob/master/src/components/dialog_voice_attendance.py"
click node_review "https://github.com/shravan12092005/snapclass/blob/master/src/components/dialog_attendance_results.py"
click node_subject_card "https://github.com/shravan12092005/snapclass/blob/master/src/components/subject_card.py"
click node_face "https://github.com/shravan12092005/snapclass/blob/master/src/pipelines/face_pipeline.py"
click node_voice "https://github.com/shravan12092005/snapclass/blob/master/src/pipelines/voice_pipeline.py"
click node_db "https://github.com/shravan12092005/snapclass/blob/master/src/database/db.py"
click node_config "https://github.com/shravan12092005/snapclass/blob/master/src/database/config.py"
click node_logger "https://github.com/shravan12092005/snapclass/blob/master/src/utils/logger.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_student,node_teacher,node_layout toneBlue
class node_course_dialogs,node_enrollment,node_sharing,node_photo_dialog,node_voice_dialog,node_review,node_subject_card toneAmber
class node_face,node_voice toneMint
class node_db,node_config,node_supabase,node_logger toneRose
class node_user toneIndigo
```

## Components

### App and portals

- [App routing](https://github.com/shravan12092005/snapclass/blob/master/app.py): `app.py`
- [Home portal](https://github.com/shravan12092005/snapclass/blob/master/src/screens/home_screen.py): `src/screens/home_screen.py`
- [Student portal](https://github.com/shravan12092005/snapclass/blob/master/src/screens/student_screen.py): `src/screens/student_screen.py`
- [Teacher portal](https://github.com/shravan12092005/snapclass/blob/master/src/screens/teacher_screen.py): `src/screens/teacher_screen.py`
- [Shared layout](https://github.com/shravan12092005/snapclass/blob/master/src/ui/base_layout.py): `src/ui/base_layout.py`

### Courses and attendance

- [Course dialogs](https://github.com/shravan12092005/snapclass/tree/master/src/components): `src/components`
- [Enrollment dialogs](https://github.com/shravan12092005/snapclass/blob/master/src/components/dialog_enroll.py): `src/components/dialog_enroll.py`
- [Course sharing](https://github.com/shravan12092005/snapclass/blob/master/src/components/dialog_share_subject.py): `src/components/dialog_share_subject.py`
- [Photo attendance input](https://github.com/shravan12092005/snapclass/blob/master/src/components/dialog_add_photo.py): `src/components/dialog_add_photo.py`
- [Voice attendance input](https://github.com/shravan12092005/snapclass/blob/master/src/components/dialog_voice_attendance.py): `src/components/dialog_voice_attendance.py`
- [Attendance review](https://github.com/shravan12092005/snapclass/blob/master/src/components/dialog_attendance_results.py): `src/components/dialog_attendance_results.py`
- [Course summaries](https://github.com/shravan12092005/snapclass/blob/master/src/components/subject_card.py): `src/components/subject_card.py`

### Biometric processing

- [Face recognition](https://github.com/shravan12092005/snapclass/blob/master/src/pipelines/face_pipeline.py): `src/pipelines/face_pipeline.py`
- [Voice recognition](https://github.com/shravan12092005/snapclass/blob/master/src/pipelines/voice_pipeline.py): `src/pipelines/voice_pipeline.py`

### Data access

- [Attendance data operations](https://github.com/shravan12092005/snapclass/blob/master/src/database/db.py): `src/database/db.py`
- [Supabase client](https://github.com/shravan12092005/snapclass/blob/master/src/database/config.py): `src/database/config.py`
- **Supabase database**
- [Application logging](https://github.com/shravan12092005/snapclass/blob/master/src/utils/logger.py): `src/utils/logger.py`

### Other components

- **Teacher or student**

## Connections

- Teacher or student → App routing: opens (evidence: `README.md`)
- App routing → Home portal: routes to (evidence: `app.py`)
- App routing → Student portal: routes to (evidence: `app.py`)
- App routing → Teacher portal: routes to (evidence: `app.py`)
- Home portal → Shared layout: styles with (evidence: `src/screens/home_screen.py`)
- Student portal → Shared layout: styles with (evidence: `src/screens/student_screen.py`)
- Teacher portal → Shared layout: styles with (evidence: `src/screens/teacher_screen.py`)
- Student portal → Face recognition: authenticates with (evidence: `src/screens/student_screen.py`)
- Student portal → Voice recognition: registers voice with (evidence: `src/screens/student_screen.py`)
- Teacher portal → Face recognition: scans with (evidence: `src/screens/teacher_screen.py`)
- Teacher portal → Photo attendance input: opens (evidence: `src/screens/teacher_screen.py`)
- Teacher portal → Voice attendance input: opens (evidence: `src/screens/teacher_screen.py`)
- Teacher portal → Course dialogs: manages courses with (evidence: `src/screens/teacher_screen.py`)
- Teacher portal → Course sharing: shares courses with (evidence: `src/screens/teacher_screen.py`)
- Teacher portal → Course summaries: renders (evidence: `src/screens/teacher_screen.py`)
- Student portal → Enrollment dialogs: opens (evidence: `src/screens/student_screen.py`)
- Student portal → Course summaries: renders (evidence: `src/screens/student_screen.py`)
- Student portal → Attendance data operations: reads and updates (evidence: `src/screens/student_screen.py`)
- Teacher portal → Attendance data operations: reads and updates (evidence: `src/screens/teacher_screen.py`)
- Face recognition → Attendance data operations: loads student profiles (evidence: `src/pipelines/face_pipeline.py`)
- Voice attendance input → Voice recognition: analyzes audio with (evidence: `src/components/dialog_voice_attendance.py`)
- Voice attendance input → Attendance review: passes results to (evidence: `src/components/dialog_voice_attendance.py`)
- Photo attendance input → Attendance review: reviews detection
- Attendance review → Attendance data operations: saves attendance (evidence: `src/components/dialog_attendance_results.py`)
- Attendance data operations → Supabase client: uses client (evidence: `src/database/db.py`)
- Voice attendance input → Supabase client: queries enrollment (evidence: `src/components/dialog_voice_attendance.py`)
- Supabase client → Supabase database: connects to (evidence: `src/database/config.py`)
- Attendance data operations → Application logging: logs errors (evidence: `src/database/db.py`)
- Teacher portal → Enrollment dialogs: inspects roster (evidence: `README.md`)
- Teacher portal → Attendance data operations: views records and statistics (evidence: `README.md`)
- Student portal → Attendance data operations: views attendance history (evidence: `README.md`)
