Precinho
A price comparison app for one city. Ten supermarket chains, one search box. You
type a product and you see what every shop near you charges for it right now,
cheapest first, with a link straight to that item on the shop’s own site. The
prices come from the chains themselves. A job runs every night and writes a new row
instead of overwriting the old one, so every number on screen has a date and a time
attached to it.
The screen was the easy half. The ten chains run six different e-commerce platforms
between them, so each one gets its own adapter behind a single interface. Prices also
turn out to be regional, which none of the chains tell you. The same company charges
different amounts in different towns, and proving that meant checking each
chain’s answers against a control address 3,000 km away, because an
endpoint compared against itself will always agree. One chain only respects the
branch you ask for if you send it as a cart id. The other twenty-four ways of sending
it are accepted and quietly ignored.
Then there is the matching. The same bottle of olive oil carries a different name in
every shop, so the app tries the barcode first, then the package size, and hands
whatever is left to a language model to judge. 44,929 pairs went through that and
every verdict is stored, so the next collection inherits the work instead of paying
for it again.
Underneath it is Clean Architecture with the dependency rule pointing one way, 669
tests across unit, integration and component suites, coverage thresholds enforced in
CI, structured logs and metrics on every read, and Big O written next to the
decisions that needed it. The whole thing runs on free tiers. Postgres cancels any
query that takes longer than three seconds, which sounds like a limitation but kept
me honest. Every slow query had to be measured and fixed instead of tolerated.
- Next.js
- TypeScript
- Tailwind
- Supabase
- PostgreSQL
- Vitest