Skip to content

kartikeyg0104/attendance

Repository files navigation

Face Recognition Attendance System 🎯

A production-ready web-based face recognition attendance system with React frontend and Flask backend.

πŸš€ Features

  • Modern Web Interface: React TypeScript with Material-UI components
  • Real-time Face Recognition: Live camera feed for attendance marking
  • Advanced Person Management: Add, manage, and view people in the system
  • Comprehensive Attendance Tracking: Filter, search, and download attendance records
  • Statistics Dashboard: Real-time analytics and reporting
  • Settings Panel: Live system monitoring and configuration
  • Production Ready: Docker support and deployment configurations

πŸ“ Project Structure

face-attendance-web/
β”œβ”€β”€ frontend/          # React TypeScript application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ AttendanceCapture.tsx   # Camera attendance marking
β”‚   β”‚   β”‚   β”œβ”€β”€ AddPerson.tsx          # Add new people
β”‚   β”‚   β”‚   β”œβ”€β”€ AttendanceView.tsx     # Advanced attendance viewing
β”‚   β”‚   β”‚   β”œβ”€β”€ Settings.tsx           # System configuration
β”‚   β”‚   β”‚   └── Reports.tsx            # Analytics and reporting
β”‚   β”‚   └── App.tsx
β”‚   β”œβ”€β”€ Dockerfile                     # Frontend container
β”‚   └── package.json
β”œβ”€β”€ backend/           # Flask Python API
β”‚   β”œβ”€β”€ app.py                        # Main application
β”‚   β”œβ”€β”€ requirements.txt              # Python dependencies
β”‚   β”œβ”€β”€ Dockerfile                    # Backend container
β”‚   └── .env.production              # Production config
β”œβ”€β”€ docker-compose.yml               # Full stack deployment
β”œβ”€β”€ DEPLOYMENT.md                    # Deployment guide
└── build-production.sh             # Build script

πŸ› οΈ Quick Start

Option 1: Docker (Recommended)

# Clone and run with Docker
git clone <your-repo-url>
cd face-attendance-web
docker-compose up --build

# Access the application
# Frontend: http://localhost:3000
# Backend: http://localhost:5002

Option 2: Manual Setup

Backend Setup

cd backend
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
python app.py

Frontend Setup

cd frontend
npm install
npm start

🎯 How to Use

1. Mark Attendance

  • Access the main attendance capture interface
  • Position face in camera view
  • System automatically recognizes and marks attendance
  • Real-time feedback and confirmation

2. Add New Person

  • Navigate to "Add Person" section
  • Enter person details
  • Capture multiple photos for better recognition
  • System trains model automatically

3. View Records & Analytics

  • Advanced filtering by person, date, confidence
  • Real-time statistics dashboard
  • Export to Excel with custom date ranges
  • Visual analytics and trends

4. System Management

  • Live system status monitoring
  • Configuration management
  • Face database statistics
  • Backup and restore functionality

πŸ”§ API Endpoints

Complete REST API with the following endpoints:

Core Operations

  • GET /api/health - System health check
  • POST /api/load-faces - Load and train face recognizer
  • GET /api/known-faces - Get registered people
  • POST /api/add-face - Register new person
  • POST /api/recognize-face - Face recognition
  • POST /api/mark-attendance - Mark attendance

Data Management

  • GET /api/attendance - Retrieve attendance records
  • GET /api/attendance/download - Export to Excel
  • GET /api/stats - System statistics
  • POST /api/backup - Create data backup

Configuration

  • GET /api/settings - Get system settings
  • POST /api/settings - Update configuration
  • GET /api/system-status - Real-time system status

🎨 Technologies Used

Frontend

  • React 18 with TypeScript
  • Material-UI v5 for modern components
  • React Router for navigation
  • Axios for API communication
  • React Webcam for camera integration

Backend

  • Flask 3.0 Python web framework
  • OpenCV 4.12 for computer vision
  • pandas for data processing
  • python-dotenv for configuration
  • ImageKit for cloud storage (optional)

DevOps

  • Docker & Docker Compose for containerization
  • Production-ready configurations
  • Environment-based configs
  • Health checks and monitoring

πŸš€ Deployment

Production Deployment

  1. Update environment variables in .env.production files
  2. Build for production:
    ./build-production.sh
  3. Deploy using Docker:
    docker-compose up -d --build

Platform-Specific Deployment

  • Heroku: Deploy backend and frontend separately
  • Railway/Render: Use provided Dockerfiles
  • AWS/GCP/Azure: Container deployment
  • Netlify/Vercel: Frontend static deployment

See DEPLOYMENT.md for detailed instructions.

πŸ“Š System Status

  • βœ… Production-ready Flask API backend
  • βœ… Modern React frontend with TypeScript
  • βœ… Face recognition with OpenCV
  • βœ… Real-time attendance marking
  • βœ… Advanced filtering and analytics
  • βœ… Export and reporting functionality
  • βœ… Docker containerization
  • βœ… Production deployment configs
  • βœ… Comprehensive error handling
  • βœ… CORS and security configurations

πŸ”’ Security & Privacy

  • Environment-based configuration
  • CORS protection
  • Local face data storage
  • Optional cloud storage integration
  • Production security settings

πŸ” Troubleshooting

Common Issues

  • Camera permissions: Grant browser camera access
  • Port conflicts: Ensure ports 3000 and 5002 are free
  • Docker issues: Check Docker daemon is running
  • Face recognition: Ensure good lighting conditions

Development

# Check backend logs
docker-compose logs backend

# Check frontend logs
docker-compose logs frontend

# Restart services
docker-compose restart

Your enterprise-ready face recognition system is live! πŸŽ‰

attendance

Releases

No releases published

Packages

 
 
 

Contributors