Central multi-application business API
One backend for the workshop, rentals, sales, invoicing and bank reconciliation
Key figures
- lines of code
- ~37,000
- automated tests
- ~280
- data models
- 44
- endpoints
- ~250
Context
The workshop, rentals, sales, invoicing, bank reconciliation and inventory all had to run on a single backend. That backend serves 7 internal applications, the showcase website and the online store.
My role
From design to operations, fully autonomously.
Solution
Routes are organised by consuming application: around 250 endpoints, backed by 44 Prisma models. The API generates quotes as PDFs and has them signed online through a single-use token link. It also issues payment requests with a bank transfer QR code, automatically reminded then cancelled.
Service invoices are pushed to the ERP without blocking the local action, and an idempotent invoicing gateway serves the online store. Bank reconciliation runs in a worker thread using fuzzy matching. On top of that: calendar, documents, transactional e-mails and cache revalidation for the public website.
Key features
PDF quotes signed online
Customers sign their quote remotely through a single-use token link.
Bank transfer QR code payments
Payment requests with an EPC QR code, plus automatic reminders and cancellations.
Idempotent invoicing gateway
The online store can replay an invoicing request without ever creating a duplicate.
Background bank reconciliation
Fuzzy matching runs in a worker thread, so request handling is never blocked.
Engineering challenges
- 1
PostgreSQL transactional locks
Advisory locks acquired in a consistent order rule out deadlocks.
- 2
Strict data model and contracts
44 Prisma models, 115 migrations and strict Zod contracts.
- 3
Server-side OIDC SSO
PKCE, HttpOnly sessions, tokens encrypted at rest and back-channel logout.
- 4
CI-driven authentication switch
Legacy, dual or OIDC modes, switchable from CI to migrate without anyone losing access.
Tech stack
- Backend
- Node.jsExpressTypeScriptZodWinstonnode-cron
- Data
- PrismaPostgreSQL 16
- Security
- jose
- Integrations
- @react-pdfsharpExcelJS
- Infrastructure
- DockerGHCR
A project of this scale?
Let's talk about your context: I'll tell you frankly what is feasible, and how long it takes.