![]()
About
Farm Expense Tracker is purpose-built for small to mid-scale pig farms. Instead of spreadsheets or generic accounting tools, it organizes your farm around production cycles — each batch of pigs you raise from purchase to harvest.
A Cycle represents a group of pigs (fatteners or breeders) started on a given date. You track every expense tied to that cycle: feeds, medicines, and other costs. When the cycle finishes, you record a Harvest — this closes the cycle and makes it read-only. The dashboard aggregates statistics across all cycles so you always know your active capital, total heads, and expense breakdowns at a glance.
Features
- Cycle Management — Create, edit, and delete production cycles. Each cycle tracks number of heads, initial capital, purchase date, and status (ongoing / completed).
- Expense Tracking — Log expenses by type (feeds, medicine, other) with name, quantity, amount, description, remarks, and purchase date.
- Harvest Recording — Record a harvest to mark a cycle complete. Deleting a harvest reopens the cycle for further expenses.
- Data Tables — Sortable, filterable tables for cycles and expenses with per-column sorting and row actions.
- Statistics Dashboard — Aggregate views showing total cycles, active capital, total number of heads, and expense summaries.
- Role-Based Access — Admin and user roles managed through Supabase authentication.
Tech Stack
| Technology | Description |
|---|---|
| React 19 | UI library with server components and modern React patterns |
| TypeScript | Type-safe JavaScript |
| Vite 7 | Fast dev server and build tool |
| Tailwind CSS 4 | Utility-first CSS framework |
| shadcn/ui | Accessible component library built on Radix UI primitives |
| Supabase | Open-source Firebase alternative — PostgreSQL database, auth, and API |
| TanStack React Query 5 | Server state management and data fetching |
| TanStack React Table 8 | Headless UI for building sortable data tables |
| Zustand 5 | Lightweight client state management |
| React Hook Form + Zod | Performant form validation with schema-based typing |
| React Router 7 | Client-side routing |
| date-fns | Date utility library |
| sonner | Toast notifications |
| lucide-react | Open-source icon library |