Dairy Farm ERP
An internal mobile ERP for a dairy farm: herd health, milk, buyers, payroll, and investor shares in one record, without a public store listing.
Sonali Dairy Farm
Savar, Dhaka
Freelance Mobile Engineer
Freelance · Production
Cross-Platform Flutter Engine
Private / enterprise distribution

Private farm system · herd, milk, sales, payroll, and investments
Used by the farm. No Play Store or App Store release
Health, yield, sale, invoice, and outstanding stay connected
Investor percentages follow capital and period, not a fixed table
Payments are recorded. The app does not move the money
Executive Summary
Dairy Farm ERP is the system Sonali Dairy Farm uses to run the day. Livestock, milk, sales, buyers, staff, payroll, and investors used to be separate books. The app puts them on one phone so a manager can see the farm, and a milker can enter the morning session without sitting at a desk.
I built the mobile workflows as a freelance engagement: a profile per cow, production by session, a sale that becomes an invoice and an outstanding balance, weekly and monthly pay with loans and leave, and investment shares that are recalculated when capital or the period changes. It is a record. It does not take card payments or send wages.
The hard part was the relationships, not the screens. A sick cow changes yield. Yield becomes a sale. A sale becomes what a buyer owes. What the farm earns is what the investors split. The interface had to stay plain enough for people whose job is the shed, not the software.
The Challenge
The Challenge: A Farm’s Books Do Not Split Cleanly into Modules
The farm needs the herd, the milk, the buyers, the staff, and the investors at the same time. Kept apart, those records stop agreeing. Put into a typical desktop ERP, they become something the people in the shed will not open.
Each Cow Is a History, Not a Headcount
Staff need the tag, the breed, whether she is milking or dry, the insemination date, the expected calving, the next vet visit, and what the doctor wrote. A total of “48 cows” does not answer any of that.
Milk Only Matters Once It Is Sold
Morning and evening litres have to meet a buyer, a rate, a payment, and an invoice. Bulk buyers and a tea stall are not the same kind of account, and both can owe money.
Pay Is Not One Number
Some staff are weekly, some monthly. Loans, overtime, and leave change what is actually payable. The app has to keep the calculation. It does not transfer the wage.
Investor Shares Move
Ownership is not a poster on the wall. Extra capital, a smaller stake, or a new period changes how profit is split. The history has to exist before the percentage is applied.
Project Scope
Engineering Objectives & Delivery Scope
- Give managers one mobile view of cows, today’s milk, sales, receivables, and revenue.
- Keep an individual record per cow: identity, yield, health, and reproduction from insemination to expected calving.
- Record morning and evening milk by cow, including litres that must be discarded.
- Turn a sale into quantity, rate, payment, invoice, and a running buyer balance.
- Separate company, regular, and bulk buyers from individual customers, with vendors in the same area.
- Run weekly and monthly payroll, with loan instalments and leave on the same employee.
- Calculate investor profit from capital share, and keep that share able to change by period.
- Stay a private farm tool: records and calculations, no payment gateway, no public store listing.
Engineering Foundation
Architecture & Technical Design
Flutter is the field client. The modules share one operational record: a cow’s yield is the milk that can be sold, a sale is an invoice and a balance, and farm profit is what the investor shares are applied to. Firebase holds the data. Money is written down here. It is not collected here.
Cow → Milk → Sale
Livestock status, the session total, and the buyer invoice are the same day’s work. Home opens on today’s milk and the jobs that produce it: record milk, a sale, a vet visit, a payment.
Buyer Ledger
Each sale stores quantity, rate, amount paid now, and the previous balance. The buyer screen is a statement: invoices as debits, payments as credits, balance after each line.
Payroll as a Calculation
Weekly and monthly staff, days worked, overtime, and a loan instalment produce a net payable. Leave and advances sit on the same person as approvals, not in another app.
Share by Period
Profit for a quarter is split by the capital share in force for that period. A later investment or a changed percentage does not rewrite the earlier split.
Screen Walkthrough
The product, in the order a user moves
Production screens from the live apps, framed as a journey rather than a pile of captures. Follow them from the first screen to the last action.
Follow the journey →
Deep Dive
Key Technical Implementations
Detailed breakdown of core features addressing complex mobile engineering requirements.
The Farm, Before the Modules
What a manager needs at evening milking
Home is the jobs of the day, not a wall of modules. Today’s milk and what sold sit behind one tap. Under that are the things staff actually open: record milk, a new sale, a vet visit, the herd, buyers, a payment, payroll, and investments. A calving that is days away is the alert on the same screen.
- Today’s litres and sales, revealed when you need them
- Record milk, sale, vet, payment, payroll, and investments as the first actions
- A calving alert so the next event is not buried in a profile

