A full-stack web application that transforms raw biometric door-access events into actionable workforce intelligence. Built with FastAPI, React, and PostgreSQL.
Design System: Vigilant Glass (Bento Grid + Glassmorphism)
ERAOTS-1/
├── docs/ # Phase I deliverables
│ ├── SRS_Document.md/pdf # Software Requirements Specification
│ └── ER_Diagram.md/pdf # Entity-Relationship Diagram
├── UI prototype/ # Design reference files
│ ├── vigilant_glass_2/ # Light/dark mode design specs
│ └── real_time_dashboard_v2/ # Dashboard UI reference
├── backend/ # Python FastAPI backend
│ ├── app/
│ │ ├── api/ # REST API endpoints
│ │ │ ├── auth.py # Login & JWT authentication
│ │ │ ├── events.py # Scan events + occupancy (FR1, FR2)
│ │ │ ├── employees.py # Employee & department CRUD (FR5)
│ │ │ └── schemas.py # Pydantic request/response schemas
│ │ ├── core/ # Framework infrastructure
│ │ │ ├── config.py # Environment settings
│ │ │ ├── database.py # Async SQLAlchemy engine
│ │ │ ├── security.py # JWT, bcrypt, API keys
│ │ │ └── dependencies.py # FastAPI dependency injection
│ │ ├── models/ # Database models (20+ entities)
│ │ │ ├── employee.py # Employee, Department, Role, UserAccount
│ │ │ ├── events.py # ScanEvent, OccupancyState, PendingStateTransition
│ │ │ ├── attendance.py # AttendanceRecord
│ │ │ ├── schedule.py # Schedule, Leave, Holiday
│ │ │ ├── notifications.py # Notifications & preferences (actionable)
│ │ │ ├── corrections.py # Attendance corrections
│ │ │ ├── policies.py # Configurable business rules
│ │ │ ├── emergency.py # Emergency evacuation tracking
│ │ │ ├── hardware.py # Scanner & health monitoring
│ │ │ └── audit.py # Audit log
│ │ └── main.py # FastAPI app entry point
│ ├── simulator/ # Hardware scanner simulator
│ │ └── simulator.py # Generates fake scan events
│ └── requirements.txt # Python dependencies
├── frontend/ # React + Vite frontend
│ └── src/
│ ├── context/ # React context (auth, theme)
│ ├── layouts/ # Premium glassmorphic layout
│ ├── pages/ # Page components
│ ├── services/ # API client (Axios)
│ └── styles/index.css # Vigilant Glass design system
├── docker-compose.yml # PostgreSQL + Redis (optional)
├── .env.example # Environment template
└── README.md # This file
docker compose up -d- Install PostgreSQL
- Create a database named
eraots - Update
.envwith your connection string
cd backend
# Create virtual environment
python -m venv venv
# Activate it
# Windows:
venv\Scripts\activate
# Mac/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Copy environment config
cp ../.env.example ../.env
# Edit .env with your database credentials
# Seed the database (creates tables + demo data)
python test_seed.py
# Start the backend
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000The API will be available at:
- API: http://localhost:8000
- Swagger Docs: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
cd frontend
# Install dependencies
npm install
# Start the dev server
npm run devThe frontend will be available at http://localhost:5173
| Role | Password | |
|---|---|---|
| Admin | admin@eraots.com | admin123 |
| Employee | employee@eraots.com | employee123 |
The Admin account has full system access. The Employee account demonstrates the limited employee view.
ERAOTS uses the Vigilant Glass design system:
- Typography: Manrope (headlines), Inter (body)
- Colors: Deep zinc/black, pure white, signal red (#E60000)
- Effects: Glassmorphism with backdrop-blur, subtle gradients
- Layout: Bento grid system with responsive breakpoints
- Modes: Light and dark themes with smooth transitions
Toggle between light/dark mode using the theme switch in the header.
The simulator generates realistic scan events for testing:
cd backend
# Run a full workday simulation
python -m simulator.simulator --mode workday --scanner-ids <scanner-id-1> <scanner-id-2> --employees 10
# Run continuous random scans
python -m simulator.simulator --mode continuous --scanner-ids <scanner-id-1> --interval 15Note: Find scanner IDs in the Swagger docs after starting the backend, or check the server startup logs.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/login |
Authenticate & get JWT token |
| GET | /api/auth/me |
Get current user info |
| POST | /api/events/scan |
Submit a scan event (FR1) |
| GET | /api/events/recent |
Get recent scan events (FR3) |
| GET | /api/events/occupancy |
Get live occupancy stats (FR2) |
| GET | /api/events/occupancy/employees |
Get per-employee status |
| GET | /api/events/pending-transitions |
Get pending 30-second confirmations |
| PUT | /api/events/pending-transitions/{id}/reject |
Cancel a pending transition |
| PUT | /api/events/status-override |
Manual status toggle (hierarchy of truth) |
| WS | /api/events/ws/dashboard |
WebSocket for live updates |
| POST | /api/employees |
Create employee (FR5) |
| GET | /api/employees |
List employees |
| PUT | /api/employees/{id} |
Update employee |
| POST | /api/departments |
Create department |
| GET | /api/departments |
List departments |
Full interactive documentation at http://localhost:8000/docs
ERAOTS implements a sophisticated hybrid status tracking system:
OUTSIDE— Not in the buildingACTIVE— Inside and at deskIN_MEETING— Inside but in a meetingON_BREAK— On a short breakAWAY— Away for extended period
- Biometric Scan OUT (Ultimate Priority) — Forces status to OUTSIDE
- Manual Portal Toggle (High Priority) — Direct user override
- Calendar Sync (Medium Priority) — 30-second confirmation rule
When a calendar meeting starts:
- System creates a
PendingStateTransition - Employee receives actionable notification with [Cancel] / [Confirm]
- If ignored for 30 seconds, transition auto-confirms to
IN_MEETING
| Squad | Focus | Members |
|---|---|---|
| Backend | FastAPI, database, business logic | 3 |
| Frontend | React, dashboard, UI/UX | 3 |
| QA & Docs | Testing, documentation | 2 |
| DevOps & Integration | CI/CD, deployment | 2 |
| Lead | Architecture, coordination | 1 |
| Layer | Technology |
|---|---|
| Backend | Python 3.11+ / FastAPI |
| Frontend | React 18 / Vite |
| Database | PostgreSQL 15+ / SQLite (dev) |
| Cache | Redis 7+ |
| ORM | SQLAlchemy 2.0 (async) |
| Auth | JWT (python-jose) |
| Charts | Recharts |
| Real-time | WebSocket |
| Design | Vigilant Glass (custom) |
University project — Industry Reconnaissance Module.