A service platform, request to paid.
A working multi-role web app for a multi-site maintenance business: customer portal, dispatch board, engineers’ phones, invoicing, card payments, calendar and accounting integrations, an audit trail and reports.
Price for a platform on this scale: ask for a quote, fixed in a written scope before work starts. Get a quote → · Ask us for one like it
Open the working platform Logins for all five roles are on the sign-in screenBuilt by Genco Doganay at Ardholt. Wrayfield Facilities is the multi-site maintenance business it is shown running: five customer organisations, 46 sites, 21 people in five roles, eight weeks of jobs, visits, invoices and payments.

- 5roles, each with its own screens and permissions
- 46sites across five customer organisations
- 15job states, 18 moves, each owned by a role
- 4integrations: cards, email, calendar, ledger
- 21people in five roles to sign in as
1 · Five roles, five working screens
Each person gets the screens they need and nothing else. Permissions are enforced in the service layer, so a screen that forgets to hide a button still cannot do what its role may not.
The one who asks
Raises a request for any of their sites, approves a quote when the job is over their limit, confirms finished work and pays the invoice.
- Raise a request against a site and an asset, with the urgency that sets the clock: attend within 4 hours to a planned date.
- A “Waiting for you” list of quotes to approve and work to confirm; invoices with card payment.
Sign in as Priya Shah, customer
Facilities Manager, Halberd Retail, 24 sites
The one who books
Sees every new request with its clock running, triages it, prices a quote when the job is over the customer’s limit, and puts the right engineer in a slot.
- A queue ordered by how close each request is to missing its attend-by time; a day board with every engineer’s visits on a time line.
- The board refuses an engineer without the job’s trade, and a slot already taken.
Sign in as Hannah Okoro, dispatcher
Service Coordinator
The one on site
Works from a phone: today’s visits, set off, arrive, add parts, hold for parts, log time, write up the job and take the customer’s signature.
- Set off tells the customer; arrival starts a timer; parts are added from the catalogue at their price on the day.
- Completing needs the time logged and what was done written down, and can carry the customer’s drawn signature.
Sign in as Daniel Mensah, engineer
Electrical and fire safety
The one who invoices
Issues invoices from confirmed work, records payments, and checks the accounting ledger against the platform to the penny.
- Ready to invoice: confirmed work priced from the rate card, one click each, with aged debt by band.
- The ledger page reads the trial balance from the accounting system’s own API, not the platform’s tables, and reconciles the two.
Sign in as Marcus Bell, finance
Finance Manager
The one who watches
Runs the platform: health of the four integrations, the event log, dead letters and their replay, the audit trail, users, rates and service levels.
- Four integrations with health, retries, queue depth and response time, and outage switches to show a provider failing and recovering.
- The audit trail: who changed what and when, written by database triggers, append-only; users, rates and service levels.
Sign in as Rachel Iqbal, administrator
Operations Director


2 · The integrations, shown working
Card payments, email, calendar and accounting each run as their own provider. Three things worth seeing happen.
The ledger goes down, nothing is lost or posted twice
The accounting ledger is switched off on the integrations screen and an invoice is issued anyway. Its ledger entry waits in the outbox, retries with backoff, and posts when the ledger returns. The ledger holds one invoice, not two.
A webhook delivered twice, one payment
A card gateway delivers each payment event at least once. A switch on the integrations screen makes this one deliver every payment webhook twice. The receiver records one payment: the payment row is keyed by the gateway’s event id, and the second delivery is logged as a duplicate.
A forged webhook, or one signed with the wrong secret, is rejected before anything is recorded; a declined test card leaves the invoice unpaid.
Handled by the receiver and its signature check, described under How it is built.
What the customer actually received
Every customer-facing change sends a templated email through the mail service: request received, booked, on the way, completed, invoice, receipt. The Sent mail screen reads the messages back from the mail service’s own API, not from the platform’s tables, so what it shows is what the provider holds.

