Smart Substitution & Proxy Workload Management System
ProxEase is a production-grade, mathematically optimized smart substitution scheduling and proxy workload management system designed for educational institutions. When teachers are absent, ProxEase uses constraint programming (via Google OR-Tools CP-SAT) to globally optimize the allocation of substitute (proxy) duties, ensuring mathematical balance, department familiarity, and administrative fairness across the entire school staff.
- Key Features
- Core Mathematical Optimization Model
- Standalone Offline Mode & Fallback Solver
- Tech Stack
- Local Development Setup
- Containerized Launch (Docker Compose)
- Netlify Static Deployment
- Excel Timetable Specifications
- Running Unit & Integration Tests
- โก Mathematical Constraint Optimization: Integrates Google OR-Tools CP-SAT to globally solve substitute teacher assignments, satisfying all hard constraints (availability, daily limits, class conflicts) while maximizing soft scores (class familiarity, free period preservation).
- ๐ Emergency Reassignment with Runner-ups: Calculates the top 3 alternative candidate runner-ups (Rank 2 and Rank 3) for every assignment. Administrators can cycle through alternatives with a single click, updating records in
<10mswithout re-solving. - ๐ Direct Excel Timetable Parsing: Uploads and parses school timetable sheets (
.xlsx/.xls) directly, automatically normalizing class headers, days, and periods. - ๐ Standalone Offline/Local Mode (Netlify-Ready): Dynamically falls back to Local Standalone Mode if the backend API is unreachable. In this state, a pure client-side Minimum Remaining Values (MRV) Heuristic Solver executes proxy generation in <1ms directly in the browser using
localStorage. - ๐ Workload Balance Analytics: Charts daily proxy allocation history and calculates Jain's Fairness Index to measure duty distribution equality. Excludes absent teachers automatically from all active metrics to avoid reporting skew.
- ๐ฑ Device-Adaptive UI: Responsive layouts, navigation drawers, and mobile list cards built with Next.js 16 and custom Tailwind CSS components, fully optimized for all viewports.
The backend leverages the Google OR-Tools CP-SAT Solver to formulate the proxy assignment problem.
Let
-
Uniquely Assigned: Every absent slot
$a$ must be covered by exactly one eligible substitute teacher$t$ :$$\sum_{t \in \text{Eligible}(a)} x_{a, t} = 1$$ -
Single Duty per Period: A teacher
$t$ cannot cover multiple absent slots during the same period$p$ :$$\sum_{a : p_a = p} x_{a, t} \le 1 \quad \forall t$$ -
Availability: A teacher
$t$ can only be assigned if they are marked present and have a free period during period$p_a$ . -
Daily Duty Limit: A teacher
$t$ cannot exceed the maximum daily proxy limit ($L_{daily}$ , default = 6):$$\sum_{a} x_{a, t} \le L_{daily} \quad \forall t$$ -
Minimum Free Periods: A teacher
$t$ must retain at least$M_{free}$ free periods:$$\text{FreePeriods}(t) - \sum_{a} x_{a, t} \ge M_{free} \quad \forall t$$
We maximize a weighted objective function:
The score component for teacher
| Weight Parameter | Default Value | Description |
|---|---|---|
weight_familiarity |
50 |
Reward for teacher belonging to the same department/subject. |
weight_free |
40 |
Reward for selecting teachers with more remaining free periods. |
weight_daily |
30 |
Penalty factor for duties already completed today. |
weight_weekly |
20 |
Penalty factor for duties completed during this calendar week. |
weight_monthly |
10 |
Penalty factor for duties completed during this calendar month. |
weight_consecutive |
-30 |
Penalty for assigning a teacher to back-to-back periods. |
weight_last_free |
-1000 |
Heavy penalty to prevent taking a teacher's final free period. |
To support zero-backend environments (such as Netlify static deployments), ProxEase embeds a local-first architecture:
- Browser LocalStorage Sync: Automatically loads and caches timetables, absentees, exceptions, settings, and proxy histories in the client's browser.
- Minimum Remaining Values (MRV) Heuristic Solver: If the backend is unreachable, the frontend executes a local backtracking solver enhanced with the MRV heuristic:
- It selects the absent slot with the fewest eligible substitute teachers first (constraining the branching factor).
- It breaks ties using the Least Constraining Value (LCV) heuristic to assign the teacher that leaves the most free periods available for other assignments.
- Executes in <1ms on modern browsers for standard workloads.
- Core framework: Next.js 16.2.9 (App Router, Turbopack)
- State manager: Zustand 5.0.14
- Styling: Tailwind CSS v4
- Data visualization: Recharts 3.8.1
- Excel Parsing: SheetJS (
xlsxv0.18.5) - Icons: Lucide React
- Core framework: FastAPI 0.136.3
- Server gateway: Uvicorn 0.28.0
- Optimization engine: Google OR-Tools (CP-SAT v9.8.3296)
- Database & ORM: SQLite + SQLAlchemy 2.0
- Testing Suite: Pytest 8.0
- Node.js 18+
- Python 3.10 - 3.13
# Navigate to backend directory
cd backend
# Create a clean virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Start the FastAPI server
uvicorn app.main:app --host 127.0.0.1 --port 8001The FastAPI server will be active at http://127.0.0.1:8001/ with Swagger docs at http://127.0.0.1:8001/docs.
# Navigate to frontend directory (from project root)
cd frontend
# Install node dependencies
npm install
# Start the Next.js dev server
npm run devThe frontend portal will be active at http://localhost:3000.
Launch both services in a unified local container cluster:
# From the project root
docker-compose up --build- Portal URL:
http://localhost:3000 - API Sandbox:
http://localhost:8001/docs
Because ProxEase features an integrated client-side solver, the frontend can be deployed statically to Netlify without requiring a persistent Python backend database.
ProxEase includes a pre-configured netlify.toml file inside the frontend folder:
[build]
command = "npm run build"
publish = "out"
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
[[headers]]
for = "/_next/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"- Connect your GitHub repository to Netlify.
- Set the Base directory to
frontend. - Netlify will automatically detect
netlify.toml, runnpm run build(triggering Next.jsoutput: "export"), and deploy static files fromout/with optimized long-term asset caching headers.
When uploading schedules, the system expects the Excel file to follow these conventions:
- Horizontal Day Headers: Class and period grids mapped Monday through Saturday.
- Period Headers: Columns labeled P1 through P8 representing consecutive school slots.
- Busy/Blocked Indicators: Cells marked with
-orBare treated as occupied, busy, or unassignable (e.g. assembly, laboratory blocks). - Free Periods: Empty or null cells represent free periods that are eligible candidate slots for substitute coverage.
Execute the backend python test suites:
# Navigate to backend and run Pytest
cd backend
./venv/bin/pytest