AgiotaLegal
Charges and subscriptions for small businesses, with Pix on every charge and a reminder by WhatsApp or email.
Own product · Billing · Node.js
Images
Context
AgiotaLegal is a multi-tenant billing system. A business registers what it sells, attaches customers, and the system creates the charge on the due date, with Pix and a reminder.
The web app is in Portuguese and English. The browser talks only to Next.js. The Express API sits behind it.
Problem
The charge has to go out on the right day, carry a Pix code, and tell the customer before and after the due date, with no per-transaction fee and no payment gateway.
What I did and why
pnpm monorepo. The web app is Next.js 16 and React 19, on Vercel, behind Cloudflare. The API is Express 5, Prisma 6, and PostgreSQL 16, on Railway, with a BullMQ and Redis worker in the same codebase. Contracts live in Zod, in a shared package. The schema has 13 models.
A service can be a one-off, weekly, monthly, yearly, or every N days. A subscription can carry its own amount per customer. Amounts are stored in cents, from R$ 0.01 to R$ 1,000,000.00. A charge is created 7 days before it is due. It becomes overdue at the end of that day, in the account time zone.
Pix is a static BR Code, built on read from the account key, the amount, and the charge id. It is not stored. Settlement is manual, because there is no gateway.
The default channel is manual WhatsApp: the system prepares the text and a wa.me link, and the user sends it. Email and the Meta API are there too. A message goes out only when the customer has consented.
Passwords use argon2id, with TOTP 2FA and an opaque session in an httpOnly cookie. Secrets use AES-256-GCM. Domain tests in the repo have a 90% floor.
Outcome
No public domain yet. Usage numbers: [PREENCHER].