COMMERCIAL PLATFORM
A B2B industrial services company needed one place to hold the commercial side of its operation: lead capture from the public site, quotations, invoices, clients and reporting.
A statically prerendered public site with a lead-capture form, and an internal portal for the commercial team. The public site and internal portal share one codebase.
Open the caseClose the case
Overview
The public site is statically prerendered for speed and SEO. A quotation form on that site captures B2B leads and writes them to Supabase. Behind authentication, the commercial team works those same records: leads, quotations, invoices, clients, certificates, machinery and reporting.
The problem
The project started from an operating problem, not from a software specification. Before any code, the existing commercial workflow was mapped with the client: how a lead arrives, who touches it, what information it carries, and at what point it becomes a quotation and then an invoice.
Constraints
- Client confidentiality: pricing, customer data and commercial rules stay private.
- Chilean rules come built in: RUT check digits, CLP, 19% VAT, invoice states.
- Access has to hold at the data layer, not only in the interface.
- The team had to adopt it without relearning their own process.
Key decisions
- Domain logic lives in its own layer, not in components. RUT check digits, CLP and VAT arithmetic, invoice state transitions and lead scoring have unit tests. Those are the things that are objectively right or wrong, and the things a client notices when they break.
- Access control also lives in the database, through Row Level Security.
- One command runs the release checks in order: typecheck, tests, build.
- GA4 and Meta Pixel only render when their key exists. No key, no script.
- Tax integration was left out of the first version on purpose: entry is manual.
- The illustrations on the public site are generated as vectors by a script in the repo. Not stock, not AI images.
Where AI is used
Nowhere at runtime. This is deterministic business software: the value was in modelling the process correctly, not in putting a model inside it. AI was used to build it, not to run it.
Status
What I would improve next
Reporting the commercial team can read without asking me, and a clearer audit trail on quotation and invoice state changes. The domain layer has its tests; the next ones go in the surface around it.














