A Progressive Web App designed for Nigerian poultry farmers to digitize farm operations, make data-driven decisions, and optimize productivity.
Traditional poultry farming in Nigeria relies on paper records which are:
- Prone to loss/damage during rainy seasons
- Difficult to analyze for trends and insights
- Inaccessible when farmers are away from the farm
- Unable to provide early warnings for disease outbreaks
FarmTrack provides a mobile-first web application that:
- Works offline via Progressive Web App (PWA) technology
- Tracks daily metrics: feed usage, mortality, egg production, and sales
- Provides AI-powered insights specific to Nigerian market conditions
- Generates proactive alerts for mortality spikes and production drops
- Is installable on low-end Android devices without Play Store dependency
- 📊 Dashboard with stats cards and weekly charts
- 📝 Daily Logs for feed, mortality, production, sales
- 🐔 Batch Management for multiple flocks
- 💰 Expenses tracking
- 📦 Inventory management
- 🤖 AI Consultant powered by Gemini API
⚠️ Smart Alerts for mortality/production issues
- PWA Support: Installable on mobile devices with offline capability
- Demo Mode: Try the app without creating an account
- Real-time Auth: Supabase authentication with email verification
- Responsive Design: Mobile-first with Tailwind CSS
| Category | Technology |
|---|---|
| Framework | Next.js 16.2.2 (App Router) |
| Language | TypeScript 5 |
| UI Library | React 19 |
| Styling | Tailwind CSS 4 |
| Database | Supabase (PostgreSQL) |
| Authentication | Supabase Auth |
| AI | Google Gemini 1.5 Flash |
| Charts | Recharts |
- Clone and install:
git clone <repo>
npm install- Create
.env.local:
NEXT_PUBLIC_SUPABASE_URL=your-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-key
NEXT_PUBLIC_GEMINI_API_KEY=your-key- Run dev server:
npm run dev- Build for production:
npm run build├── app/
│ ├── page.tsx # Landing page with hero section
│ ├── layout.tsx # Root layout with PWA meta tags
│ ├── dashboard/ # Main dashboard
│ ├── login/ # Authentication
│ ├── register/ # User registration
│ ├── batches/ # Flock management
│ ├── expenses/ # Financial tracking
│ ├── inventory/ # Stock management
│ └── ~offline/ # Offline fallback page
├── components/
│ ├── dashboard/
│ │ ├── StatsCards.tsx # Metric cards (Revenue, Loss, Yield)
│ │ ├── AIAlerts.tsx # Alert notifications
│ │ ├── AIConsultant.tsx # AI chat interface
│ │ └── WeeklyPoultryChart.tsx # Production chart
│ ├── forms/
│ │ └── DailyLogForm.tsx # Daily record input
│ └── ui/ # Reusable components
├── hooks/
│ ├── useAuth.ts # Authentication logic
│ ├── useFarmData.ts # Data fetching hooks
│ └── useAI.ts # AI integration
├── lib/
│ ├── supabase.ts # Supabase client
│ └── api/ # API functions for each entity
└── types/
└── index.ts # TypeScript types
-- Farmers table
farmers (id, email, phone, name, farm_type, created_at)
-- Daily records
daily_records (id, farmer_id, feed_bags_used, feed_cost, mortality_count,
production_amt, sales_amount, record_date, created_at)
-- Batches (flocks)
batches (id, farmer_id, batch_name, animal_type, initial_count,
current_count, acquired_date, created_at)
-- Expenses
expenses (id, farmer_id, category, description, amount, expense_date)
-- Inventory
inventory (id, farmer_id, item_name, quantity, reorder_level, created_at)
-- Alerts
ai_alerts (id, farmer_id, alert_type, title, message, severity, is_read)- Push code to GitHub
- Import project to Vercel
- Add environment variables in Vercel dashboard
- Deploy!
- Create new Supabase project
- Run migration SQL for tables above
- Enable email authentication
- Configure email templates with redirect URL
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this project for learning and commercial purposes.