The core is a facts-plus-daily-rollup schema in Postgres: one row per order, one row per line, and pre-aggregated daily totals per company and per product, with money held as fixed-point numeric rather than floating point. Shopify populates it two ways — webhooks for live orders, and a resumable cron for history — and every write is expressed as a delta against current stored state, which is what makes replay safe. Reporting reads the rollup when it is complete and degrades to paging the Admin API when it is not, with every response labelling which source produced it so the interface can be honest about it. The frontend is deliberately unbuilt: four hand-written HTML pages with no framework and no build step, served with an ETag derived from file modification time, backed by a small client-side cache that canonicalises URLs so differently-ordered query parameters hit the same entry. Authorisation is three-layered, because Shopify's own model is insufficient here — OAuth proves which shop, a decoded App Bridge session token proves which user, and a per-rep PIN gates commission figures, since identity from the embedded app alone is self-asserted.