Aviarai
A poultry farm’s whole day (eggs, feed, dispatch, billing) running through one system used by 30+ farms and 70+ people.
Subscriptions, inventory, dispatch and supply orders lived in spreadsheets and separate tools that didn’t agree with each other.
- Farmers + staff (human)
- Farmer app: works offline (step)
- Admin dashboard (step)
- Offline queue (store)
- Gateway (step)
- Core service (step)
- Sales service (step)
- Database (store)
- ML service (AI)
- Payments (output)
- Step 01
RBAC across 4 roles and 13 feature-level permissions, enforced in the backend and gated in the UI.
- Step 02
Subscription billing end to end: Stripe + Paystack behind one abstraction, trials, seats, cron-driven renewals, full audit trail.
- Step 03
Concurrent stock validation so parallel writes can’t corrupt inventory.
- Step 04
A cross-service supply-order system bridging the Sales service with inventory.
- Step 05
Staging + production on DigitalOcean with Docker and CI/CD across 4 repos.
Auth timing out wasn’t traffic
A too-broad @Transactional held DB connections for the whole call and exhausted HikariCP. Narrowed the scope, retuned the pool: outage resolved in ~1.5h, then a postmortem.
Some failures don’t throw
A successful Paystack payment could leave a subscription stuck. Replaced exception-driven retries with upserts, idempotent by construction.
Delta-based billing
Fixed a double-charge pricing defect as part of a 13-edge-case billing sweep.
When auth started timing out
Auth requests started timing out under load. The obvious suspect was traffic. It wasn’t.
A @Transactional placed too broadly on the auth path held a database connection for the whole call. HikariCP wasn’t overloaded, it was exhausted: every connection in use, doing nothing. Full outage, everyone locked out.
Fix: Narrowed the transaction scope, retuned the pool to real usage, resolved in ~1.5 hours, and wrote a postmortem.
If a bug can only be patched by catching more exceptions, the bug is the control-flow model underneath.
- Check a spec’s stated invariant against a case the writer didn’t think of before hard-coding it. A payment-status rule held only because of the examples chosen to illustrate it.