Enterprise Palm Oil Harvest Management System
Complete full-stack solution for managing palm oil harvesting operations, worker management, payroll calculations, and village cooperative (BUMDES) data.
Features โข Tech Stack โข Quick Start โข API โข Modules โข Docs
| Module | Description |
|---|---|
| ๐ Dashboard | Real-time harvest statistics, analytics & pricing |
| ๐ด Panen | Daily palm oil harvest data management |
| ๐ฐ Payroll | Farmer payment calculations with deductions |
| ๐ท Tenaga Kerja | Worker & team management |
| Module | Description |
|---|---|
| ๐ณ Simpan Pinjam | Savings & loan management |
| ๐งช Analisa Nutrisi | Palm tree nutrition analysis (NPK) |
| ๐ Laporan | Report generation & management |
| ๐ข Data Bumdes | Village cooperative financial data |
- ๐ JWT Authentication with role-based access control
- ๐ฑ Mobile-First responsive design
- ๐ณ Docker Ready one-command deployment
- โก Hot Reload development experience
- ๐๏ธ Prisma ORM database management
- ๐จ Modern UI with Vue 3 Composition API
# Clone the repository
git clone https://github.com/YOUR_USERNAME/sawit-web.git
cd sawit-web
# Start all services with one command
docker-compose up -d
# View logs
docker-compose logs -fAccess the application:
- ๐ Frontend: http://localhost:5010
- ๐ Backend API: http://localhost:3030
- ๐ Health Check: http://localhost:3031
- ๐๏ธ Prisma Studio: http://localhost:5555
- Node.js 20+
- PostgreSQL 16+
- npm or yarn
# Navigate to backend
cd backend
# Install dependencies
npm install
# Generate Prisma client
npx prisma generate
# Push schema to database
npx prisma db push
# Seed with sample data
npm run db:seed
# Start development server
npm run dev
# Server runs on http://localhost:3000# Navigate to root directory
cd ..
# Install dependencies
npm install
# Start development server
npm run dev
# App runs on http://localhost:5000| Role | Password | |
|---|---|---|
| ๐ Admin | admin@sawit.com |
password123 |
| ๐ Manager | manager@sawit.com |
password123 |
Username: sawit_user
Password: sawit_password
Database: sawit
Port: 5432
http://localhost:3030/api
All endpoints (except login) require JWT token:
Authorization: Bearer <your_jwt_token>| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/login |
๐ User login |
| POST | /api/auth/register |
๐ Register new user |
| GET | /api/auth/me |
๐ค Get current user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/dashboard/stats |
๐ Get statistics |
| GET | /api/dashboard/harga |
๐ต Get TBS prices |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/petani |
๐จโ๐พ List all farmers |
| GET | /api/petani/:id |
๐ Get farmer details |
| POST | /api/petani |
โ Create farmer |
| PUT | /api/petani/:id |
โ๏ธ Update farmer |
| DELETE | /api/petani/:id |
๐๏ธ Delete farmer |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/panen |
๐ด List harvests |
| GET | /api/panen/stats |
๐ Harvest statistics |
| POST | /api/panen |
โ Record harvest |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/payroll |
๐ฐ List payroll |
| POST | /api/payroll/calculate |
๐งฎ Calculate payroll |
| PUT | /api/payroll/:id/status |
โ Update status |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/tenaga-kerja |
๐ท List workers |
| GET | /api/tenaga-kerja/team |
๐ฅ List teams |
# Login to get JWT token
curl -X POST http://localhost:3030/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"admin@sawit.com","password":"password123"}'
# Use token to fetch dashboard stats
curl http://localhost:3030/api/dashboard/stats \
-H "Authorization: Bearer <your_token>"sawit-web/
โโโ ๐ frontend/ # Vue 3 web application
โ โโโ src/
โ โ โโโ views/ # Page components
โ โ โโโ components/ # Reusable components
โ โ โโโ router/ # Vue Router config
โ โ โโโ stores/ # Pinia state stores
โ โ โโโ utils/ # API client & helpers
โ โ โโโ assets/ # Styles & images
โ โโโ public/ # Static assets
โ โโโ vite.config.ts # Vite configuration
โ โโโ package.json
โ
โโโ โ๏ธ backend/ # Node.js Express API
โ โโโ src/
โ โ โโโ config/ # Database config
โ โ โโโ controllers/ # HTTP request handlers
โ โ โโโ services/ # Business logic
โ โ โโโ routes/ # API routes
โ โ โโโ middleware/ # Auth & validation
โ โ โโโ utils/ # JWT & helpers
โ โโโ prisma/
โ โ โโโ schema.prisma # Database schema
โ โ โโโ seed.ts # Sample data
โ โโโ package.json
โ โโโ tsconfig.json
โ
โโโ ๐ณ docker/ # Docker configurations
โ โโโ backend/ # Backend Dockerfile
โ โโโ frontend/ # Frontend Dockerfile
โ โโโ health/ # Health check page
โ
โโโ ๐ docker-compose.yml # Docker orchestration
โโโ ๐ README.md # This file
โโโ ๐ docs/ # Documentation
Real-time analytics and statistics:
- Total tonase (harvest weight)
- Total janjang (fruit bunches)
- BJR (Fruit Weight Ratio)
- Current TBS prices
- Monthly comparisons
- Interactive charts
Harvest data management:
- Record daily harvests
- Track farmer contributions
- Monitor quality ratings
- Faktur (invoice) management
- Team assignment
- Date-based filtering
Automated payment calculations:
- Gross Kotor = Tonase ร TBS Price
- Deductions:
- Operational costs
- Fertilizer installments
- Loan installments
- Gross Bersih = Gross Kotor - All Deductions
- Status tracking: Pending โ Approved โ Paid
Worker & team management:
- Farmer land data
- Team organization
- Service history
- Insurance tracking
- Position management (Mandor/Pekerja Lapang)
Cooperative financial services:
- Mandatory savings
- Loan applications
- Interest calculation
- Tenor management
- Status tracking (active/lunas/batal)
Palm tree health monitoring:
- NPK analysis (Nitrogen, Phosphorus, Potassium)
- Magnesium levels
- Auto status determination:
- โ Optimal
โ ๏ธ Kurang (Deficient)โ ๏ธ Berlebih (Excess)
- Recommendations
Report generation:
- Period-based reports
- Multiple report types
- Status tracking
- Export capabilities
Village cooperative management:
- Asset tracking
- Liability management
- Equity calculation
- Income & expense tracking
- Financial summaries
| Service | Port | Description |
|---|---|---|
| ๐ Frontend | 5010 (host) / 5000 (container) | Vue.js web application |
| โ๏ธ Backend | 3030 (host) / 3000 (container) | Express REST API |
| ๐ Health | 3031 | Service health check |
| ๐๏ธ PostgreSQL | 5432 | Database server |
| ๐ง Prisma Studio | 5555 | Database management UI |
The application is fully mobile-optimized:
- ๐ฑ Mobile-first design approach
- ๐ Hamburger menu for navigation
- ๐ Responsive tables with horizontal scroll
- ๐ Touch-friendly buttons (44px minimum)
- ๐ฒ Safe area support for notched phones
- ๐ฌ Smooth animations and transitions
| Screen | Width | Layout |
|---|---|---|
| Desktop | > 960px | Full sidebar |
| Tablet | 768-960px | Hamburger menu |
| Mobile | < 768px | Stacked layout |
| Small Phone | < 480px | Compact view |
cd backend
npm testnpm test# Lint code
npm run lint
# Format code
npm run formatnpm run type-check# Build production images
docker-compose -f docker-compose.yml build
# Run in production
docker-compose -f docker-compose.yml up -d| Service | Recommended Platform |
|---|---|
| Frontend | Vercel, Netlify |
| Backend | Railway, Render |
| Database | Supabase, Neon, Railway |
| Images | Docker Hub, GHCR |
Contributions are welcome! ๐
- Fork the repository
- Create your feature branch:
git checkout -b feature/AmazingFeature
- Commit your changes:
git commit -m 'Add some AmazingFeature' - Push to the branch:
git push origin feature/AmazingFeature
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- ๐ด Built for palm oil farmers and cooperatives
- ๐ Designed with love for the agricultural community
- ๐ Powered by modern web technologies
Built with โค๏ธ for palm oil farmers and cooperatives
Made with Vue.js, Node.js, PostgreSQL, and Docker