Grupo Andreazzi — multi-company back office with a WhatsApp bot.
A single-database multi-tenant portal where each company of a business group gets its own branded workspace: finance, sales, planning, files and an encrypted password vault — plus a conversational WhatsApp bot that answers and records on behalf of the portal.
- Client
- Grupo Andreazzi
- Period
- 2026
- Role
- Architect & lead developer
Domain models
~60
Application code
~37k LOC
Roles in the matrix
7
Scheduled jobs
5
The problem
A business group is several companies that share people but not numbers. Running one system per company means reconciling spreadsheets at the end of every month; running one shared system means a finance lead of company A can read company B by accident. Neither is acceptable.
And the people who generate most of the data — the ones approving a payment, closing a checklist, confirming a meeting — are not going to open a laptop to do it.
The solution
One portal, one database, hard tenant isolation. Every company gets a slug-scoped workspace covering payables and receivables, categories, bank accounts, sales channels and goals, tasks, meetings, checklists, quarterly objectives, a calendar, file storage and a password vault.
- Per-company theming. Each company carries its own brand colours, injected as CSS variables at the layout boundary — the same screen reads as a different product in each workspace.
- WhatsApp bot. The parts of the job that happen away from a desk happen in a conversation instead: the bot understands intent through Claude, respects the same permission matrix as the web portal, and writes to the same tables.
- Notification engine. Rule-based alerts, subscriptions, and a templated daily digest, driven by five cron routes.
Architecture
A Next.js monolith with a deliberately thin seam: everything tenant-scoped flows through a single company-context resolver and a role × module × action permission assertion. Seven roles, an explicit matrix, and a super-admin bypass that is itself auditable.
- Money is never a float. Decimal columns and decimal.js throughout, by project convention — an income statement that disagrees with itself by a cent is worse than no income statement.
- Bank reconciliation. OFX statement parsing with its own test suite, matched against booked entries.
- Vault. Shared credentials encrypted with AES-256-GCM under a master key held outside the database.
- Bot observability. Sessions, logs and raw messages are persisted, with an admin screen to watch conversations in flight — a conversational interface you cannot observe is a conversational interface you cannot fix.
Results
The group runs its finance, commercial and planning routines in one place without any company being able to see another. The monthly close stopped being a spreadsheet merge, and the data that used to arrive late — or not at all — now arrives as a WhatsApp message the moment it happens.
Full stack