Asisten keuangan berbasis WhatsApp untuk mengelola tabungan dan pengeluaran dengan mudah. Dilengkapi dashboard admin berbasis web untuk monitoring dan pengelolaan data.
- Fitur Utama
- Quick Start
- Konfigurasi
- Perintah WhatsApp
- Dashboard Admin
- API Endpoints
- Struktur Project
- Database Schema
- Troubleshooting
- Tech Stack
Setoran via QRIS
- Generate QR code pembayaran otomatis
- Verifikasi bukti transfer dengan screenshot
- Konfirmasi setoran real-time
Penarikan Dana
- Request penarikan dengan nominal
- Sistem approval oleh admin
- Notifikasi status penarikan
Tracking Saldo
- Cek saldo real-time
- Riwayat transaksi lengkap
- Filter berdasarkan tanggal/tipe
Catat Pengeluaran Harian
/catat 50000 makanan makan siang
/catat 150000 transport bensin motor
/catat 500000 tagihan listrik bulan ini
10 Kategori Default
| Kode | Nama | Icon |
|---|---|---|
makanan |
Makanan & Minuman | 🍔 |
transport |
Transportasi | 🚗 |
belanja |
Belanja | 🛒 |
tagihan |
Tagihan | 💡 |
hiburan |
Hiburan | 🎮 |
kesehatan |
Kesehatan | 💊 |
pendidikan |
Pendidikan | 📚 |
rumah |
Rumah Tangga | 🏠 |
bisnis |
Bisnis | 💼 |
lainnya |
Lainnya | ❓ |
Ringkasan Bulanan
- Total pengeluaran per bulan
- Breakdown per kategori dengan persentase
- Riwayat 5 transaksi terakhir
Set Budget Bulanan
/budget makanan 500000 # Limit makan 500rb/bulan
/budget transport 300000 # Limit transport 300rb/bulan
Peringatan Otomatis
⚠️ Warning saat penggunaan > 80%- 🚨 Alert saat budget terlampaui
- Notifikasi setiap kali catat pengeluaran
Monitoring Status
/budgets # Lihat semua budget dan status
- Buat target dengan nama dan nominal
- Progress bar visual
- Notifikasi saat target tercapai
- Multiple targets support
Badge System
- First Deposit Badge
- Consistency Badge (7 hari berturut)
- Milestone Badge (100rb, 500rb, 1jt)
Daily Features
- Motivational quotes harian (07:00)
- Weekly report (Minggu 08:00)
- Daily tips tentang finansial
- Pengingat tabungan otomatis
- Broadcast pesan ke semua user
- Jadwal reminder customizable
# Node.js 18 atau lebih baru
node --version # v18.x.x atau lebih
# npm
npm --version # 9.x.x atau lebih# 1. Clone repository
git clone https://github.com/your-repo/tabungan-bot.git
cd tabungan-bot
# 2. Install dependencies
npm install
# 3. Copy environment file
cp .env.example .env
# 4. Edit konfigurasi
# Buka .env dan sesuaikan
# 5. Jalankan
npm run dev- Terminal akan menampilkan QR code
- Buka WhatsApp di HP
- Scan QR code (Settings → Linked Devices → Link a Device)
- Bot siap digunakan!
Buat file .env di root project:
# ===== SERVER =====
PORT=3847
NODE_ENV=development
# ===== ADMIN DASHBOARD =====
ADMIN_USERNAME=admin
ADMIN_PASSWORD=rahasia123
JWT_SECRET=jwt_secret_key_yang_panjang_dan_aman
# ===== WHATSAPP =====
# Session akan tersimpan otomatis di .wwebjs_auth/
# ===== QRIS (Opsional) =====
QRIS_MERCHANT_ID=your_merchant_id
QRIS_API_KEY=your_api_key
# ===== BACKUP =====
BACKUP_PATH=./backups
AUTO_BACKUP=true
BACKUP_TIME=02:00| Variable | Deskripsi | Default |
|---|---|---|
PORT |
Port server | 3847 |
NODE_ENV |
Environment (development/production) | development |
ADMIN_USERNAME |
Username login dashboard | admin |
ADMIN_PASSWORD |
Password login dashboard | - |
JWT_SECRET |
Secret key untuk JWT token | - |
AUTO_BACKUP |
Aktifkan backup otomatis | true |
BACKUP_TIME |
Jam backup harian | 02:00 |
| Perintah | Deskripsi | Contoh |
|---|---|---|
/start |
Mulai bot & panduan | /start |
/help |
Daftar semua perintah | /help |
/daftar [nama] |
Registrasi user baru | /daftar Budi Santoso |
/login |
Login ke akun | /login |
/logout |
Logout dari akun | /logout |
| Perintah | Deskripsi | Contoh |
|---|---|---|
/setor [nominal] |
Setoran via QRIS | /setor 100000 |
/tarik [nominal] |
Request penarikan | /tarik 50000 |
/saldo |
Cek saldo terkini | /saldo |
/riwayat |
Riwayat transaksi | /riwayat |
| Perintah | Deskripsi | Contoh |
|---|---|---|
/catat [nominal] [kategori] [ket] |
Catat pengeluaran | /catat 50000 makanan nasi goreng |
/pengeluaran |
Ringkasan bulanan | /pengeluaran |
/kategori |
Daftar kategori | /kategori |
| Perintah | Deskripsi | Contoh |
|---|---|---|
/budget [kategori] [limit] |
Set budget bulanan | /budget makanan 500000 |
/budgets |
Status semua budget | /budgets |
| Perintah | Deskripsi | Contoh |
|---|---|---|
/target |
Lihat target | /target |
/target buat [nama] [nominal] |
Buat target baru | /target buat iPhone 15000000 |
/target hapus [id] |
Hapus target | /target hapus 1 |
URL: http://localhost:3847/dashboard
Username: (sesuai .env)
Password: (sesuai .env)
| Tab | Fungsi |
|---|---|
| Dashboard | Overview statistik: total saldo, user, transaksi, target aktif |
| Analisis | Grafik tren setoran/penarikan, breakdown per metode pembayaran |
| Transaksi | List semua transaksi, filter, edit status, hapus, export PDF/Excel |
| Users | Kelola user, edit data, broadcast pesan, hapus user |
| Penarikan | Approve/reject request penarikan |
| Reminder | Kirim pengingat ke user |
| Backup | Create backup, restore, download, delete backup |
| Pengeluaran | Pie chart kategori, tabel expense, export PDF/Excel |
| Status koneksi, QR code, logout |
PDF Export
- Header profesional dengan judul
- Summary cards (Total, Setoran, Penarikan)
- Tabel transaksi dengan zebra striping
- Footer dengan timestamp
Excel Export
- Sheet 1: Ringkasan dengan statistik
- Sheet 2: Detail transaksi lengkap
- Color-coded cells
- Format angka Rupiah
- Frozen header row
POST /api/login
Content-Type: application/json
{
"username": "admin",
"password": "password"
}
Response: { "token": "jwt_token_here" }GET /api/stats
Authorization: Bearer <token>
Response: {
"totalSavings": 5000000,
"totalUsers": 25,
"totalTransactions": 150,
"activeGoals": 10
}# Get all transactions
GET /api/transactions
# Update status
PUT /api/transactions/:id/status
{ "status": "success" }
# Delete transaction
DELETE /api/transactions/:id
# Export PDF
GET /api/transactions/export/pdf?token=<jwt>
# Export Excel
GET /api/transactions/export/excel?token=<jwt># Get all users
GET /api/users
# Update user
PUT /api/users/:id
{ "name": "New Name", "phone_number": "08xxx" }
# Delete user
DELETE /api/users/:id
# Broadcast message
POST /api/broadcast
{ "message": "Pengumuman...", "userIds": [1, 2, 3] }# Get all expenses
GET /api/expenses
# Get summary by category
GET /api/expenses/summary?month=2026-01
# Get categories
GET /api/expenses/categories
# Delete expense
DELETE /api/expenses/:id
# Export PDF
GET /api/expenses/export/pdf?token=<jwt>
# Export Excel
GET /api/expenses/export/excel?token=<jwt># Get all withdrawals
GET /api/withdrawals
# Get pending count
GET /api/withdrawals/pending/count
# Approve/Reject
PUT /api/withdrawals/:id/status
{ "status": "approved" } # atau "rejected"# List backups
GET /api/backup/list
# Create backup
POST /api/backup/create
# Restore backup
POST /api/backup/restore
{ "filename": "backup_2026-01-01.db" }
# Delete backup
DELETE /api/backup/:filename# Get status
GET /api/whatsapp/status
# SSE Stream (realtime updates)
GET /api/whatsapp/stream?token=<jwt>
# Logout
POST /api/whatsapp/logout
# Test connection
POST /api/whatsapp/testtabungan-bot/
│
├── server.js # Entry point & Express setup
├── package.json # Dependencies
├── .env # Environment variables
├── .env.example # Template environment
├── README.md # Dokumentasi
│
├── src/
│ ├── bot/
│ │ ├── whatsapp.js # WhatsApp client initialization
│ │ └── handlers.js # Command handlers (/setor, /catat, dll)
│ │
│ ├── database/
│ │ ├── database.db # SQLite database file
│ │ ├── migrations.js # Table schemas & migrations
│ │ └── models.js # CRUD operations
│ │
│ ├── routes/
│ │ └── api.js # REST API endpoints
│ │
│ ├── features/
│ │ ├── backup.js # Backup & restore system
│ │ ├── quotes.js # Motivational quotes
│ │ └── gamification.js # Badge system
│ │
│ ├── payments/
│ │ ├── qris.js # QRIS integration
│ │ └── screenshot.js # Screenshot verification
│ │
│ ├── middlewares/
│ │ ├── rateLimiter.js # Rate limiting
│ │ └── validators.js # Input validation
│ │
│ └── utils/
│ └── logger.js # Logging utility
│
├── public/
│ └── dashboard/
│ └── index.html # Admin dashboard (SPA)
│
├── backups/ # Backup files
│
└── .wwebjs_auth/ # WhatsApp session data
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT,
phone_number TEXT UNIQUE,
balance DECIMAL(10, 2) DEFAULT 0,
visitor_id TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE transactions (
id INTEGER PRIMARY KEY,
user_id INTEGER,
type TEXT, -- 'deposit' atau 'withdrawal'
amount DECIMAL(10, 2),
payment_method TEXT,
status TEXT, -- 'pending', 'success', 'failed'
confirmed BOOLEAN DEFAULT 0,
screenshot_path TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id)
);CREATE TABLE expenses (
id INTEGER PRIMARY KEY,
user_id INTEGER,
amount DECIMAL(10, 2),
category TEXT,
description TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id)
);CREATE TABLE expense_categories (
id INTEGER PRIMARY KEY,
code TEXT UNIQUE,
name TEXT,
icon TEXT,
color TEXT
);CREATE TABLE budgets (
id INTEGER PRIMARY KEY,
user_id INTEGER,
category TEXT,
monthly_limit DECIMAL(10, 2),
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
UNIQUE(user_id, category)
);CREATE TABLE goals (
id INTEGER PRIMARY KEY,
user_id INTEGER,
name TEXT,
target_amount DECIMAL(10, 2),
current_amount DECIMAL(10, 2) DEFAULT 0,
deadline DATE,
completed BOOLEAN DEFAULT 0,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE withdrawals (
id INTEGER PRIMARY KEY,
user_id INTEGER,
amount DECIMAL(10, 2),
account_type TEXT,
account_number TEXT,
account_name TEXT,
status TEXT DEFAULT 'pending',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);# Hapus session lama
rm -rf .wwebjs_auth
# Restart server
npm run dev
# Scan ulang QR code# Windows - Install dependencies
npm install puppeteer
# Linux - Install Chromium
sudo apt install chromium-browser# Stop semua proses
pkill -f "node server.js"
# Restart
npm run dev# Cari proses yang menggunakan port
netstat -ano | findstr :3847
# Kill proses (Windows)
taskkill /PID <PID> /F
# Atau ganti port di .env
PORT=3848# Install dependencies
npm install pdfkit exceljs
# Restart server
npm run dev| Component | Technology |
|---|---|
| Runtime | Node.js 18+ |
| Framework | Express 4.x |
| Database | SQLite3 |
| whatsapp-web.js | |
| Authentication | JWT (jsonwebtoken) |
| PDF Export | PDFKit |
| Excel Export | ExcelJS |
| Charts | Chart.js |
| Validation | express-validator |
| Rate Limiting | express-rate-limit |
| File Upload | Multer |
{
"dependencies": {
"express": "^4.18.2",
"whatsapp-web.js": "^1.23.0",
"sqlite3": "^5.1.6",
"jsonwebtoken": "^9.0.2",
"pdfkit": "^0.14.0",
"exceljs": "^4.4.0",
"qrcode-terminal": "^0.12.0",
"qrcode": "^1.5.3",
"multer": "^1.4.5-lts.1",
"express-rate-limit": "^7.1.5",
"express-validator": "^7.0.1"
},
"devDependencies": {
"nodemon": "^3.0.2"
}
}{
"scripts": {
"start": "node server.js",
"dev": "nodemon server.js",
"backup": "node scripts/backup.js"
}
}- ✅ JWT Authentication untuk API
- ✅ Password hashing (bcrypt)
- ✅ Rate limiting pada endpoints
- ✅ Input validation & sanitization
- ✅ SQL injection protection (parameterized queries)
- ✅ XSS protection
- ✅ CORS configuration
MIT License
Copyright (c) 2026
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software.
- Fork repository ini
- Buat branch fitur (
git checkout -b feature/FiturBaru) - Commit perubahan (
git commit -m 'Tambah FiturBaru') - Push ke branch (
git push origin feature/FiturBaru) - Buat Pull Request
Jika mengalami masalah:
- � Buka Issue di GitHub
- 📧 Email: support@example.com
- whatsapp-web.js - WhatsApp Web API
- Chart.js - Charts library
- Font Awesome - Icons
Made with ❤️ in Indonesia
© 2026 Tabungan Bot. All rights reserved.