Snagbook · Engineering · System map
Snagbook is the app building contractors use to record defects on site and send the client a report. Ten boxes make it run: eight we operate and two outside services we call. This page shows how a request moves through them and why each one is there.
The numbers match the dots on the diagram. An inspector walks a site, taps Finish, and the client gets a report.
What office staff use in a browser: scheduling inspections, reading reports, keeping the client list. It holds no data of its own. Every screen is a request to the API.
What inspectors carry. Sites often have no signal, so it keeps an inspection on the phone and sends it when it can. That is why step 2 can arrive hours after the walk.
The only door to the data. Three identical instances keep nothing in memory between requests, so any one can answer any request and we deploy by swapping them one at a time.
A fast key-value store for sessions, rate-limit counters and each company's checklist templates, kept for 5 minutes. It spares the database the most frequent questions. Wipe it and everyone signs in again; nothing else is lost.
The record of everything: companies, sites, inspections, defects. The primary takes every write and a read replica serves the heavy report queries. Backed up nightly, kept for 30 days.
A waiting line for slow work. It lets the API say yes in milliseconds and leave the PDF for later. A job that fails is retried 5 times, waiting longer each time, then set aside for a person.
Two instances that take jobs from the queue: building PDFs, resizing photos, sending email. They are separate from the API so a burst of reports on a Friday afternoon can't slow the app down.
Photos and finished PDFs. Phones upload to it directly, so a 6 MB photo never passes through the API. Clients download reports through links that stop working after 7 days.
The two outside services. Only the workers call them, never the API. When a provider is slow, a job waits and no person does.
Left off on purpose: logging, monitoring and the deploy pipeline. They touch every box and would hide the picture, so they have their own page. If you change how two boxes talk to each other, change this page in the same pull request.
Sample page. The names and numbers are made up.