A polished full-stack mess automation system built for student access, manager approval, and face-based authentication.
This repository combines:
- Face recognition login using Python + OpenCV
- React login interface with webcam capture
- Node.js bridge for image forwarding and authentication
- Mess management backend for student/manager workflows
The result is a unified system for student registration, manager approval, and secure mess access.
- Features
- Architecture
- Tech Stack
- Repository Structure
- Getting Started
- Configuration
- Run the Services
- Database Setup
- Default Credentials
- Workflow
- Important Notes
- Troubleshooting
- Face login via webcam capture
- Manual email/password login
- Student registration and manager approval
- Face profile storage and recognition
- Mess transactions, menu, feedback, polls, and announcements
- Email support for notifications
main.py— Python FastAPI service for face recognitionserver.js— Root Node.js bridge for face login and registrationMess_Management_Backend/— Full mess backend with Express, Sequelize, and PostgreSQLMess automation login page/— React + Vite frontend for login UI
- React captures webcam image
- Node/Mess backend sends image to Python face service
- Python compares face against stored gallery
- Backend authenticates and returns login response
- Backend: Node.js, Express, Sequelize
- Face AI: Python, FastAPI, OpenCV, NumPy
- Frontend: React, Vite, React Webcam
- Database: PostgreSQL
- Authentication: JWT, Bcrypt
- Mail: Nodemailer
/main.py— Face recognition API server/server.js— Root Node.js bridge/package.json— Root Node dependencies/requirments.txt— Python dependencies/Mess automation login page/— React frontend/Mess_Management_Backend/— Mess backend source code/TrainingImage/— Training images/TrainingImageLabel/— Training labels/dlib-19.22.99-cp310-cp310-win_amd64.whl— Windows dlib wheel
cd Final-codes
python3 -m venv venv
source venv/bin/activate
pip install -r requirments.txt
uvicorn main:app --host 0.0.0.0 --port 8000 --reloadcd Final-codes1
npm install
node server.jscd Final-codes1/Mess automation login page
npm install
npm run devcd Final-codes1/Mess_Management_Backend
npm install
npm run devCreate a .env file in Mess_Management_Backend/:
PORT=5000
DB_URL=postgres://USER:PASSWORD@HOST:PORT/DATABASE
JWT_SECRET=your_jwt_secret
EMAIL_USER=your_email@example.com
EMAIL_PASS=your_email_password
VITE_API_FACE=http://localhost:8000Create a PostgreSQL database named facereco and use this schema for the root bridge service:
CREATE TABLE students (
id SERIAL PRIMARY KEY,
face_id INTEGER UNIQUE NOT NULL,
name VARCHAR(100),
email VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
role VARCHAR(50) NOT NULL,
last_login TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);The seed script creates a default manager account:
email: manager@mess.com
password: abcd1234
Newly registered students must be approved by a manager before they can log in.
- React captures the webcam image
- Backend sends the image to Python
- Python identifies the face from the gallery
- Backend returns login status
- Student registration
- Manager approval
- Menu and transaction tracking
- Feedback and polls
- Face profile login support
- Run Python, frontend, and backend services in separate terminals
- Ensure PostgreSQL is running and
.envis configured - Avoid port conflicts:
5000is used by the mess backend by default - Only one app should access the webcam at a time
- Face login fails if Python service is down
- Database errors indicate
DB_URLor PostgreSQL access issues - Email failures indicate incorrect
EMAIL_USER/EMAIL_PASS
Mess automation login page/README.mdhas frontend-specific setup details- The face recognition logic lives in
main.py - The mess backend code lives in
Mess_Management_Backend/src/
Thanks for using this mess automation system!