KetKat-EcoFarm is a Smart Farm Management System for farm operations, digital farm maps, livestock traceability, work planning, warehouse records, documents, notifications, and public QR lookup.
Demo website: https://kettailor.io.vn/smart-farm-management-system
Demo account:
Email: demo@kettailor.io.vn
Password: Demo@123456
The demo account is provided for evaluation only. Please do not enter private or sensitive data.
- Farm dashboard with operation summaries, data coverage, and traceability flow.
- Digital farm map with zones, resources, paddocks, water sources, and public sharing.
- Livestock groups, individual animal profiles, treatments, events, QR codes, and public lookup.
- Grazing plans, Gantt-style scheduling, activity history, and paddock rotation records.
- Work management with task items, assignment emails, status tracking, and notifications.
- Warehouse and chemical profile management for farm supplies and compliance records.
- User, role, document, and farm settings management.
- Public pages for farm map and livestock traceability.
- Framework: Next.js 14 App Router, React 18, TypeScript
- Database: PostgreSQL,
pg - Maps: MapLibre GL, Leaflet
- Charts/UI: Recharts, Sass, CSS Modules, Bootstrap assets
- QR/Scanning: ZXing, jsQR
- Runtime: Node.js 22.18+ and npm 10.8+
Clone the repository and install dependencies:
git clone https://github.com/Kettailor/CNM--Farm-Product-Traceability.git
cd CNM--Farm-Product-Traceability
npm installCreate a local environment file:
cp .env.example .env.localConfigure at least:
DATABASE_URL=postgresql://farmhub:farmhub@localhost:55432/farmhub
APP_URL=http://localhost:3000
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_APP_NAME=KetKat-EcoFarm
AUTH_SECRET=change-me-use-a-long-random-secret
NEXTAUTH_SECRET=change-me-use-a-long-random-secret
CRON_SECRET=change-me-cron-secretStart the development server:
npm run devOpen http://localhost:3000.
The PostgreSQL schema is available at:
database/FarmHub_schema.sql
If you use the included Docker Compose setup, PostgreSQL runs on 127.0.0.1:55432.
Common local database values:
Database: farmhub
Username: farmhub
Password: farmhub
Host: 127.0.0.1
Port: 55432
Start app, PostgreSQL, Adminer, and Nginx locally:
docker compose up --buildUseful URLs:
| Service | URL |
|---|---|
| App | http://localhost:3000 |
| Nginx | http://localhost |
| Adminer | http://localhost:8080 |
Stop and remove local containers:
docker compose downnpm run dev # Start local development server
npm run build # Build production bundle
npm run start # Start production server
npm run lint # Run Next.js lint
npm run typecheck # Run TypeScript checks
npm run quality # Run lint, typecheck, and build.
|-- database/ # PostgreSQL schema
|-- nginx/ # Local reverse proxy config
|-- public/ # Static assets
|-- scripts/ # Local helper scripts
|-- src/app/ # Next.js routes and API routes
|-- src/components/ # Shared UI components
|-- src/lib/ # Auth, database, schema, and domain services
|-- docker-compose.yml
|-- Dockerfile
`-- package.json
- Do not commit
.env,.env.local, database dumps, certificates, private keys, or uploaded user files. - Use long random values for
AUTH_SECRET,NEXTAUTH_SECRET, andCRON_SECRET. - Use
.env.exampleonly as a safe template. - Runtime uploads under
public/uploads/are intentionally ignored by Git. - Demo credentials are public and should only be used with demo data.
Before opening a pull request or publishing changes:
npm run qualityHealth check endpoint:
GET /api/health
Expected response:
{ "ok": true, "service": "KetKat-EcoFarm" }