MyJekID adalah sistem aplikasi untuk manajemen layanan kurir dan jasa pesan-antar yang beroperasi di wilayah Pulau Sumbawa, Nusa Tenggara Barat. Aplikasi ini menyediakan Admin Dashboard untuk pemantauan real-time, manajemen kurir, monitoring order, serta AI Chatbot (Gemini/OpenAI/Ollama/LM Studio) yang menangani pelanggan dan kurir via WhatsApp secara otomatis.
- Web App Link: http://myjek.mmsdashboard.dev/
- Fitur Utama
- Tech Stack
- Struktur Proyek
- Prasyarat
- Cara Setup
- Variabel Lingkungan
- API & Webhook
- Deployment
- Role & Akses
- Integrasi Eksternal
- Lisensi & Kontak
- Overview Web App
- Layanan pelanggan dan kurir otomatis via WhatsApp (melalui WAHA).
- Dukungan multi-provider AI: Gemini, OpenAI, Ollama, LM Studio.
- Integrasi dengan n8n untuk alur otomatisasi (workflow).
- Mode intervensi: admin dapat mengambil alih chat dari bot dan mengobrol langsung dengan pengguna/customer.
- Dashboard Overview — Monitoring order, distribusi order, transaksi, dan quick access ke:
- n8n workflow
- WAHA Dashboard
- Storage (MinIO)
- Chatbot via Whatsapp
- Manajemen Order — Daftar order, detail, edit status, buat order oleh admin, bukti pengiriman, timeline, peta rute.
- Mitra Kurir — CRUD kurir (tambah, update, hapus).
- Live Map — Peta real-time untuk melacak lokasi kurir.
- Intervention / Chat Mode — Daftar sesi chat aktif, riwayat percakapan, kirim pesan sebagai admin, toggle mode bot/manual.
- Laporan — Ringkasan transaksi, grafik revenue, export Excel.
- Manajemen User — CRUD admin (hanya SUPER_ADMIN).
- Pengaturan — Profil dan ubah password.
- Notifikasi — Notifikasi real-time (Socket.IO) di dashboard.
| Layer | Teknologi |
|---|---|
| Frontend | React 19, Vite 7, Redux Toolkit, React Router 7, Tailwind CSS 4, DaisyUI, Leaflet, Recharts, Socket.IO Client |
| Backend | Node.js, Express 5, Sequelize (PostgreSQL), Redis, Socket.IO, JWT, Winston |
| AI | Google Generative AI (Gemini), OpenAI API, Ollama, LM Studio |
| Storage | MinIO (S3-compatible) |
| WAHA (WhatsApp HTTP API) | |
| Nodemailer (SMTP) | |
| Deploy | Docker, Docker Compose, GitHub Actions (CI/CD) |
myjekid-app/
├── client/ # Frontend (React + Vite)
│ ├── src/
│ │ ├── components/ # UI (dashboard, orders, couriers, intervention, reports, dll.)
│ │ ├── features/ # Redux slices
│ │ ├── layouts/ # MainLayout
│ │ ├── pages/ # Halaman (Dashboard, Orders, Map, Chat, Reports, Settings, dll.)
│ │ ├── services/ # API & socket client
│ │ └── store/ # Redux store
│ ├── Dockerfile
│ └── package.json
├── server/ # Backend (Express)
│ ├── src/
│ │ ├── config/ # database, redis
│ │ ├── controllers/ # auth, admin, order, courier, intervention, report, webhook
│ │ ├── middleware/ # auth, role, error
│ │ ├── models/ # Sequelize (admin, courier, order, chatSession, notification, dll.)
│ │ ├── routes/ # apiRoutes, webhookRoutes
│ │ ├── services/ # AI (Gemini/OpenAI/Ollama/LMStudio), order, message, storage, email, flows
│ │ └── utils/ # logger, AppError, validators, emailTemplates
│ ├── app.js # Entry + Socket.IO
│ ├── Dockerfile
│ └── package.json
├── .github/workflows/ # CI/CD (build & push Docker, deploy)
├── docker-compose.yml
├── package.json # Root: scripts start, postinstall, build
└── README.md
- Node.js v20 (disarankan LTS)
- npm v9+
- PostgreSQL (untuk database)
- Redis (untuk session/cache, jika dipakai)
- Docker & Docker Compose (opsional, untuk deploy)
- Akses ke WAHA (WhatsApp HTTP API)
- MinIO atau S3-compatible storage (untuk file/bukti)
- Salah satu: Gemini API Key, OpenAI API Key, atau Ollama/LM Studio (untuk AI chatbot)
git clone <url-repo>
cd myjekid-app
npm installScript postinstall akan menginstall dependensi di client/ dan server/.
Buat file server/.env (lihat Variabel Lingkungan/File .env). Minimal yang wajib:
PORT,NODE_ENV,FRONTEND_URL,JWT_SECRETDATABASE_URL(PostgreSQL)WAHA_API_URL,WAHA_API_KEYAI_PROVIDER+ API key yang sesuai (mis.GEMINI_API_KEYatauOPENAI_API_KEY)- Konfigurasi MinIO/S3 jika dipakai
- Redis jika dipakai
Pastikan PostgreSQL berjalan dan DATABASE_URL benar. Sequelize akan membuat/migrate tabel saat aplikasi jalan (sesuai konfigurasi di project).
Semua (backend + frontend):
npm start- Backend:
http://localhost:5000(atau nilaiPORTdi.env) - Frontend (Vite): biasanya
http://localhost:5173
Terpisah:
# Terminal 1 — Backend
cd server && npm run dev
# Terminal 2 — Frontend
cd client && npm run devnpm run buildOutput build ada di client/dist/. Untuk production, serve folder ini (mis. lewat Nginx atau container).
Variabel berikut digunakan backend (dan bisa diset di server/.env atau environment deployment).
| Variabel | Deskripsi | Contoh |
|---|---|---|
| Server | ||
PORT |
Port server | 5000 |
NODE_ENV |
environment | development / production |
FRONTEND_URL |
URL frontend (untuk link di email/notifikasi) | https://app.myjekid.com |
JWT_SECRET |
Secret untuk JWT | string rahasia |
| Database | ||
DATABASE_URL |
Connection string PostgreSQL | postgres://user:pass@host:5432/dbname |
| Redis | ||
REDIS_HOST, REDIS_PORT, REDIS_PASSWORD |
Koneksi Redis | |
| Email (SMTP) | ||
SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS |
Konfigurasi SMTP | |
| WAHA (WhatsApp) | ||
WAHA_API_URL |
Base URL WAHA | http://localhost:7575 |
WAHA_API_KEY |
API key WAHA | |
| MinIO / S3 | ||
S3_ENDPOINT, S3_PORT, S3_USE_SSL |
Endpoint MinIO/S3 | |
S3_ACCESS_KEY, S3_SECRET_KEY, S3_BUCKET_NAME |
Credential & bucket | |
BASE_IMAGE_URL |
Base URL untuk akses file (mis. public URL MinIO) | |
| AI | ||
AI_PROVIDER |
Provider: GEMINI, OPENAI, OLLAMA, LMSTUDIO |
GEMINI |
GEMINI_API_KEY |
API key Google Gemini | |
OPENAI_API_KEY |
API key OpenAI | |
OLLAMA_BASE_URL, OLLAMA_MODEL |
Untuk Ollama (local) | |
LMSTUDIO_BASE_URL, LMSTUDIO_MODEL, LMSTUDIO_API_KEY |
Untuk LM Studio (local) |
- Development:
http://localhost:5000/api - Production:
https://myjek.mmsdashboard.dev
- POST
/api/auth/login— Login (body:email,password). Mengembalikan token JWT. - Route lain (kecuali webhook) membutuhkan header:
Authorization: Bearer <token>.
| Method | Path | Deskripsi |
|---|---|---|
| GET | /api/auth/me |
Profil user saat ini |
| PATCH | /api/auth/profile, /api/auth/password |
Update profil & password |
| GET | /api/dashboard/stats, /api/dashboard/chart |
Statistik & chart dashboard |
| GET/PUT | /api/orders, /api/orders/:id |
Daftar & detail order, update order |
| GET | /api/orders/customers |
Daftar customer |
| POST | /api/orders/by-admin |
Buat order oleh admin |
| GET | /api/intervention/sessions |
Sesi chat aktif |
| GET | /api/intervention/history/:phone |
Riwayat chat per nomor |
| POST | /api/intervention/send, /api/intervention/toggle-mode |
Kirim pesan & toggle mode |
| GET/PATCH | /api/notifications, /api/notifications/:id/read |
Notifikasi |
| GET | /api/reports/summary, /api/reports/chart, /api/reports/transactions |
Laporan |
| GET | /api/reports/export/excel |
Export Excel |
| GET/POST/PUT/DELETE | /api/couriers, /api/couriers/:id |
CRUD kurir |
| GET/POST/PUT/DELETE | /api/admins, /api/admins/:id |
CRUD admin (SUPER_ADMIN only) |
| Method | Path | Deskripsi |
|---|---|---|
| POST | /webhook/whatsapp |
Menerima pesan masuk dari WAHA |
| POST | /webhook/admin/session |
Set session mode (dipanggil n8n / dashboard) |
| GET | /webhook/health |
Health check layanan webhook |
- Backend: image
juwono136/myjek-api:latest, port5000. - Frontend: image
juwono136/myjek-frontend:latest, port8080. - Variabel environment di-set di
.envdi direktori yang sama dengandocker-compose.yml(lihat Variabel Lingkungan).
Jalankan:
# Pastikan network "tunnel" sudah ada (atau sesuaikan nama di compose)
docker network create tunnel
docker compose up -d- Trigger: Push/PR ke branch
master(kecuali perubahan hanya diREADME.md). - CI: Build image Docker untuk
serverdanclient, push ke Docker Hub (myjek-api,myjek-frontend). - CD: Di runner self-hosted, pull image terbaru,
docker compose downlaludocker compose up -d, dan menghubungkan container ke networktunnel.
Secrets yang diperlukan di GitHub: DOCKER_USERNAME, DOCKER_PASSWORD, serta semua variabel environment yang dipakai (PORT, DATABASE_URL, JWT_SECRET, WAHA_, S3_, REDIS_, AI_, dll.) dan TUNNEL_NAME untuk network.
| Role | Deskripsi | Akses Khusus |
|---|---|---|
SUPER_ADMIN |
Administrator penuh | User Management (CRUD admin), akses penuh order & kurir |
CS |
Customer Service | Update order, buat order oleh admin, update kurir |
| Role lain | Sesuai definisi di roleMiddleware |
Dibatasi per route (lihat restrictTo di apiRoutes.js) |
Route yang memakai restrictTo hanya bisa diakses oleh role yang disebutkan.
- WAHA — WhatsApp HTTP API untuk kirim/terima pesan; backend menerima webhook di
/webhook/whatsapp. - n8n — Workflow automation; dapat memanggil
/webhook/admin/sessiondan endpoint lain sesuai kebutuhan. - MinIO/S3 — Penyimpanan file (bukti, gambar); akses via
BASE_IMAGE_URL+ bucket. - Redis — Session/cache (jika dikonfigurasi).
- AI — Satu provider aktif sesuai
AI_PROVIDER; factory di backend memilih adapter (Gemini, OpenAI, Ollama, LM Studio).
- Lisensi: Private.
- Repository: myjekid-ai
- Issues: GitHub Issues
Untuk pertanyaan atau dukungan, buka issue di repository di atas.