A History on the Tag
Insemination, due date, vet, and yield
The herd list is filterable by milking, pregnant, dry, and sick, and each row already says what is next: a pregnancy check, an expected calving, a vet follow-up. Open the cow and the reproduction record is the chain the farm actually keeps: when she was inseminated, how far along, the expected date, and the appointments still ahead. Yield for that animal sits under the same profile, so health and production are not two files.
- One profile per tag: breed, shed, lactation, status
- Insemination through expected calving, with the next check dated
- That cow’s litres beside the medical and reproductive history

From the Shed Meter to the Invoice
Quantity, buyer, rate, payment, balance
A session is morning or evening, by shed: the top producers one by one, the rest as bulk from the can. The production screen then shows where those litres went: sold, kept for calves and the farm, or still in the chiller. A sale picks the buyer, the litres, and the rate, and writes the invoice and the new balance. The statement afterwards is invoices and payments, with the balance after each line. A payment is a receipt for cash, bKash, or a bank transfer that already happened. The app does not move the money.
- Morning and evening by shed, with bulk litres from the can
- Where the day’s milk went: sold, kept, or still in the chiller
- Invoice, statement, and a payment receipt, with no gateway

Weekly Pay, Monthly Pay, and the Loan
The wage is a calculation on the person
Staff are not one payroll run. Milkers can be weekly; the manager and driver monthly. Open a person and the week is days worked, overtime, and the loan instalment taken off, down to a net payable someone can mark as paid. Leave and an advance sit there as approvals, so workforce admin does not leave the farm app for a spreadsheet.
- Weekly and monthly arrangements on the same staff list
- Loan balance reduced through the pay calculation
- Leave and advances approved against that employee

Profit Split by the Share That Period
10, 20, 30, and 40, until the capital changes
Four investors, four stakes, profit for the quarter divided by those stakes. That matches how the farm described ownership. Revenue, costs, and margin for the period sit on the same screen as the distribution, so the profit being shared is the farm’s result, not a number typed beside the cap table. Additional capital or a changed stake applies going forward. The earlier quarter keeps the shares that were true then.
- Quarter profit divided by each investor’s capital share
- Shares can change with new capital or a new period
- Farm P&L sits beside the distribution, not in another book

Hurdles & Solutions
Technical Challenges & Trade-Offs
Real production obstacles overcome during engineering and deployment.
Livestock, milk, sales, staff, and investors are one business
Modeled the day as connected records: a cow’s yield, a session total, a sale, a buyer balance, and a profit figure that investor shares are applied to.
A manager can move from “she is sick” to “what did we sell” without reconciling five notebooks.
Ownership percentages change, and old periods must stay correct
Kept investment history and applied the share in force for that period when distributing profit.
A new cheque from an investor changes the next split. It does not rewrite the last quarter.
An ERP on a phone is easy to make unusable
Put today’s milk and the daily jobs (record milk, new sale, vet visit, payment) on home, with the herd, buyers, payroll, and investments one tap behind that.
Shed staff reach the job they came to do. The rest of the modules stay behind it.
Payroll and buyer payments are financial, but the app must not move money
Recorded cash, bKash, bank, and cheque against invoices and wages, and calculated net pay including loan instalments. No gateway.
The books match what the farm already did with cash and the bank. The app is the ledger.
Outcomes
Impact & Production Outcomes
Dairy Farm ERP replaced separate livestock notes, milk sheets, buyer accounts, and payroll lists with one internal app for Sonali Dairy Farm. Staff record the session and the sale in the shed. Managers see what is owed, what the month made, and how that profit divides. The app keeps the books. It does not send the money.
Internal production app. Not listed on the stores
Cows, milk, buyers, staff, and investors in the same client
Invoices, outstanding, and net pay calculated on device
Profit shared on the capital percentages for that quarter
Technology Breakdown
Tools, Frameworks & Libraries
Categorized technical stack employed to achieve reliability, performance, and store compliance.