Navigation

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

FieldDesk scheduling board in compare mode: the Recovery options panel compares the Keep promises, Protect compliance and Limit overtime plans against no action, with ghost "preview" bookings on the board and an "Apply “Keep promises”" button.

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

  1. Step 1

    FieldDesk scheduling board at 06:30 with plan v1 placing 89 of 89 jobs across 12 technicians' timelines, and the guide strip offering the next event.
    06:30: plan v1 places 89 of 89 jobs across 12 technicians.
  2. Step 2

    FieldDesk at 07:10 after Rāwiri Tane calls in sick: his row is marked unavailable and 8 of his jobs appear in the "Needs a technician" tray, each released by the sick call.
    07:10: a sick call releases 8 jobs into the tray.
  3. Step 3

    FieldDesk board after plan v2 absorbs the sick call: released jobs placed on other technicians, and 5 jobs left in the tray each with the reason no qualified technician has a feasible slot.
    Plan v2 places the released work; 5 jobs stay in the tray, each with the reason no qualified technician fits.
FieldDesk technician app on a phone: Sione Pulu's day with "All changes synced", a list of today's 10 visits with times, sites, job numbers and strict windows, and My day, Visit and Sync tabs.
The technician app on a phone (390 × 844): today's visits, synced after working offline.

Engineering invariants

Rules the system enforces whatever the user does, and where each one is proven.

InvariantWhy it mattersEvidence
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

FieldDesk system architectureBrowser, then a React and TypeScript single-page app, then a Symfony modular monolith with the Field service module, then PostgreSQL: row-level security isolates every demo session. The backend calls an AI adapter: AI structures a technician's free-text note into defects with every value quoted from the note and drafts a visit summary from recorded facts via placeholders; it never decides compliance, schedules or due dates.BrowserAnonymous demo session · guided scenarioReact + TypeScriptSingle-page app · Playwright end-to-end + axeJSON · RFC 9457 problem detailsSymfony modular monolithField service modulescheduler · bookings · offline synctransactions · constraintsPostgreSQLRow-level security isolates every demo sessionAI adapterJSON schema + semanticvalidation · fixture modeby default · no AI numbersDocker + Caddy on a shared 4-vCPU host · synthetic data only
AI structures a technician's free-text note into defects with every value quoted from the note and drafts a visit summary from recorded facts via placeholders; it never decides compliance, schedules or due dates.

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.