Field service
FieldDesk
Scheduling, dispatch and inspections for a field-service contractor, with a technician PWA that works offline and a database that refuses double-booking.
In the demo you plan a Tuesday in Auckland (12 technicians, 90 jobs), handle a 07:10 sick call and a 09:30 urgent callout by comparing three recovery plans, then work offline on a technician's phone and resolve the sync conflict. Underneath: a deterministic scheduler with hard constraints kept out of the score, version-safe re-plans, an offline PWA with an idempotent operation log, and a database that refuses double-booking.
- My role
- Sole engineer: spec to deployment
- Walkthrough
- 90-second guided scenario
- Focus
- Constraint scheduling and offline sync
Launch guided demo (opens in a new tab)Engineering evidence
Stack: React · TypeScript · PHP/Symfony · PostgreSQL · Playwright + axe
Independently built portfolio showcase · simulated data

The business problem
A fire-protection and HVAC contractor plans a day of inspections and callouts. Technicians hold different skills and authorisations, customers hold arrival windows, plant rooms open for an hour. Then a technician calls in sick, an urgent callout arrives, and a technician works offline while the office changes the same job.
Try the workflow
Step 1

06:30: plan v1 places 89 of 89 jobs across 12 technicians. Step 2

07:10: a sick call releases 8 jobs into the tray. Step 3

Plan v2 places the released work; 5 jobs stay in the tray, each with the reason no qualified technician fits.

Engineering invariants
Rules the system enforces whatever the user does, and where each one is proven.
| Invariant | Why it matters | Evidence |
|---|---|---|
| A technician is never booked in two places at once, enforced by a GiST exclusion constraint on session, technician and time slot. | The database is the last guard against double-booking. | Exclusion constraint excl_fs_block_one_place (opens in a new tab)Functional/FieldDeskApiTest.php :: testSkippingAheadTakesTheDefaultDecisionsAndBlocksNeverOverlap |
| Hard constraints are never scored: skills, valid qualifications, shift and overtime limits, access windows. Work that cannot fit stays unassigned with its reason. | No plan ever shows a green check that breaks a real constraint. | Feasibility (opens in a new tab)Unit/FieldService/SchedulerTest.php :: testServiceWaitsForTheAccessWindowAndMustFinishInsideIt |
| Offline operations apply in device order and idempotently: a retry returns the original result, a reused id with different content is refused, and a gap waits for the missing operation. | Flaky signal never duplicates inspections, defects or follow-ups. | Idempotent sync (opens in a new tab)Functional/FieldDeskSyncTest.php :: testTheBasementSyncKeepsEvidenceRaisesOneConflictAndReplaysIdempotently |
System architecture
Key decisions
A tiered objective (critical work, then compliance, customer and overtime) with feasibility kept out of the score. The result is 'the best plan found under these rules', not 'optimal'.
Why: Profiles reorder priorities but can never relax feasibility.
Rejected: Feasibility inside the score (my first design, corrected after review).
docs/specifications/012-fielddesk.md review history and §5
The scheduler and the offline conflict engine stay in the module; only generic pieces (workspace shell, PWA hook) go to the shared core.
Why: There is one user today; I extract on a real second use.
Rejected: Reusing LineControl's line simulation as the scheduler.
ADR 0007 — Workspace shell, PWA hook and module-owned scheduling/sync
Engineering evidence
Benchmark
Busy-season benchmark
50 technicians and a 2,000-job queue, re-planned at 09:30 with two technicians off sick, against a 10 s budget: plan ≈ 4.5 s. The engineering page can run it on the production server.
Conditions: Dev container; the production figure is produced live by the page, not recorded
Tests
PHPUnit — scheduler, sync, golden day
Scheduler, domain, sync and golden-day tests in PHPUnit.
Engineering page
“How it's engineered” in the live demo (opens in a new tab)
The full detail: rules, data model, tests and measurements, next to the running product.
I use AI-assisted development for implementation, exploration and review. I remain responsible for architecture, business rules, code quality and deployment. Critical behaviour is verified with deterministic tests, static analysis and reproducible benchmarks.
Trade-offs and limits
- Fictional contractor (Kōtare Fire & Air) and synthetic data
- No real routing, maps, GPS or live traffic
- Not a certified compliance system; no real inspection standard
- No invoicing, payroll, parts stock or native apps
My contribution
I built FieldDesk as an independent engineering showcase: product specification, architecture, frontend, backend, data model, automated tests and deployment.
Want to discuss the engineering behind this?
Launch demo (opens in a new tab)Get in touch
Source-code walkthroughs available on request.