ACME HQDemo work items and pages, made up for Emargen's demo. Not a real company.
Engineering / Engineering

Architecture overview

By Rafael Duarte · created 2 Mar 2020, 10:00 UTC · last updated 22 Oct 2026, 15:30 UTC · version 25

architectureidentity-serviceportalnotifierregions

Three services, one stack per region. This page is the map; each system has its own page.

The shape of it

                customer's IdP (Entra ID / Okta)
                         │ SAML
people at depots ──► identity-service ──► PostgreSQL (per region)
administrators  ──► portal (React) ──┘        │
                                              │ outbox_events (same transaction)
                                              ▼
                                   relay job ──► SQS queue ──► notifier ──► Mailcrest (email)
                                                                  │    └──► Textbridge (SMS codes)
                                                                  └──► in-app notices (portal bell)

Events

identity-service never calls notifier for a notice. It writes an event to its outbox_events table in the same transaction as the change, and a relay job puts it on the region's queue. Delivery is at least once; notifier drops events it has already handled by event id. The one exception is phone codes: identity-service asks notifier for an SMS directly, because a code that waits in a queue is a code a driver gives up on. Details: Events and the outbox.

Regions

Each client (our code's word for a customer) is placed in one region at onboarding, and its data and backups stay there:

RegionWhereSince
EUFrankfurt (eu-central-1)the start; the default
UKLondon (eu-west-2)2025
USVirginia (us-east-1)January 2026

Each region runs its own identity-service, notifier, PostgreSQL, Redis, queue and backup bucket. Nothing is copied between regions. The portal's static files are the same everywhere; after sign-in it talks to its client's region. Regions and environments, ADR-006.

Sign-in

MethodWhoSince
Passwordanyonethe start
Phone code by SMSdepot workers without a company email26 May
Single sign-on over SAML (Entra ID, Okta)a client's depots, one depot at a timeEntra ID since early 2023, Okta 22 June

Administrators must use MFA in the portal since 11 June. Failed sign-ins are rate-limited at the edge and per account since 10 September (ADR-014). A session lasts eight hours unless the client's administrators set another length (1 to 12 hours, Settings › Sign-in); nothing ends it on idle.

Approvals

People ask for access to a depot's doors, systems and vehicles. identity-service routes each request once, when it comes in, to whoever holds the approver's role at the person's home depot; administrators see every request under All requests. Since 1 October the approver role can be held for one depot (ACM-247); since 22 October waiting requests move to the depot's new approver when a role changes (ACM-320). The product rules are on Roles and approvals.

Outside dependencies

DependencyUsed forIf it is down
AWS (three regions)everything we runsee the Disaster recovery plan
Mailcrestnotice emails; a US account and, since 16 October, an EU accountnotices queue and retry; nobody is locked out
TextbridgeSMS codesphone-code sign-in stops; runbook
Customers' IdPssingle sign-onthat depot can't sign in; runbook

What is changing

Change history

VersionDateWhoWhat
2119 Jan 2026RafaelUS region
2214 Sep 2026RafaelRate limits and lockout after OPS-41
232 Oct 2026MarekApprover role per depot (ACM-247)
2419 Oct 2026RafaelMailcrest EU account; ACM-293 approved for delivery
2522 Oct 2026MarekWaiting requests follow their depot's approver (ACM-320)

Child pages