Automate attendance in seconds using multi-face AI detection, voice recognition, and instant QR enrollment.
Explore Live Web App β’ Landing Page β’ Database Schema β’ Quick Start
- Overview
- Key Features
- Repository Structure
- System Architecture
- Database Architecture
- Quick Start Guide
- Deployment Guide
- Tech Stack
- Contributing
- License
SnapClass is a full-stack, enterprise-ready AI attendance automation platform designed for modern schools, universities, and educational institutions. Traditional attendance wastes 10β15 minutes of every lecture. With SnapClass:
- Teachers take a quick wide-angle classroom photo or upload camera snapshots.
- The Deep Learning Face Recognition Engine detects and identifies all enrolled students simultaneously in milliseconds.
- Attendance is securely recorded in real-time in a cloud PostgreSQL database (Supabase) with instant analytics for teachers and students.
- π Secure Authentication: Fast signup & login with cryptographic password hashing.
- π Course & Subject Management: Create and manage classes, sections, and subject codes (
CS101,MATH201). - π Instant QR & Direct Link Sharing: Auto-generates dynamic high-res QR codes and instant join links (
?join-code=...) to enroll students on the fly. - πΈ Multi-Angle AI Photo Attendance: Capture live webcam snapshots or upload batch classroom photos. SnapClass detects all faces in the crowd and marks present students instantly.
- ποΈ Voice Recognition Attendance: Alternative voice-activated roll-call attendance processing.
- π Real-time Attendance Logs & Analytics: Filter, view, and export timestamped class records.
- π€ Biometric Face Profile Registration: Students upload/capture reference face photos to register their facial biometrics in the AI pipeline.
- β‘ 1-Click Class Enrollment: Enroll using 6-character subject codes or scan teacher-provided QR codes.
- π Personal Attendance Analytics: Track classes attended, missed lectures, and real-time attendance percentage per subject.
This repository is organized as a clean monorepo containing both the AI web application and the public landing page:
SnapClass/
βββ ai-attendance-project-app/ # π Core AI Attendance Web Application (Streamlit)
β βββ app.py # Main entrypoint & query parameter router
β βββ schema.sql # Supabase PostgreSQL DDL schema & RLS policies
β βββ requirements.txt # App dependencies (Streamlit, DeepFace, Supabase, etc.)
β βββ packages.txt # Linux OS dependencies for Streamlit Cloud (libgl1, etc.)
β βββ src/
β β βββ components/ # Reusable UI cards, dialogs & modals
β β β βββ dialog_add_photo.py # Webcam & file upload modal
β β β βββ dialog_attendance_results.py # Attendance confirmation modal
β β β βββ dialog_create_subject.py # New subject creation modal
β β β βββ dialog_enroll.py # Student subject enrollment dialog
β β β βββ dialog_share_subject.py # Dynamic QR code & share link modal
β β β βββ header.py / footer.py # Standardized headers and footers
β β β βββ subject_card.py # Subject overview card with live stats
β β βββ database/ # Supabase client & database CRUD queries
β β β βββ config.py # Supabase initialization with env keys
β β β βββ db.py # Teachers, Students, Attendance & Subject queries
β β βββ pipelines/ # Deep learning & audio processing pipelines
β β β βββ face_pipeline.py # DeepFace multi-face detection & cosine matching
β β β βββ voice_pipeline.py # Speech-to-text audio processing
β β βββ screens/ # Screen views
β β β βββ home_screen.py # Role selection portal (Teacher / Student)
β β β βββ teacher_screen.py # Teacher dashboard, attendance, & subject manager
β β β βββ student_screen.py # Student dashboard & class enrollment
β β βββ ui/ # Design system & custom CSS stylesheets
β β βββ base_layout.py # High-contrast glassmorphic styling & themes
β βββ README.md # Application-specific documentation
β
βββ ai-attendance-project-landing/ # π Public Marketing & Product Landing Page (Flask)
β βββ app.py # Flask server routing to templates
β βββ vercel.json # Vercel deployment & WSGI configuration
β βββ requirements.txt # Flask, Gunicorn & Python-dotenv
β βββ templates/
β β βββ index.html # Modern SaaS landing page with SVG vectors & animations
β βββ static/
β β βββ css/style.css # Glassmorphism, animations, responsive navbar & cards
β β βββ js/script.js # Animated mobile hamburger menu & smooth scrolling
β β βββ assets/ # Vector SVGs, icons, and illustrations
β βββ README.md # Landing page documentation & Vercel deployment guide
β
βββ README.md # Monorepo Master Documentation (This file)
graph TD
User["Teacher or Student"] --> LP["Landing Page (Flask on Vercel)"]
LP -->|"CTA Click"| App["AI Attendance App (Streamlit Cloud)"]
subgraph "Streamlit Application"
App --> Home["Role Router"]
Home -->|"Teacher Login"| TD["Teacher Dashboard"]
Home -->|"Student Login"| SD["Student Dashboard"]
TD --> AI_Photo["Face Recognition Pipeline"]
TD --> AI_Voice["Voice Recognition Pipeline"]
TD --> Subj["Subject & QR Manager"]
SD --> Enroll["1-Click QR Enrollment"]
SD --> Stats["Personal Attendance Tracking"]
end
subgraph "AI Engine"
AI_Photo --> DF["DeepFace Engine / OpenCV"]
DF --> Match["Cosine Similarity Embedding Matcher"]
end
subgraph "Cloud Backend"
App <--> DB[("Supabase PostgreSQL Database")]
DB --- T_Table[("public.teachers")]
DB --- S_Table[("public.students")]
DB --- Sub_Table[("public.subjects")]
DB --- Att_Table[("public.attendance_logs")]
end
SnapClass uses Supabase (PostgreSQL). All table definitions and relationships are managed via schema.sql:
-- Teachers Table
CREATE TABLE public.teachers (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL,
name TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Students Table
CREATE TABLE public.students (
student_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name TEXT NOT NULL,
roll_no TEXT UNIQUE NOT NULL,
face_encoding JSONB,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Subjects Table
CREATE TABLE public.subjects (
subject_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
subject_code TEXT UNIQUE NOT NULL,
name TEXT NOT NULL,
section TEXT NOT NULL,
teacher_id UUID REFERENCES public.teachers(id) ON DELETE CASCADE,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Subject Enrollment Mapping
CREATE TABLE public.subject_students (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
subject_id UUID REFERENCES public.subjects(subject_id) ON DELETE CASCADE,
student_id UUID REFERENCES public.students(student_id) ON DELETE CASCADE,
enrolled_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
UNIQUE(subject_id, student_id)
);
-- Attendance Logs
CREATE TABLE public.attendance_logs (
log_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
subject_id UUID REFERENCES public.subjects(subject_id) ON DELETE CASCADE,
student_id UUID REFERENCES public.students(student_id) ON DELETE CASCADE,
timestamp TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
status TEXT DEFAULT 'present',
confidence FLOAT
);- Python 3.11 installed (
py -3.11 --versionorpython3.11 --version) - Git installed
- A free Supabase project
Create a .env file in ai-attendance-project-app/.env:
SUPABASE_URL=https://your-project-id.supabase.co
SUPABASE_KEY=your-supabase-publishable-key# Navigate to the app directory
cd ai-attendance-project-app
# Create virtual environment (Python 3.11 recommended)
py -3.11 -m venv venv
# Activate virtual environment
# On Windows:
.\venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Start the Streamlit application
streamlit run app.pyOpen http://localhost:8501 in your browser!
# Navigate to landing page directory
cd ai-attendance-project-landing
# Create virtual environment
python -m venv venv
.\venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start the Flask development server
python app.pyOpen http://localhost:5002 in your browser!
- Push your monorepo to GitHub.
- Go to share.streamlit.io and log in.
- Click "Create App" and configure:
- Repository:
YourUsername/SnapClass - Branch:
main - Main file path:
ai-attendance-project-app/app.py
- Repository:
- Click Advanced Settings -> Secrets and paste:
SUPABASE_URL = "https://your-id.supabase.co" SUPABASE_KEY = "sb_publishable_..."
- Click Deploy!
- Log in to vercel.com.
- Click "Add New..." β "Project" β Import
YourUsername/SnapClass. - Under Root Directory, click Edit and choose: π
ai-attendance-project-landing. - Under Environment Variables, add:
STREAMLIT_APP_URL=https://your-streamlit-app-url.streamlit.app/
- Click Deploy!
| Domain | Technology |
|---|---|
| Frontend & App Framework | Streamlit (Dashboard), Flask + HTML5/CSS3/JS (Landing) |
| AI / Biometrics Engine | DeepFace (Facial Embeddings & Verification), OpenCV |
| Database & Auth | Supabase (PostgreSQL Database & Row Level Security) |
| QR Code Generation | Segno |
| Styling & Design | Modern Glassmorphism, Google Fonts (Outfit, Climate Crisis), Vector SVGs |
| Deployment & Hosting | Streamlit Community Cloud & Vercel |
Contributions, issues, and feature requests are welcome!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.