AgritechReact NativeExpressCase Study

Poultry Manager: Running a Broiler Farm from a Phone

Inside Poultry Manager — a broiler farm operations system with an Expo app and Express/Prisma API, live at poultry.linton.co.zw. Read the case study.

Tinotenda Linton
2 min read

A broiler farm doesn't pause because the record book went missing. Poultry Manager digitizes the daily operations of a real broiler business — and the interesting part isn't the tech stack, it's the domain rules. This post is mostly about those.

The domain rules

Broiler farming has hard constraints, and the system encodes them literally:

  • Six-week (42-day) batches, with sales opening at day 35
  • Derived sellable inventory: liveBirds = chicksAcquired − mortality − sold — computed, never hand-entered
  • FIFO allocation — orders pull from the oldest eligible sellable batch first, with an admin override when reality disagrees
  • Overselling is prevented in database transactions, and cancelled orders release their reserved birds back
  • Partial payments and cancelled-order flows are first-class, not afterthoughts

Batches move through phases (BROODING → SELLABLE → CLOSEOUT → CLOSED) with generated codes like BATCH-20260326-001. Each batch carries mortality logs, feed records (type, brand, unit cost), health interventions (vaccines, medication, supplements with next-due dates), expenses across 11 categories, and daily observations (weight, water, temperature).

Accountability by design

Three roles — ADMIN, STAFF, VIEWER — with users created by admins only, and an AuditLog model on every key action. Reporting covers batch profitability, mortality rates, feed cost, receivables, and sales by date range, with KPIs like active batches, birds alive, birds sellable now, total batch cost, revenue, gross profit, and outstanding balances.

The stack

The API is Express 5 with modular route and service layers, Prisma 7 on a Neon Postgres adapter, Auth.js as a credentials bridge plus mobile token endpoints, Zod validation, and server-side PDF receipts with @react-pdf/renderer — logos and receipts stored in Vercel Blob. It exposes an OpenAPI document at /api/v1/openapi.json and runs at poultry.linton.co.zw.

The client is an Expo Router app with bottom tabs (Dashboard, Batches, Sales, More), one-time onboarding, system-theme-first light/dark, and an edge-to-edge Android layout with a floating translucent tab bar. One detail I'm fond of: API reads fall back to bundled demo data when the server is unreachable (typed from the OpenAPI spec) — the app demos itself, and the farm team never sees a blank screen.