From Paper Logs to Full-Stack Agri-Tech: How I Built the 'Uni-Farm Hub' Broiler Management System
Author: Reynan M. Maglimolo | Published: June 5, 2026
Welcome back to OffGridCoding. If you follow this blog, you know I spend a lot of time working with PHP to build robust web applications. But recently, I took on a project that required bridging the gap between web software and physical hardware.
The agricultural industry—specifically commercial poultry and broiler farming—is notoriously behind the tech curve. Many medium-sized farms still rely on clipboards, whiteboards, and gut feeling to manage thousands of birds. I wanted to build a solution.
Enter Uni-Farm Hub: an enterprise-grade, full-stack Agri-Tech application designed to completely automate broiler farm management, from genetic growth tracking to live IoT climate telemetry. Here is a look under the hood at how I built it.
The Architecture: Why Django and React?
While PHP is a fantastic tool for traditional web routing, this project required heavy data science calculations (like calculating exact European Production Efficiency Factors or EPEF) and seamless integration with hardware microcontrollers.
Because of this, I opted for a decoupled architecture:
- The Backend: Python and Django REST Framework. Python’s ecosystem is unmatched when it comes to data processing and handling asynchronous hardware payloads.
- The Frontend: React and Tailwind CSS. The farmhands needed a mobile-first, highly responsive Progressive Web App (PWA) that they could use on the dirty floor of a poultry house without waiting for page reloads.
- The Hardware: ESP32 Microcontrollers serving as IoT edge devices.
Core Feature 1: Real-Time IoT Climate Telemetry
Broilers are incredibly sensitive to their environment. A sudden spike in temperature or ammonia (NH3) levels can wipe out an entire flock in hours.
To solve this, I built a simulated edge device using Python (requests library) that acts exactly like a physical ESP32 sensor. It runs in an infinite loop, pushing temperature, humidity, and ammonia readings to the Django backend every 60 seconds via secure token authentication.
The React frontend polls this API and displays the data on a live dashboard. But a passive dashboard isn't enough—if the temperature hits 32.0°C (Heat Stress), the Django backend intercepts the database save and triggers the Twilio API, instantly firing an SMS text message to the Farm Manager's phone.
Core Feature 2: Automated Biosecurity & Withdrawal Locks
In commercial farming, biosecurity is a legal liability. If a flock is given an antibiotic like Amoxicillin or Vetracin, they cannot be legally harvested until the drug has completely metabolized out of their system (the Withdrawal Period).
Instead of relying on a calendar, I built a Treatment Ledger into the relational database. When a farmhand logs a medication on their phone, Django automatically calculates the safe harvest date. The React dashboard then places a hard UI lock on that flock with a bright red banner: "WITHDRAWAL ACTIVE - DO NOT HARVEST." This entirely removes human error from a critical compliance issue.
Core Feature 3: Unit Economics and Logistics
Farmers don't just grow birds; they grow profit margins. The app features a complete logistics module that tracks warehouse feed inventory in real-time.
Every time a farmhand logs daily feed consumption, the system deducts it from the warehouse and calculates the exact monetary cost. The dashboard dynamically displays the Cost per Surviving Bird. Before a farm manager even sits down to negotiate with a poultry buyer, the app tells them exactly what their break-even price per kilogram is.
The Next Steps: Turning an MVP into a Product
Building "Uni-Farm Hub" as a solo developer has been an incredible journey across the full stack—from database schema design and Token Auth (RBAC) to React hooks and Twilio SMS integration.
The next phase is deploying a turnkey hardware bundle. Instead of just selling software, the goal is to provide farms with a rugged, waterproof ESP32 sensor box that plugs directly into the wall and acts as the physical anchor for the cloud subscription.
Have you ever integrated IoT hardware with a web backend? Let me know your preferred stack in the comments below!
Discussion
No comments yet. Be the first to start the discussion!