Prompt resmi repo ini sekarang mengacu pada blueprint layanan hasil investigasi produk referensi. Dokumen lengkap: - `docs/fonnte-service-blueprint.md` Prompt acuan: Bangun platform layanan WhatsApp gateway multi-tenant seperti model layanan Fonnte, tetapi gunakan arsitektur modular, bersih, dan siap dikembangkan di repo ini. Tujuan produk: Menyediakan platform WhatsApp self-service untuk customer dan panel kontrol untuk provider/admin, dengan layanan inti pengelolaan device WhatsApp, pengiriman pesan, automasi, webhook, inbox, statistik, dan billing. Catatan penting: - Jadikan Fonnte sebagai referensi layanan/fitur, bukan referensi style UI. - Sistem harus mendukung 2 channel: 1. official cloud API 2. unofficial QR session - Jalur unofficial harus diberi peringatan risiko ban. - Aplikasi harus multi-user dan multi-account. - Harus ada pemisahan peran: - provider_admin - provider_staff - customer Ruang lingkup fitur utama: 1. Account & Auth - Registrasi customer - Login admin dan customer terpisah - Session login - Profil akun - Pengaturan timezone, country, token akun, notifikasi fallback 2. Device / WhatsApp Account Management - Satu user bisa memiliki banyak device/akun WhatsApp - Tambah device - Edit device - Hubungkan device via QR - Hubungkan device via number/code - Status connect/disconnect - Simpan token device - Opsi chatbot on/off - Opsi personal/group message handling - Token whitelist IP - Device settings per akun 3. Messaging Center - Kirim pesan dari device tertentu - Target bisa dipilih dari: - nomor manual - kontak - grup internal - WhatsApp group - import file - spreadsheet - Dukungan pesan text - Siapkan struktur extensible untuk attachment/media 4. Contact & Group Data - Contact management - Group management internal - WhatsApp group listing - Import contact - Variabel per contact - Mapping contact ke group 5. Template & Interactive Content - Template pesan - Poll template - Button template - Submission/form template - Struktur template reusable lintas device 6. Automation Engine - Autoreply rule builder - Source rule: - message - poll - spreadsheet - flow - Response type: - message - button - template - submission - CS - poll - Matching logic: - exact - contains - begin - end - Default reply - Limitation/rate guard - Forward action - Variable parser seperti {name}, {sender} 7. Advanced Automation - Recurring message - Follow-up - Chaining / flow sequence - Rotator - Scheduled execution - Retry / reschedule 8. Webhook & Integration Center - Webhook connect event - Webhook message status - Webhook chaining/flow event - Failed webhook list - Resend failed webhook - API integration center - AI integration settings - Simpan secret/key integrasi 9. Inbox, History, Statistics - Incoming inbox - Message history outbound/inbound - Status message: - pending - sent - processing - failed - Statistik harian, mingguan, bulanan - Statistik incoming vs outgoing - Statistik per device - Statistik per tipe pesan 10. CS Multi Agent - Division - Agent - CS template - CS report - Routing sederhana berbasis divisi/weight 11. Billing / Package - Paket per device/account - Quota / duration - Invoice list - Package history - Dasar struktur billing walau payment gateway belum final 12. Architecture & Engineering Requirements - Backend modular per domain - View modular per area admin/customer - Service layer terpisah - Repository/data access terpisah - Database schema normal dan extensible - Audit/event logging - Error handling konsisten - Siapkan queue/async-friendly flow untuk webhook dan automation - Hindari coupling antara official cloud API dan unofficial QR engine 13. UI/UX Requirements - Dashboard provider dan customer terpisah - Sidebar fokus navigasi - Header fokus session/user context - Halaman tidak menumpuk semua fitur dalam satu page panjang - Tiap domain punya page sendiri: - devices - send - contacts - groups - templates - autoreply - webhooks - inbox - history - statistics - billing - settings - UI harus proporsional, modular, dan mudah diskalakan 14. Deliverables - Struktur folder modular - Database schema - Route map - Controller/service/repository design - EJS pages terpisah admin/customer - Dummy data / seed awal bila perlu - Dokumentasi fitur dan alur sistem