Gratis. Open-source. Self-hosted. Siap produksi.
Light.Bill adalah platform manajemen ISP all-in-one yang dirancang untuk kebutuhan nyata operator jaringan internet di Indonesia — mulai dari RT/RW Net dan komunitas, hingga ISP komersial skala menengah.
Dibangun di atas Next.js App Router, Prisma ORM, dan TypeScript, Light.Bill menggabungkan billing, manajemen jaringan MikroTik/OLT GPON, notifikasi pelanggan, dan laporan keuangan dalam satu platform terpadu yang cepat, aman, dan mudah dioperasikan.
Gratis selamanya. Tidak ada biaya berlangganan. Tidak ada vendor lock-in. Kode sumber terbuka sepenuhnya.
|
|
| Lapisan | Teknologi | Keterangan |
|---|---|---|
| Framework | Next.js 16 (App Router) | Full-stack React, SSR, API Routes |
| Bahasa | TypeScript 5 | Type-safe end-to-end |
| Database ORM | Prisma 7 | Schema migration, query builder |
| Database Engine | SQLite / PostgreSQL | SQLite untuk lokal/VPS, PostgreSQL untuk cloud |
| Autentikasi | JWT (jose) + bcrypt | Role-based session, HttpOnly Cookie |
| Enkripsi | AES-256-GCM | Kredensial MikroTik terenkripsi di DB |
| Baileys (Multi-Device) | Gateway resmi tanpa API berbayar | |
| Telegram | Telegram Bot API | Notifikasi real-time gratis |
| Payment | Midtrans / Xendit / Tripay / Duitku | Multi-gateway dengan webhook |
| Grafik | Recharts | Monitoring bandwidth & keuangan |
| Styling | Vanilla CSS + TailwindCSS | Dark mode, glassmorphism, animasi |
| Deployment | Vercel / VPS + PM2 | Fleksibel sesuai infrastruktur |
- Node.js v18 atau lebih baru
- npm atau pnpm
- (Opsional untuk produksi) PostgreSQL / VPS / Vercel
# 1. Kloning repositori
git clone https://github.com/USERNAME/LightBill.git
cd LightBill/lightbill-app
# 2. Instal dependensi
npm install
# 3. Salin template konfigurasi
cp .env.example .env
# Edit .env sesuai kebutuhan Anda (lihat Konfigurasi di bawah)
# 4. Inisialisasi database & isi data seed
npx prisma db push
npx prisma db seed
# 5. Jalankan server pengembangan
npm run devBuka http://localhost:3000 di browser Anda.
💡 Tip: Secara default,
.env.examplemenggunakan SQLite lokal dan mode simulasi MikroTik (MIKROTIK_SIMULATION="true"). Anda dapat langsung login dan mengeksplorasi semua fitur tanpa memerlukan hardware router atau database eksternal.
| Role | Username | Password |
|---|---|---|
| Admin | admin |
admin123 |
| Kasir | kasir |
kasir123 |
| Teknisi | teknisi |
teknisi123 |
⚠️ Ganti semua password dan aktifkanNEXT_PUBLIC_DEMO_MODE=falsesebelum go-live!
Salin .env.example ke .env dan sesuaikan nilai-nilainya:
# === DATABASE ===
DATABASE_URL="file:./dev.db" # SQLite (lokal/VPS)
# DATABASE_URL="postgresql://..." # PostgreSQL (cloud)
# === AUTENTIKASI — WAJIB DIGANTI DI PRODUKSI! ===
# Generate: node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
NEXTAUTH_SECRET="ganti-dengan-string-acak-64-karakter"
NEXTAUTH_URL="http://localhost:3000" # URL publik aplikasi Anda
# === ENKRIPSI MIKROTIK — WAJIB DIGANTI DI PRODUKSI! ===
# Generate: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
ENCRYPTION_KEY="ganti-dengan-string-acak-32-karakter"
# === CRON JOB SECURITY — WAJIB DIISI DI PRODUKSI! ===
CRON_SECRET="ganti-dengan-string-acak-32-karakter"
# === MODE APLIKASI ===
NEXT_PUBLIC_DEMO_MODE="true" # false di produksi
MIKROTIK_SIMULATION="true" # false untuk koneksi router nyata-
Fork repositori ini ke akun GitHub Anda.
-
Buka vercel.com dan Import Project dari GitHub.
-
Atur Environment Variables di Settings → Environment Variables Vercel:
Variabel Nilai DATABASE_URLURL PostgreSQL produksi Anda NEXTAUTH_SECRETString acak 64 karakter ENCRYPTION_KEYString acak 32 karakter CRON_SECRETString acak 32 karakter NEXTAUTH_URLhttps://domain-anda.comNEXT_PUBLIC_DEMO_MODEfalse -
Jalankan migrasi database:
npx prisma migrate deploy
-
Deploy!
⚠️ Catatan Vercel Free Tier: Hanya mendukung 2 cron job. Editvercel.jsondan pertahankan hanya 2 dari 5 cron yang ada (disarankan:invoices&bandwidth). Untuk semua 5 cron aktif, gunakan Vercel Pro atau self-host.
Ideal untuk terhubung langsung ke router MikroTik di jaringan lokal.
# 1. Build aplikasi
npm run build
# 2. Jalankan dengan PM2 (process manager)
npm install -g pm2
pm2 start npm --name "lightbill" -- start
pm2 save && pm2 startup
# 3. Setup Cron Job via OS crontab
crontab -eTambahkan baris berikut ke crontab:
# Cek bandwidth setiap 5 menit
*/5 * * * * curl -s -X POST https://your-domain.com/api/cron/bandwidth?secret=YOUR_CRON_SECRET
# Generate tagihan & auto-isolir setiap pukul 00:00 WIB (17:00 UTC)
0 17 * * * curl -s -X POST https://your-domain.com/api/cron/invoices?secret=YOUR_CRON_SECRET
# OLT health check setiap 10 menit
*/10 * * * * curl -s -X POST https://your-domain.com/api/cron/ont-health?secret=YOUR_CRON_SECRET
# Network ping & alert setiap 5 menit
*/5 * * * * curl -s -X POST https://your-domain.com/api/cron/network-ping?secret=YOUR_CRON_SECRET
# OLT ZTP setiap 1 jam
0 * * * * curl -s -X POST https://your-domain.com/api/cron/olt-ztp?secret=YOUR_CRON_SECRETLight.Bill punya API lengkap (124+ routes) dan MCP Server resmi — sehingga AI agents (Hermes/ARKA, Claude, n8n, custom script) bisa mengelola seluruh platform: pelanggan, karyawan, router MikroTik, OLT, tagihan, payment gateway, inventaris, dan lainnya.
Set AI_API_KEY di .env, lalu panggil endpoint mana pun dengan header X-AI-Key — tanpa flow login JWT:
curl -H "X-AI-Key: your-ai-api-key" https://your-lightbill-domain.com/api/customers
curl -H "X-AI-Key: your-ai-api-key" https://your-lightbill-domain.com/api/dashboard
curl -H "X-AI-Key: your-ai-api-key" https://your-lightbill-domain.com/api/whatsapp📄 Dokumentasi lengkap: API-AI-AGENT.md
| Sumber | Link |
|---|---|
| PyPI | lightbill-mcp-server |
| GitHub | lightnet19/lightbill-mcp-server |
| MCP Registry | io.github.lightnet19/lightbill-mcp-server |
pip install lightbill-mcp-serverContoh kemampuan via MCP:
| Task | Tool |
|---|---|
| List / add / edit / delete customers | lb_list_customers, lb_customer_create, lb_customer_update, lb_customer_delete |
| Manage staff | lb_staff_create, lb_staff_update, lb_staff_delete |
| MikroTik router CRUD + monitor | lb_router_create, lb_router_traffic, lb_router_resource |
| OLT / ONT management | lb_olt_create, lb_olt_ont_reboot, lb_olt_ztp_create |
| Confirm cash payment (auto-reactivate) | lb_invoice_mark_paid |
| Approve / reject transfer proof | lb_payment_verification_approve, lb_payment_verification_reject |
| Set payment gateway (Tripay/Duitku/Midtrans) | lb_payment_gateway_set |
| WhatsApp status / send | lb_whatsapp_status, lb_whatsapp_send |
| Inventory borrow / install | lb_inventory_borrow, lb_inventory_install |
⚠️ Aksi destruktif (delete) & berdampak layanan (reboot ONT, kick radius) sebaiknya dikonfirmasi manusia.
Light.Bill dirancang dengan prinsip Security by Default:
| Mekanisme | Implementasi |
|---|---|
| Session Cookie | HttpOnly: true — tidak bisa diakses JavaScript (anti-XSS) |
| JWT | Signed dengan jose, expiry 12 jam |
| Password | Di-hash dengan bcrypt (cost factor 10) |
| Kredensial Router | Dienkripsi AES-256-GCM sebelum masuk database |
| Cron Endpoints | Wajib CRON_SECRET — tolak 500 jika tidak dikonfigurasi |
| Rate Limiting | Login, checkout, & webhook endpoint dibatasi per-IP |
| Startup Validation | App menolak start jika ENCRYPTION_KEY / NEXTAUTH_SECRET tidak di-set di production |
| Log Sanitization | Payload webhook sensitif tidak dicetak di log produksi |
LightBill/
├── lightbill-app/ # Aplikasi Next.js utama
│ ├── prisma/ # Schema database & seed data
│ ├── src/
│ │ ├── app/ # App Router: pages & API routes
│ │ │ ├── api/ # Backend API endpoints
│ │ │ ├── dashboard/ # Halaman dashboard staff
│ │ │ ├── client/ # Portal mandiri pelanggan
│ │ │ └── bayar/ # Halaman checkout publik
│ │ └── lib/ # Utilities: auth, crypto, billing, mikrotik
│ ├── .env.example # Template konfigurasi
│ └── vercel.json # Konfigurasi cron Vercel
├── docs/ # Dokumentasi proyek
│ ├── devplan.md # Rencana pengembangan
│ ├── devlog.md # Catatan teknis harian
│ └── ROADMAP.md # Roadmap fitur & status
├── CONTRIBUTING.md # Panduan berkontribusi
├── LICENSE # MIT License
└── README.md # Dokumentasi ini
Semua fase pengembangan utama telah selesai. Berikut status modul yang sudah tersedia:
| Modul | Status |
|---|---|
| Billing & Invoice Engine (Prorata, PPN, Referral) | ✅ |
| MikroTik Integration (PPPoE, Hotspot, Isolir Otomatis) | ✅ |
| OLT GPON (ZTE, Huawei, VSOL) + ZTP + Health Monitor | ✅ |
| RADIUS Server Terpusat | ✅ |
| WhatsApp & Telegram Notification Gateway | ✅ |
| Multi-Payment Gateway (Midtrans, Xendit, Tripay, Duitku) | ✅ |
| OCR Auto-Confirmation Bukti Transfer | ✅ |
| Portal Mandiri Pelanggan | ✅ |
| Laporan Keuangan & Ekspor PDF | ✅ |
| Sistem Ticketing & Helpdesk | ✅ |
| Inventory & Aset Jaringan | ✅ |
| HR & Payroll Teknisi | ✅ |
| Backup & Restore Data | ✅ |
| Activity Log & Audit Trail | ✅ |
| Network Topology Map | ✅ |
| Production Hardening & Open-Source Ready | ✅ |
Lihat ROADMAP.md untuk detail lengkap dan rencana pengembangan berikutnya.
Kami sangat menyambut kontribusi dari siapapun! Untuk memulai:
- Fork repositori ini.
- Buat branch baru:
git checkout -b feat/fitur-baru - Lakukan perubahan, pastikan build bersih:
npm run build - Pull Request ke branch
main
Baca panduan lengkap di CONTRIBUTING.md.
Light.Bill dilisensikan di bawah MIT License.
Bebas digunakan, dimodifikasi, dan didistribusikan — termasuk untuk keperluan komersial — selama menyertakan atribusi lisensi asli.
Dibuat dengan ❤️ untuk komunitas ISP Indonesia