// case file 07 · Software

Aviarai

A poultry farm’s whole day (eggs, feed, dispatch, billing) running through one system used by 30+ farms and 70+ people.

RoleBackend-primary, full-stackTimelineJun 2025 – Aug 2026StackSpring Boot + React30+farms in production
// 01 the problem

Subscriptions, inventory, dispatch and supply orders lived in spreadsheets and separate tools that didn’t agree with each other.

// architecture
Aviarai · platformactive
staging + production · Docker · CI/CD
  1. Farmers + staff (human)
  2. Farmer app: works offline (step)
  3. Admin dashboard (step)
  4. Offline queue (store)
  5. Gateway (step)
  6. Core service (step)
  7. Sales service (step)
  8. Database (store)
  9. ML service (AI)
  10. Payments (output)
// 02 how it works
  1. Step 01

    RBAC across 4 roles and 13 feature-level permissions, enforced in the backend and gated in the UI.

  2. Step 02

    Subscription billing end to end: Stripe + Paystack behind one abstraction, trials, seats, cron-driven renewals, full audit trail.

  3. Step 03

    Concurrent stock validation so parallel writes can’t corrupt inventory.

  4. Step 04

    A cross-service supply-order system bridging the Sales service with inventory.

  5. Step 05

    Staging + production on DigitalOcean with Docker and CI/CD across 4 repos.

// numbers I’d defend
10s → 2sKPI dashboard load
13billing edge cases caught
121backend services audited for logging
4 × 13roles × feature permissions
// 03 decisions that mattered
01

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.

02

Some failures don’t throw

A successful Paystack payment could leave a subscription stuck. Replaced exception-driven retries with upserts, idempotent by construction.

03

Delta-based billing

Fixed a double-charge pricing defect as part of a 13-edge-case billing sweep.

// incident

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.

// 04 results
30+registered farms
13billing edge cases caught
10s→2sKPI dashboard load
// 05 takeaway

If a bug can only be patched by catching more exceptions, the bug is the control-flow model underneath.

Spring BootReactMySQLDockerGitHub Actions
// what I’d do differently
  • 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.
// artefacts
// contact

Let’s talk

Open to software engineering and AI automation roles, plus selective contract work. I read every message.

psst, click it
● DRAFT

Show me the copy-paste.
I’ll tell you if it should be a system.

01
02
How often?
03
Which tools?

Hiring? Tell me about the team.
I’ll tell you where I’d help first.

01
02
03
Timeline
04

You get a reply within 24 hours: whether it should be automated, what I’d use, and a rough timeline.

You get a reply within 24 hours.