An open source field service management system built using FastAPI, PostgresSQL, Vite, and React (Will probably move to Node.js). Currently at around 30+ API endpoints. It's capable of creating technicians and jobs (backend), managing them, assigning jobs to technicians based on skill, and tracking technicians locations, in addition to job states (backend & frontend). FieldOpt helps dispatchers and field service companies efficiently assign and route service jobs to technicians.
|
[Dot View] |
[Job View] |
|
[Swagger API Backend] |
[JSON Entry] |
Auto-Router: Automatically assigns jobs to the best qualified technicians
Skill-Based Matching: Ensures technicians only get jobs they're qualified for (manual override capable)
Capacity Management: Prevents overbooking by tracking tech workload
- Python 3.11+
- pip, venv, and npm
- Docker or PostgreSQL 15+
Create virtual environment
Install dependencies
Start PostgreSQL via included docker yml or local install
Run server
cd fieldopt
python3 -m venv venv
source venv/bin/activate # macOS
venv\Scripts\activate # Windows
pip install -r requirements.txt
# For Docker
<Start Docker>
docker compose up -d postgres
python -m uvicorn backend.api.main:app --reloadInstall dependencies
Run server
cd fieldopt/frontend
npm install
npm run devAPI: http://localhost:8000
Interactive Docs: http://localhost:8000/docs
Alternative Docs: http://localhost:8000/redoc
Frontend: http://localhost:5173
cd fieldopt/backend/database/
python -m backend.database.seeds.seed_datacp .env.example .env
# Edit .env (defaults work for development)standard- Closest qualified techload_balance- Balances workload across all techsstandard_by_timeslot- Considers time slots (future enhancement)
The routing engine considers multiple factors to find the best technician for each job:
- Skill: Technician must have all required skills
- Time: Technician must have time available in their day
- Capacity: Won't overload a tech (configurable max jobs per day)
- Distance: Assigns closest qualified tech (in standard mode)
- Priority: VIP and high-priority jobs routed first
POST /api/v1/technicians/- Create technicianGET /api/v1/technicians/- List all techniciansGET /api/v1/technicians/available- Get available techsPATCH /api/v1/technicians/{id}/location- Update locationPATCH /api/v1/technicians/{id}/status- Update status
POST /api/v1/jobs/- Create jobGET /api/v1/jobs/- List all jobsGET /api/v1/jobs/unassigned- Get unassigned jobsPATCH /api/v1/jobs/{id}/start- Start a jobPATCH /api/v1/jobs/{id}/complete- Complete a job
POST /api/v1/routing/auto-route- Auto-assign all pending jobsPOST /api/v1/routing/jobs/{id}/route- Route single jobPOST /api/v1/routing/jobs/{id}/assign/{tech_id}- Manual assignDELETE /api/v1/routing/jobs/{id}/unassign- Unassign jobPOST /api/v1/routing/jobs/{id}/reassign/{tech_id}- Reassign job
Edit backend/.env to customize routing behavior, time slots, etc.
Project restructuring + frontend
- Fully backend-driven
- PostgresSQL over SQLite
- Beautiful and responsive map view, thanks to the OpenStreetMap library
- Redesigned tailwind css vite + react frontend
Previous Changes
0.0.2
Started frontend
- FastAPI + react integration; "it isn't pretty but it's scaffolded"
- Technician + job CRUD via API
- Technically live frontend that displays techs/jobs
0.0.1
Initial commit
- Basic backend logic
- More of a proof of concept
[ ] Node.js Frontend
[ ] Update map for distace, real time traffic
[ ] Refine auto-dispatching
[ ] Mobile Technician App for communication with the API while dispatched
If you share the belief that simplicity empowers creativity, feel free to contribute.
- Forking this repo
- Submitting a Pull Request
- Bug reports and feature requests
Please ensure your code follows the existing style.