A modern, enterprise-grade web application for military personnel authentication and access control with an elegant face authentication interface and premium UI design.
- Face Authentication Real-time face capture and verification system
- Multi-Level Clearance Three security levels (CONFIDENTIAL, SECRET, TOP SECRET)
- Personnel Management Secure personnel database with roles and units
- Area Access Control Granular access control to restricted base areas
- Officer Dashboard Real-time access logs and personnel oversight (admin only)
- Premium UI Modern dark theme with gold accents and smooth animations
- Real-Time Processing Instant authentication and access verification
- Session Management Secure server-side session handling with logout
| Layer | Technology |
|---|---|
| Backend | Flask 3.0.3, Flask-Session 0.5.0 (Python 3.13) |
| Frontend | HTML5, CSS3, JavaScript (Vanilla) |
| Image Processing | Pillow 12.0.0 |
| Styling | Custom CSS with Inter font, responsive design |
| Authentication | MD5 hash-based face verification (demo) |
| Storage | Filesystem (face encodings pickle file) |
| UI/UX | SVG logo, scanning animation, enterprise design |
- Python: 3.13 (Microsoft Store or official distribution)
- pip: Python package manager
- Browser: Modern browser with webcam support (Chrome, Firefox, Edge)
- Webcam: For face capture (or use photo upload)
- OS: Windows, macOS, or Linux
cd "C:\Users\ev208\OneDrive\Desktop\Projects\305HackNov\military-base-access-control"pip install -r requirements.txtpython app.pyExpected output:
* Serving Flask app 'app'
* Debug mode: on
* Running on http://127.0.0.1:5000
Press CTRL+C to quit
- Home: http://127.0.0.1:5000
- Login: http://127.0.0.1:5000/login
- Dashboard: http://127.0.0.1:5000/dashboard
military-base-access-control/
app.py # Flask backend (routes, API, auth)
requirements.txt # Python dependencies
README.md # This file
QUICK_START.md # Quick reference guide
run.bat # Windows batch start script
templates/
index.html # Landing page with hero + features
login.html # Authentication page (webcam/upload)
dashboard.html # User dashboard (profile, logs, admin)
static/
css/
style.css # Unified theme (Hawkeye brand colors)
js/
main.js # Global scripts
login.js # Face capture & scanning animation
dashboard.js # Dashboard interactivity
images/
hawkeye-logo.svg # Professional eye logo
uploads/
authorized_faces/ # Stored authorized face photos
flask_session/ # Session storage (auto-created)
-
Option A Webcam Capture:
- Click "Capture Photo" tab
- Allow camera permissions in browser
- Position your face in the frame
- Click "Capture" button
- Click "Authenticate" to submit
-
Option B Upload Photo:
- Click "Upload Photo" tab
- Drag & drop or browse for an image
- Click "Authenticate" to submit
-
On first login, your face is registered as soldier1
- Personnel Profile View rank, unit, clearance level
- Access Areas View authorized areas for your clearance
- Request Area Access Test access to different areas
- Admin Console (TOP SECRET clearance only):
- View complete access logs
- View all personnel database
| ID | Name | Rank | Unit | Clearance | Access |
|---|---|---|---|---|---|
| soldier1 | John Smith | Captain | Alpha Squadron | SECRET | barracks, armory, command_center |
| soldier2 | Sarah Johnson | Lieutenant | Bravo Squadron | TOP SECRET | barracks, armory, command_center, war_room |
| soldier3 | Michael Davis | Sergeant | Charlie Squadron | CONFIDENTIAL | barracks, cafeteria |
First login registers as soldier1 by default.
- POST /api/authenticate - Authenticate user via face
- POST /api/register-face - Register new face for soldier
- GET /api/check-session - Check current session status
- POST /api/logout - Clear session and logout
- GET /api/profile - Get current user profile
- POST /api/request-access - Check/request access to area
- GET /api/access-log - View access logs
- GET /api/all-personnel - View all personnel
- Primary Color: Navy (#071226)
- Accent Color: Hawk Gold (#ffb400)
- Secondary Dark: #0d2536
- Typography: Inter (Google Fonts)
- Responsive grid layouts (3-col desktop, 2-col tablet, 1-col mobile)
- Smooth animations and hover effects
- Enterprise aerospace-inspired design
- Full-screen scanning animation during authentication
- Professional SVG logo with realistic eye design
Edit app.py, last line:
if __name__ == '__main__':
app.run(debug=True, host='127.0.0.1', port=5001) # Change 5000 to 5001Then restart: python app.py
Edit app.py, modify PERSONNEL_DB:
PERSONNEL_DB = {
'new_soldier': {
'name': 'Full Name',
'rank': 'Rank',
'unit': 'Unit Name',
'clearance_level': 'SECRET',
'access_areas': ['barracks', 'armory'],
},
}- Add to personnel access_areas lists
- Update dropdown in templates/dashboard.html (Request Area Access section)
- Update validation in app.py /api/request-access route
| Issue | Solution |
|---|---|
| Browser shows "Connection Refused" | Ensure Flask is running; check console shows "Running on http://127.0.0.1:5000" |
| Camera not working | Allow browser permissions; test camera in system settings; try Firefox/Chrome |
| Face auth fails | Good lighting required; face should be centered and clear; try uploading a photo instead |
| Python module errors | Run pip install --upgrade pip then pip install -r requirements.txt |
| Port 5000 in use | Use netstat -ano | findstr :5000 to find PID, then taskkill /PID /F |
| CSS changes not appearing | Hard refresh browser: Ctrl+Shift+R (clears cache) |
| Session lost after refresh | Normal behavior; restart Flask to clear sessions |
- Face Encoding: Uses MD5 hash of grayscale image for demo purposes
- Session Storage: Server-side via Flask-Session (filesystem in demo)
- Access Logs: All access attempts logged with timestamp and status
- Clearance Levels: TOP SECRET users have access to admin endpoints
- HTTPS: Production deployment requires SSL/TLS encryption
WARNING: This is a demonstration system. Do NOT use for real military applications without proper security hardening.
| File | Purpose |
|---|---|
| app.py | Main Flask app with routes, API endpoints, authentication logic |
| requirements.txt | Python package dependencies (Flask, Pillow, etc.) |
| index.html | Landing page (hero, features, system overview) |
| login.html | Authentication page (webcam capture or photo upload) |
| dashboard.html | User dashboard (profile, access areas, admin console) |
| style.css | Unified CSS theme with Hawkeye branding and responsive design |
| login.js | Client-side auth logic and scanning animation |
| dashboard.js | Dashboard interactivity (access requests, admin panel) |
| hawkeye-logo.svg | Professional SVG logo (integrated in navbar) |
# If multiple Python versions installed
py -3.13 app.pyServer runs in debug mode by default. Changes to files auto-reload.
app.run(debug=False, host='127.0.0.1', port=5000)- Find your machine's IP: ipconfig look for "IPv4 Address"
- Start Flask: python app.py --host 0.0.0.0 --port 5000
- From other machine: http://<YOUR_IP>:5000
# Check session
curl http://127.0.0.1:5000/api/check-session
# Authenticate (requires multipart image)
curl -X POST -F "image=@face.jpg" http://127.0.0.1:5000/api/authenticate
# Get profile (requires login)
curl -b cookies.txt http://127.0.0.1:5000/api/profile
# Request access to area
curl -X POST -H "Content-Type: application/json" \
-d '{"area":"armory"}' \
-b cookies.txt http://127.0.0.1:5000/api/request-access- Flask Docs: https://flask.palletsprojects.com/
- Pillow Docs: https://pillow.readthedocs.io/
- HTML/CSS/JS: https://developer.mozilla.org/
- REST API Design: https://restfulapi.net/
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | Nov 2025 | Initial release with Hawkeye branding, premium UI, face auth system |
For issues or questions:
- Check this README and QUICK_START.md
- Review Flask output logs in terminal
- Check browser console (F12 Console tab)
- Verify all files are in correct locations
Hawkeye Enterprise-Grade Military Access Control
Secure. Professional. Powerful.
Last Updated: November 15, 2025 Project Version: 1.0.0 Maintained by: Development Team