Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Palm Oil Vue.js TypeScript Node.js PostgreSQL

๐ŸŒฟ Sawit-Web

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


๐ŸŒŸ Features

๐ŸŽฏ Core Modules

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

๐Ÿš€ Additional Modules

Module Description
๐Ÿ’ณ Simpan Pinjam Savings & loan management
๐Ÿงช Analisa Nutrisi Palm tree nutrition analysis (NPK)
๐Ÿ“ˆ Laporan Report generation & management
๐Ÿข Data Bumdes Village cooperative financial data

โšก Technical Highlights

  • ๐Ÿ” 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

๐Ÿ› ๏ธ Tech Stack

Frontend

Vue.js TypeScript Vite Vue Router Pinia Axios FontAwesome

Backend

Node.js Express TypeScript Prisma JWT bcrypt Zod

Database & DevOps

PostgreSQL Docker Docker Compose

๐Ÿš€ Quick Start

๐Ÿณ Docker (Recommended)

# 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 -f

Access the application:


๐Ÿ’ป Manual Setup

Prerequisites

  • Node.js 20+
  • PostgreSQL 16+
  • npm or yarn

Backend Setup

# 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

Frontend Setup

# Navigate to root directory
cd ..

# Install dependencies
npm install

# Start development server
npm run dev
# App runs on http://localhost:5000

๐Ÿ” Default Credentials

Application Users

Role Email Password
๐Ÿ‘‘ Admin admin@sawit.com password123
๐Ÿ“‹ Manager manager@sawit.com password123

Database

Username:  sawit_user
Password:  sawit_password
Database:  sawit
Port:      5432

๐Ÿ“ก API Documentation

Base URL

http://localhost:3030/api

Authentication

All endpoints (except login) require JWT token:

Authorization: Bearer <your_jwt_token>

Core Endpoints

Authentication

Method Endpoint Description
POST /api/auth/login ๐Ÿ” User login
POST /api/auth/register ๐Ÿ“ Register new user
GET /api/auth/me ๐Ÿ‘ค Get current user

Dashboard

Method Endpoint Description
GET /api/dashboard/stats ๐Ÿ“Š Get statistics
GET /api/dashboard/harga ๐Ÿ’ต Get TBS prices

Farmers (Petani)

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

Harvest (Panen)

Method Endpoint Description
GET /api/panen ๐ŸŒด List harvests
GET /api/panen/stats ๐Ÿ“ˆ Harvest statistics
POST /api/panen โž• Record harvest

Payroll

Method Endpoint Description
GET /api/payroll ๐Ÿ’ฐ List payroll
POST /api/payroll/calculate ๐Ÿงฎ Calculate payroll
PUT /api/payroll/:id/status โœ… Update status

Workers (Tenaga Kerja)

Method Endpoint Description
GET /api/tenaga-kerja ๐Ÿ‘ท List workers
GET /api/tenaga-kerja/team ๐Ÿ‘ฅ List teams

Example API Call

# 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>"

๐Ÿ“‚ Project Structure

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

๐ŸŽจ Modules Overview

๐Ÿ“Š Dashboard

Real-time analytics and statistics:

  • Total tonase (harvest weight)
  • Total janjang (fruit bunches)
  • BJR (Fruit Weight Ratio)
  • Current TBS prices
  • Monthly comparisons
  • Interactive charts

๐ŸŒด Panen (Harvest)

Harvest data management:

  • Record daily harvests
  • Track farmer contributions
  • Monitor quality ratings
  • Faktur (invoice) management
  • Team assignment
  • Date-based filtering

๐Ÿ’ฐ Payroll

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

๐Ÿ‘ท Tenaga Kerja (Workers)

Worker & team management:

  • Farmer land data
  • Team organization
  • Service history
  • Insurance tracking
  • Position management (Mandor/Pekerja Lapang)

๐Ÿ’ณ Simpan Pinjam (Savings & Loans)

Cooperative financial services:

  • Mandatory savings
  • Loan applications
  • Interest calculation
  • Tenor management
  • Status tracking (active/lunas/batal)

๐Ÿงช Analisa Nutrisi (Nutrition Analysis)

Palm tree health monitoring:

  • NPK analysis (Nitrogen, Phosphorus, Potassium)
  • Magnesium levels
  • Auto status determination:
    • โœ… Optimal
    • โš ๏ธ Kurang (Deficient)
    • โš ๏ธ Berlebih (Excess)
  • Recommendations

๐Ÿ“ˆ Laporan (Reports)

Report generation:

  • Period-based reports
  • Multiple report types
  • Status tracking
  • Export capabilities

๐Ÿข Data Bumdes

Village cooperative management:

  • Asset tracking
  • Liability management
  • Equity calculation
  • Income & expense tracking
  • Financial summaries

๐Ÿณ Docker Services

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

๐Ÿ“ฑ Mobile Responsiveness

The application is fully mobile-optimized:

โœจ Features

  • ๐Ÿ“ฑ 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

๐Ÿ“ Breakpoints

Screen Width Layout
Desktop > 960px Full sidebar
Tablet 768-960px Hamburger menu
Mobile < 768px Stacked layout
Small Phone < 480px Compact view

๐Ÿงช Testing

Backend Tests

cd backend
npm test

Frontend Tests

npm test

Linting

# Lint code
npm run lint

# Format code
npm run format

Type Checking

npm run type-check

๐Ÿšข Deployment

Production Docker

# Build production images
docker-compose -f docker-compose.yml build

# Run in production
docker-compose -f docker-compose.yml up -d

Cloud Platforms

Service Recommended Platform
Frontend Vercel, Netlify
Backend Railway, Render
Database Supabase, Neon, Railway
Images Docker Hub, GHCR

๐Ÿค Contributing

Contributions are welcome! ๐ŸŽ‰

  1. Fork the repository
  2. Create your feature branch:
    git checkout -b feature/AmazingFeature
  3. Commit your changes:
    git commit -m 'Add some AmazingFeature'
  4. Push to the branch:
    git push origin feature/AmazingFeature
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • ๐ŸŒด 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

Palm Oil

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages