Dorm Pass Manager is a Flask-based web application for managing student dorm passes, approvals, and KIOSK/mobile sign-ins. It provides role-based access (admin / proctor / approver), student and user management, location handling, and optional face/ID verification features for KIOSK mode.
- Pass creation, multi-stage approval, and elapsed-time warnings.
- Role-based access control (numeric roles: 1 = admin, 2 = proctor, 3 = approver).
- KIOSK mode with PIN and optional face verification flows.
- User and student management (add / edit / delete).
- Location / destination management.
- Real-time updates via Socket.IO.
- Configurable settings via
config.json.
- Python + Flask
- Flask-SocketIO
- Vanilla JavaScript for front-end logic (
templates/andstatic/js/) - MySQL for persistent storage (accessed via
models/wrappers) - DeepFace / face_recognition (optional) for face compare
- Pillow / OpenCV for image processing
- Python 3.10+ (recommended)
- MySQL server (or remote MySQL DB)
python3,pip- (Optional for production)
gunicornandeventlet/gevent
- Clone the repo and change into it:
git clone <repo-url>
cd Dorm-Pass-Manager- Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Configure
config.json:
- Ensure
config.jsoncontains the correct MySQL connection, SMTP (if used), session and captcha settings, and campus metadata.
- Run the app (development):
python app.pyNote: app.py defaults to socketio.run(app, port=80, host="0.0.0.0", debug=...). Running on port 80 requires elevated privileges; for local development consider changing the port to 5000 or running with sudo (not recommended).
- Production-style run (Socket.IO-compatible):
Install eventlet:
pip install eventletRun with Gunicorn (example):
gunicorn -k eventlet -w 1 wsgi:appUse a reverse proxy (Nginx) in front of Gunicorn for TLS/port 80/443 management in production.
app.py— main Flask app and API routes (entrypoint usessocketio.run).wsgi.py— WSGI wrapper for server deployments.models/— DB access and helper modules.templates/— HTML templates for pages and admin panels.static/— JS, CSS, and face model assets.config.json— application configuration.requirements.txt— Python dependencies.
- Edit
config.jsonto set the database credentials, session options, captcha settings, SMTP credentials, and campus information.
- Port 80 permission errors: run using a non-privileged port or use a reverse proxy.
- Database connection errors: verify values in
config.jsonand that MySQL is reachable. - Missing Python packages: activate the virtualenv and run
pip install -r requirements.txt. - Socket.IO issues: use an
eventletorgeventworker in production. - Face recognition: native dependencies like OpenCV/dlib may require platform-specific installation; consider Docker for consistent environments.
- Use a virtualenv and keep
requirements.txtup to date. - Add a
config.sample.jsonwith placeholders to help onboarding. - Consider adding Docker/Docker Compose for reproducible development and CI.
- Add DB migrations / seed scripts for easy setup.
- Provide a sample
config.sample.jsonand example data. - Add automated tests and CI workflow.
- Add a
Dockerfileanddocker-compose.ymlfor easy local deployment.
If you want, I can also add a config.sample.json, a brief Dockerfile, or create initial DB migration scripts — tell me which you'd like next.