Project

Farm Expense Tracker

A farm management app to track expenses across production cycles for pig fatteners and breeders.


Farm Expense tracker screenshot

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

TechnologyDescription
React 19UI library with server components and modern React patterns
TypeScriptType-safe JavaScript
Vite 7Fast dev server and build tool
Tailwind CSS 4Utility-first CSS framework
shadcn/uiAccessible component library built on Radix UI primitives
SupabaseOpen-source Firebase alternative — PostgreSQL database, auth, and API
TanStack React Query 5Server state management and data fetching
TanStack React Table 8Headless UI for building sortable data tables
Zustand 5Lightweight client state management
React Hook Form + ZodPerformant form validation with schema-based typing
React Router 7Client-side routing
date-fnsDate utility library
sonnerToast notifications
lucide-reactOpen-source icon library