Contract farming and agri-lending platform
Feed is extended to pig farmers on credit, the farm's performance is measured against a standard growth curve, the animals are sold, and the debt is collected — one platform covering the whole loop, for farmers, dealers and head office.
- Express
- TypeScript
- PostgreSQL
- Sequelize
- React
- Redux
- MUI
- Azure
- Docker
- Kubernetes
Overview
Contract farming is a lending business wearing a farming hat. The company supplies feed on credit, the farmer raises the animals, the company buys them back, and the debt is settled out of the sale. Every part of that loop needs measuring, because the thing securing the loan is livestock whose value depends on how well it is being raised.
Three audiences share the system. Farmers use a mobile-first app to register farms and houses, log feed and mortality daily, order feed on credit and watch their debt. Dealers accept orders, prove shipment and manage collections assigned to them. Head office approves credit, issues invoices, chases them and maintains the master data.
The parts that were interesting to build
A credit rubric that is data, not code. Scoring a farmer covers personal and legal standing, the farm itself, its measured performance, financial status and app usage. Each segment is stored as configuration with its own weighting and checklist, and the grade bands are configurable too. Two things follow. Policy changes without a deployment. And every application stores a frozen copy of the rubric as it was applied alongside the answers, so a decision made two years ago can still be explained after the policy has moved on.
Performance measured against a curve, not a number. A reference table holds what a healthy house should look like at each week of age: feed conversion, body weight, cumulative gain. Daily logs are rolled up into actual conversion ratio, average daily gain and cost per gain, each compared against the standard for that age and graded on how far it deviates. The three grades reduce to one house grade by majority — which is also an input back into the credit score, closing the loop between how well someone farms and how much credit they are offered.
Two front doors for authentication. Farmers register through an SMS one-time code with a short verification window, then set a PIN; staff authenticate against the corporate directory. Three separate guards protect the three route trees, with role checks layered on top.
Scale
- 483 routes across farmer, dealer and admin trees · 73 models · 83 migrations
- 148 screens · 55 services · four nightly jobs that move contracts, invoices and notices forward
- Bilingual, with uploads going straight to blob storage through pre-signed URLs
- Status
- Published
- Published
- Sep 12, 2026
- Stack
- Express · TypeScript · PostgreSQL · Sequelize · React · Redux · MUI · Azure · Docker · Kubernetes
Keep exploring