3 · The scope, agreed first
The shape of every job we take on: the scope is written and priced before work starts, with the checks that decide whether it is done. This is the scope this platform is built against.
- What is delivered
-
- A multi-role web app with five roles (customer, dispatcher, engineer, finance, admin), sign-in, and permissions enforced in the service layer.
- The job workflow: 15 states and 18 moves, the SLA clocks by priority, the quote rule for jobs over the customer’s limit, the trade-skill and completion rules, automatic confirmation after 48 hours.
- Pricing and invoicing from the rate card (labour in quarter hours, parts at cost plus markup, call-out, VAT in whole pence), and card payments by payment intent with signed webhooks.
- Four integrations behind one HTTP-shaped transport: card gateway, mail, calendar with an ICS feed for each engineer, and accounting; with the outbox, retries, dead letters and replay, and the event log.
- The audit trail, written by database triggers on every audited table, and the reports: attendance and fix within SLA, first-time fix, engineer time.
- The working platform, so the scope can be checked on screen.
- Not included
-
- Connection to your own accounts at the card gateway, mail service, calendar and accounting package: scoped and priced with your brief. The transport is the one place that changes.
- Hosting on your servers: the same schema and service layer move to a server database as part of the build.
- Domains, and import of data from an existing system: scoped with your brief.
- Acceptance checks
- Agreed now, and checked with you before hand-over.
- Timing
- The platform as shown: designed and built as one build, from written scope to hand-over.
4 · How it is built
The whole system in one picture
Five roles work in one app. Every screen calls one service layer that holds the job workflow and the role checks. Every change lands in SQLite in one transaction with the messages it causes and the audit rows it earns. A worker delivers those messages to the card gateway, mail service, calendar and accounting ledger through one HTTP-shaped transport; signed webhooks come back.
Drag sideways to see the whole diagram
Rules live in one place
The workflow is a table: every state, every allowed move, the role that owns it and the rule it must pass. The buttons on the screens are drawn from it and the service layer refuses any move not in it, so the two cannot drift apart.
src/domain/workflow.tsA message is never lost or sent twice
The outbox row commits with the change that caused it. Delivery backs off with jitter, honours Retry-After, stops on errors that cannot succeed, and dead-letters after ten attempts. Every request carries an idempotency key.
src/integrations/outbox.tsOne line to go live
The transport is the only place the app meets the outside. Each provider here is a local service behind it that answers with the same paths, headers and responses as the real one. Pointing the app at the real service is a change to that single function.
src/integrations/transport.tsThe job workflow: 15 states and 18 moves
A job moves from a customer’s request to a paid invoice along the line below. Each numbered arrow is one row of the transition table, owned by one role, with the rules it must pass. Above the main line is the quote route, taken when a job’s estimate is over the customer’s not-to-exceed limit for a single job (the NTE).
Drag sideways to see the whole diagram
TRANSITIONS in src/domain/workflow.ts.The data model, and the rules the database enforces
The diagram is drawn from schema.sql, table by table, with the key columns of each and what makes them worth reading. The six tables that belong to a job meet one trunk into jobs, and the one from invoices back to a job runs along the top. Every key is also named on its column; those to users and trades, which almost every table has, are named rather than drawn.
Drag sideways to see the whole diagram
- Integer penceEvery amount is stored as whole pence; VAT is worked out in whole pence; a quote or invoice cannot save unless net plus VAT equals gross.
*_pence · CHECK (gross = net + vat) - ISO UTC timesEvery time is stored as ISO-8601 text in UTC, so a deadline compares and sorts as text and means one thing everywhere.
raised_at · attend_by · fix_by - Optimistic concurrencyA job carries a version. A change made from an out-of-date copy is refused instead of overwriting someone else’s.
jobs.version - Transactional outboxA state change and the messages it causes commit together: nothing is sent for a change that rolled back, nothing is lost for one that committed.
outbox · idempotency_key UNIQUE - Append-only audit logTriggers are built from each audited table’s own column list, so a new column is audited without anyone remembering to. The database refuses updates and deletes to the log.
audit_log · audited tables - One payment per eventA payment row is keyed by the gateway’s event id, so a webhook delivered twice cannot pay twice.
payments.gateway_ref UNIQUE - Rules in the schemaThe job’s state is a closed list, a visit cannot end before it starts, a booked job must have an engineer: the database says no even if a screen forgets to.
CHECK constraints
Every call to a provider, on the record
Every call is on the record
Open any row in the event log and the request that left and the response that came back are there: method, path, headers, idempotency key, body, status and time taken.
This one is the card gateway’s signed webhook arriving. The receiver checks the HMAC-SHA256 signature and its timestamp before it records anything, and answers with a 200.

The stack and how to run it
How the platform is built, what it weighs and how to run it.
Gzip. Records-building worker 47 kB, SQLite WebAssembly 337 kB, CSS 6 kB, two fonts 69 kB.
Produced by running them through the platform’s own workflow.
Stack and how to run it
- Front end
- Preact and TypeScript, built with Vite. Inter and JetBrains Mono served from the app itself.
- Data
- SQLite 3 in the browser through sql.js (WebAssembly), saved to IndexedDB after every commit.
- Sign-in
- PBKDF2-SHA256 password hashes; sessions per tab.
- Hand-off note
- What you receive: the source and the commands to run it.
The companion piece
The same business, automated: see the automation system that runs its tools.
Want one like it?
Send us what you have and what it needs to do. A written scope and fixed price follow. Nothing starts until you agree.
You deal with us directly, from the first reply to hand-over.




