Client reporting platform
Automated Multi-Client Marketing Reporting
Monthly multi-client reporting from GA4, Google Ads, Shopify, Klaviyo, and WordPress where numbers never come from the LLM.
stack: Next.js · PostgreSQL · pg-boss · SQL Window Functions · JSON Schema Validator · Chromium PDF · Postmark · Docker Compose / Coolify
Built for Front Row's digital division. Client details withheld.
01 / Problem
The problem
Monthly agency reporting across five disconnected marketing and commerce platforms breaks down when provider rate limits interrupt backfills or manual spreadsheets introduce calculation drift.
Using an LLM to draft client commentary creates unacceptable hallucination risk unless every number is computed deterministically and validated before a human ever sees the draft.
02 / Architecture
The build
- Five connectors (GA4, Google Ads, Shopify, Klaviyo, WordPress) with graceful degradation, a Postgres token bucket enforcing provider rate limits, and resumable 14-month backfill.
- Raw snapshots stored prior to normalization against a metric dictionary, with month-over-month and year-over-year computed via SQL window functions and checked by deterministic QA gates.
- LLM-written narrative constrained to a strict JSON schema with a fact validator and repair loop, flowing into a draft/edited/approved review queue.
- Immutable publications with restatements, Chromium PDFs, tokenized share links, and Postmark email delivery with bounce handling on Next.js, pg-boss, Postgres, and Docker Compose on Coolify.
03 / Diagram
System schematic
04 / Scope
Status & scale
Status
Deployed, pilot
Connectors
5 data sources
Backfill window
14 months resumable
Core rule
SQL metrics only
05 / Stack
Components
- Next.js
- PostgreSQL
- pg-boss
- SQL Window Functions
- JSON Schema Validator
- Chromium PDF
- Postmark
- Docker Compose / Coolify
06 / Writing
Related writing
- EDI 850 purchase order explained for engineersEDI 850 explained for engineers: the segments in an X12 purchase order, a worked example, how it maps to the 855 acknowledgment, and how to model it.
- EDI 856 (advance ship notice) explained for engineersEDI 856 explained for engineers: the BSN header, the HL shipment, order, pack and item hierarchy, the segments that matter, and how to model it safely.
- Product feed management: a custom feed engine for Merchant Center, Microsoft and MetaHow a product feed management engine was built for Magento and Merchant Center: CEL rules, pgvector enrichment, channel adapters and a parallel cutover.
- NetSuite Shopify integration: inventory sync with drift reconciliationA NetSuite Shopify integration with NetSuite as master: pending Shopify demand, certificate OAuth, compare-and-set writes and drift reconciliation.
- Offline conversion tracking for Google Ads: click IDs, hashed identities and GA4Offline conversion tracking for phone sales: three ways to send them back to Google Ads, the identifier each needs, and how to check the value is real.
- What is EDI? Retail X12 documents 850, 855, 856, 810 and 846 for engineersWhat is EDI? A working explanation of the five retail X12 documents, how they map to an order lifecycle, and where an EDI network like SPS Commerce fits.