π Smart Attendance System
A modern, AI-powered attendance management web app built with React 19, TypeScript & Google Gemini
Capture. Verify. Track. β All in one elegant interface.
β¨ Features β’ π Quick Start β’ π οΈ Tech Stack β’ π Project Structure β’ π§ How It Works β’ π¨βπ» Author
π Overview
Smart Attendance System is a sleek, lightweight, and intelligent web application that streamlines the way attendance is recorded and managed. Built with React 19, TypeScript, and powered by Google Gemini AI, it lets students self-register with a live webcam photo, mark their attendance in seconds, and gives administrators a beautiful dashboard to review records β all without a heavy backend.
π― Perfect for classrooms, workshops, events, small offices, and any setting that needs fast, friendly attendance tracking.
β¨ Features
| πΈ Live Webcam Capture | Snap student photos directly from the browser using the MediaDevices API. |
| π€ AI-Powered Image Verification | Google Gemini analyzes captured images to confirm a real person is present. |
| π¨βπ Student Self-Registration | One-click registration with name + photo β no complex forms. |
| β One-Tap Attendance | Mark presence instantly, with automatic timestamping. |
| π‘οΈ Admin Dashboard | View all registered students and a full chronological attendance log. |
| πΎ Offline-First Storage | All data persists locally via localStorage β no server required. |
| π¨ Modern Dark UI | Crafted with Tailwind CSS β responsive, smooth, and easy on the eyes. |
| β‘ Blazing Fast | Powered by Vite for near-instant hot reload and lightning-fast builds. |
π οΈ Tech Stack
| Layer | Technology |
|---|---|
| Frontend Framework | React 19 |
| Language | TypeScript 5.8 |
| Build Tool | Vite 6 |
| Styling | Tailwind CSS |
| AI / ML | Google Gemini API (@google/genai) |
| Storage | Browser localStorage (custom useLocalStorage hook) |
| Camera Access | Web MediaDevices.getUserMedia API |
π Quick Start
Prerequisites
- π¦ Node.js
>= 18 - π A free Google Gemini API key
- π· A device with a camera (for student registration)
Installation
# 1. Clone the repository
git clone https://github.com/V1shal-dev/smart-attendance-system.git
cd smart-attendance-system
# 2. Install dependencies
npm install
# 3. Create a .env.local file and add your Gemini API key
echo "GEMINI_API_KEY=your_api_key_here" > .env.local
# 4. Start the development server
npm run dev
π Open http://localhost:3000 β and you're live!
Available Scripts
| Command | Description |
|---|---|
npm run dev |
Start the local dev server with hot reload |
npm run build |
Build an optimized production bundle |
npm run preview |
Preview the production build locally |
π Project Structure
smart-attendance-system/
βββ π App.tsx # Root component & app state
βββ π index.tsx # React entry point
βββ π index.html # HTML shell + Tailwind CDN
βββ π types.ts # Shared TypeScript interfaces
βββ π vite.config.ts # Vite configuration
β
βββ π components/
β βββ Header.tsx # Top nav + Student/Admin mode switch
β βββ StudentView.tsx # Registration & attendance form
β βββ AdminView.tsx # Dashboard with logs
β βββ CameraModal.tsx # Webcam capture modal
β βββ icons.tsx # Reusable SVG icon set
β
βββ π hooks/
β βββ useLocalStorage.ts # Persistent state hook
β
βββ π services/
β βββ geminiService.ts # Google Gemini API integration
β
βββ π .env.example # Example environment variables
βββ π package.json
βββ π README.md
π§ How It Works
flowchart LR
A[π€ Student] -->|Opens app| B[Student View]
B -->|Capture Photo| C[πΈ Camera Modal]
C -->|Base64 image| D{π€ Gemini AI<br/>Image Analysis}
D -->|Person detected| E[β
Register Student]
D -->|No person| F[β Retake]
E -->|Saved to localStorage| G[(πΎ Local DB)]
B -->|Mark Attendance| H[π Attendance Record]
H --> G
G --> I[π‘οΈ Admin View]
I -->|Renders| J[π Dashboard<br/>Students + Logs]
Two Modes β One App
-
π§βπ Student Mode
- Register with a name + a live webcam photo
- Mark Attendance by selecting your name from the list
- Get instant visual feedback (success/error)
-
π‘οΈ Admin Mode
- View all registered students with photos
- Browse a chronological attendance log with timestamps
- Clear all data with one click (with confirmation)
π Environment Variables
Create a .env.local file in the root of the project:
GEMINI_API_KEY=your_google_gemini_api_key_here
π Get your free API key from Google AI Studio.
πΈ Screenshots
Add your own screenshots here once deployed!
| Student Registration | Mark Attendance | Admin Dashboard |
|---|---|---|
| coming soon | coming soon | coming soon |
π Roadmap
- π§ Face recognition matching (Gemini-powered identity verification)
- βοΈ Cloud sync with Firebase / Supabase
- π Attendance analytics & exportable reports (CSV / PDF)
- π± Progressive Web App (PWA) support β installable & offline
- π Multi-class / multi-organization support
- π Email/SMS attendance notifications
- π Internationalization (i18n)
π€ Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
- 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
π License
This project is licensed under the MIT License β see the LICENSE file for details.
π¨βπ» Author
β Show Your Support
If you found this project useful, please consider giving it a β star on GitHub β it really helps!