Aplikasi web yang dapat mengklasifikasikan berbagai jenis sampah menggunakan Machine Learning. Dibuat untuk Capstone Project Coding Camp 2025.
- π Klasifikasi Sampah dengan AI - Upload foto sampah dan AI akan mengidentifikasi jenisnya (Organik, Anorganik, B3)
- π Peta Bank Sampah - Temukan lokasi bank sampah terdekat
- π Edukasi - Artikel dan tips pengelolaan sampah
- π€ Akun Pengguna - Login dengan Google/GitHub
- π³ Subscription - Paket Free (30 klasifikasi/bulan) dan Premium (unlimited)
- π Payment Gateway - Pembayaran aman dengan Midtrans
| Layer | Technology |
|---|---|
| Frontend | Next.js 15, React, Tailwind CSS |
| Backend | Node.js, Hapi.js, Prisma ORM |
| ML Service | Python, Flask, TensorFlow/Keras |
| Database | SQLite |
| Auth | NextAuth.js (Google, GitHub OAuth) |
| Payment | Midtrans |
Pastikan sudah terinstall:
git clone https://github.com/markusprap/waste-classification-webapp.git
cd waste-classification-webapp# Masuk ke folder ml-service
cd ml-service
# Buat virtual environment (opsional tapi disarankan)
python -m venv venv
source venv/bin/activate # Linux/Mac
# atau: venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Jalankan ML Service
python app.pyML Service akan berjalan di: http://localhost:5002
Buka terminal baru:
# Masuk ke folder backend
cd backend
# Install dependencies
npm install
# Generate Prisma Client
npx prisma generate
# Jalankan Backend
npm run devBackend akan berjalan di: http://localhost:3005
Buka terminal baru:
# Masuk ke folder frontend
cd frontend
# Install dependencies
npm install --legacy-peer-deps
# Jalankan Frontend
npm run devFrontend akan berjalan di: http://localhost:3000
Buka browser dan akses: http://localhost:3000
# API URLs
NEXT_PUBLIC_API_URL=http://localhost:3005
NEXT_PUBLIC_BACKEND_URL=http://localhost:3005
NEXT_PUBLIC_ML_SERVICE_URL=http://localhost:5002
ML_SERVICE_URL=http://localhost:5002
BACKEND_URL=http://localhost:3005
# Google OAuth (untuk login dengan Google)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
# NextAuth
NEXTAUTH_SECRET=your_random_secret_key
NEXTAUTH_URL=http://localhost:3000# Server
PORT=3005
HOST=0.0.0.0
NODE_ENV=development
# Database
DATABASE_URL="file:./database/prisma/dev.db"
# Midtrans Payment Gateway
MIDTRANS_SERVER_KEY=your_server_key_here
MIDTRANS_CLIENT_KEY=your_client_key_here
MIDTRANS_ENV=sandbox
# Frontend URL (untuk CORS)
FRONTEND_URL=http://localhost:3000
# ML Service
ML_SERVICE_URL=http://localhost:5002# Flask Configuration
FLASK_ENV=development
FLASK_DEBUG=1
# Server
HOST=0.0.0.0
PORT=5002
# CORS
CORS_ORIGINS=http://localhost:3000,http://localhost:3005
# Model
MODEL_PATH=src/models/model-update.h5Untuk mengaktifkan login dengan Google:
- Buka Google Cloud Console
- Buat project baru atau pilih project yang ada
- Pergi ke APIs & Services > Credentials
- Klik Create Credentials > OAuth 2.0 Client IDs
- Pilih Web application
- Tambahkan:
- Authorized JavaScript origins:
http://localhost:3000 - Authorized redirect URIs:
http://localhost:3000/api/auth/callback/google
- Authorized JavaScript origins:
- Copy Client ID dan Client Secret ke
frontend/.env.local
Untuk mengaktifkan pembayaran:
- Daftar di Midtrans Dashboard
- Pilih mode Sandbox untuk testing
- Pergi ke Settings > Access Keys
- Copy Server Key dan Client Key ke
backend/.env
waste-classification-webapp/
βββ frontend/ # Next.js Frontend
β βββ app/ # App Router pages
β βββ src/
β β βββ components/ # React Components
β β βββ services/ # API Services
β βββ public/ # Static assets
β
βββ backend/ # Hapi.js Backend
β βββ routes/ # API Routes
β βββ database/
β β βββ prisma/ # Prisma schema & SQLite DB
β βββ utils/ # Utility functions
β
βββ ml-service/ # Flask ML Service
βββ src/
βββ models/ # TensorFlow model (.h5)
βββ api/ # Flask routes
# Cek proses yang menggunakan port
lsof -i :3000 # atau :3005, :5002
# Kill proses
kill -9 <PID># Frontend
cd frontend && npm install --legacy-peer-deps
# Backend
cd backend && npm install
# ML Service
cd ml-service && pip install -r requirements.txtcd backend
npx prisma generate
npx prisma db pushUntuk mengakses admin blog:
- URL:
http://localhost:3000/admin/blog - Password:
ecowaste2025
| Plan | Limit | Harga |
|---|---|---|
| Free | 30 klasifikasi/bulan | Gratis |
| Premium | Unlimited | Rp 10.000/bulan |
| ID | Nama |
|---|---|
| MC009D5X0397 | Dea Yuliani Sabrina |
| FC013D5Y1566 | Markus Prap Kurniawan |
| FC375D5Y1854 | Izaq Zulfikar |
| MC009D5Y2213 | Dwi Nurcahyo Purbonegoro |
| MC009D5X2450 | Clara Marsya Dekawanti |
Coding Camp 2025 powered by DBS Foundation
Jika ada pertanyaan atau masalah saat setup, silakan buat GitHub Issue atau hubungi kontributor.