Smart Dairy Farm Management System for African farmers A comprehensive digital platform that helps dairy farmers track milk yields, monitor herd health, manage finances and grow their business all in one place.
# 🐄 MilkFlow — Dairy Farm Management System
A complete Django web application for dairy farm management.
## 📸 Screenshots
## Tech Stack
- **Backend**: Django 4.2+ with SQLite3
- **Frontend**: HTML5, CSS3, Vanilla JavaScript
- **Charts**: Chart.js (CDN)
- **PDF Reports**: ReportLab
- **Auth**: Django built-in authentication
## Models
| Model | Description |
|-------|-------------|
| `Farm` | Farm profile linked to user |
| `Cow` | Individual cow records with breed, status, age |
| `MilkRecord` | AM/PM daily milk yields per cow |
| `HealthEvent` | Vaccinations, treatments, deworming |
| `FinancialTransaction` | Income & expense ledger |
| `ScheduledTask` | Task reminders with due dates & priority |
| `Employee` | Farm worker records |
## Quick Setup
### 1. Install dependencies
```bash
pip install django reportlab
```
### 2. Run migrations
```bash
cd milkflow_django
python manage.py migrate
```
### 3. (Optional) Create a superuser for Django admin
```bash
python manage.py createsuperuser
```
### 4. Start the development server
```bash
python manage.py runserver
```
### 5. Open in browser
```
127.0.0.1
```
## Features
### Dashboard
- Total active cows, today's milk yield, running balance, overdue tasks
- 7-day milk production trend chart (Chart.js)
- Upcoming tasks list with overdue warnings
- Recent transactions and health events
- Quick action buttons
### Cow Management
- Full CRUD with search and status filtering
- Breeds: Friesian, Ayrshire, Jersey, Guernsey, Holstein, Crossbreed
- Age auto-calculation from date of birth
- Individual cow detail page with milk history and health events
### Milk Recording
- AM + PM yield entry with live daily total calculation
- Per-cow or general herd records
- Filter by date range and cow
- Pagination for large datasets
### Financial Ledger
- Income categories: Milk Sales, Animal Sales, Manure, Grants, Other
- Expense categories: Feed, Veterinary, Labor, Equipment, Utilities, Transport, Bre …