Aplikasi billing & manajemen ISP (fiber optic) — PWA pelanggan, portal teknisi & kolektor, admin panel lengkap, multi-vendor OLT, RADIUS, WhatsApp/Telegram, pembayaran QRIS. Kredit & lisensi (ISC): - Base kode & repo: alijayanet/billing-rtrw oleh Alijaya Net — terima kasih banyak atas base kode dan repo yang bermanfaat. - Add-on: GoWA, LibreSpeed/OpenSpeedTest, Uptime Kuma, notification-forwarder. - Dikembangkan menjadi OPEN-ISP oleh oxpoe — https://github.com/oxpoe/open-isp
6.3 KiB
6.3 KiB
QUICK REFERENCE - Aplikasi Billing B481
🚀 Quick Start
Running Aplikasi
# Development
npm run dev
# Production
npm start
# With PM2
pm2 start app-customer.js --name billing
Access Portals
| Portal | URL | Default User |
|---|---|---|
| Admin | http://localhost:3001/admin/login |
admin / admin123 |
| Customer | http://localhost:3001/customer/login |
- |
| Tech | http://localhost:3001/tech/login |
- |
| Agent | http://localhost:3001/agent/login |
- |
| Collector | http://localhost:3001/collector/login |
- |
| Health | http://localhost:3001/health |
- |
📁 Key Files
app-customer.js ← Entry point
config/database.js ← Database setup
settings.json ← Configuration
routes/customerPortal.js ← Customer routes
routes/adminPortal.js ← Admin routes
services/billingService.js ← Billing logic
services/mikrotikService.js ← MikroTik API
🔧 Common Tasks
Change Port
Edit settings.json:
{
"server_port": 3002
}
Change Company Name
Edit settings.json:
{
"company_header": "MY ISP NAME"
}
Enable WhatsApp
- Edit
settings.json:
{
"whatsapp_enabled": true
}
- Login → Admin → WhatsApp → Auth with QR code
Setup MikroTik
Edit settings.json:
{
"mikrotik_host": "192.168.8.1",
"mikrotik_user": "admin",
"mikrotik_password": "password",
"mikrotik_port": 8728
}
Setup GenieACS
Edit settings.json:
{
"genieacs_url": "http://192.168.1.100:7557",
"genieacs_username": "admin",
"genieacs_password": "password"
}
Setup Payment Gateway (Midtrans)
Edit settings.json:
{
"midtrans_enabled": true,
"midtrans_server_key": "Mid-server-xxx",
"midtrans_mode": "sandbox"
}
🔐 Security Settings (MUST DO)
⚠️ Before Production:
- Change Session Secret:
{
"session_secret": "use-a-random-32-character-string-here"
}
- Change Admin Password:
{
"admin_username": "admin",
"admin_password": "use-a-strong-password"
}
- Change Admin API Key:
{
"admin_api_key": "use-a-random-api-key"
}
- Set NODE_ENV:
export NODE_ENV=production
📊 Important Endpoints
Public
GET /health- Health checkGET /- Redirect to loginGET /isolated- Isolated page (MikroTik redirect)POST /api/webhook/v1/payment-notif- Payment webhook
Admin APIs
POST /api/settings/test-genieacs- Test GenieACSPOST /api/settings/test-mikrotik- Test MikroTikPOST /api/settings/test-tripay- Test TripayGET /api/settings- Get settingsPOST /api/settings- Update settings
Billing
GET /admin/billing/invoices- Invoice listPOST /admin/billing/generate- Generate invoicesPOST /admin/billing/unpay- Cancel payment
🗄️ Database Commands
Check Database
node scripts/verify-database.js
Fix Database Issues
bash scripts/fix-database.sh
Backup Database
# Manual via Admin Panel
# Or via API: POST /api/backup/create
🔄 Cron Jobs
| Time | Job | Purpose |
|---|---|---|
| 1 bulan, 00:01 | generateMonthlyInvoices() | Create monthly invoices |
| Setiap hari 02:00 | autoIsolatePlansExpired() | Isolate overdue customers |
| Setiap hari 09:00 | sendBillingReminders() | WhatsApp reminders |
| 00:00 & 06:00 | jamKalong() | Change PPPoE profiles |
| Setiap 10 menit | syncUsageTracking() | Sync PPPoE usage |
| Setiap jam | checkFUPQuota() | Check data quota |
🐛 Troubleshooting
Port Already in Use
# Find process using port
lsof -i :3001
# Kill process
kill -9 <PID>
# Or change port in settings.json
Database Locked
# Remove WAL files
rm database/billing.db-shm
rm database/billing.db-wal
# Restart application
GenieACS Connection Failed
# Check settings
cat settings.json | grep genieacs_url
# Test connection
curl http://192.168.1.100:7557/api
WhatsApp Not Connected
- Admin Panel → WhatsApp → Logout
- Admin Panel → WhatsApp → Auth (scan QR)
- Check
whatsapp_enabled= true
Payment Not Received
- Check webhook configuration
- Verify API key & secret
- Check webhook logs: Admin → Payments → Webhook Logs
- Manual entry if needed
📱 Useful Scripts
# Test MikroTik parser
node scripts/test-mikhmon-parser.js
# Check Mikhmon data
node scripts/check-mikhmon-data.js
# Test admin account
node scripts/test-admin.js
# Send test message
node scripts/test-message.js
# Find uplink info
node scripts/find_uplink.js
🌍 Multi-Language
Current Languages
- 🇮🇩 Indonesian (id) - Default
- 🇬🇧 English (en) - Alternative
Switch Language
GET /lang/en ← Set English
GET /lang/id ← Set Indonesian
GET /?lang=en ← Query parameter
Add New Language
- Create
locales/[code].json - Copy from
locales/id.json - Translate all values
- Test:
GET /?lang=[code]
📊 Monitoring
Check System Health
curl http://localhost:3001/health
Response:
{
"status": "ok",
"timestamp": "2026-06-19T10:30:00+07:00",
"database": "connected",
"services": {
"genieacs": "connected|disconnected",
"mikrotik": "connected|disconnected"
}
}
🎯 Settings Priority
- Environment variables (
.env) - Settings file (
settings.json) - Application defaults (in code)
Example (Payment Gateway):
{
"default_gateway": "tripay",
"tripay_enabled": true,
"tripay_api_key": "xxx",
"tripay_private_key": "xxx",
"tripay_merchant_code": "xxx",
"tripay_mode": "sandbox"
}
🔗 Important Links
- GitHub: https://github.com/alijayanet/billing-rtrw
- Author: Ali Jaya Net
- Contact: 081947215703
- Email: alijayanet@gmail.com
✅ Pre-Launch Checklist
- Backup application & database
- Test all portals (customer, admin, tech, agent, collector)
- Verify MikroTik connection
- Verify GenieACS connection
- Test payment gateway
- Setup WhatsApp authentication
- Configure email/SMS gateway (if needed)
- Test backup & restore
- Setup monitoring & alerts
- Review settings.json security
- Test cron jobs (if applicable)
- Document all credentials securely
Last Updated: Juni 2026 Version: 1.0