Case study 01 · Laravel · Oct 2026Studi kasus 01 · Laravel · Okt 2026

iEngageAI.

A member engagement module for a multi-tenant membership platform. I built every page, its Laravel backend and the API an AI engine plugs into, from zero.Modul engagement anggota untuk platform membership multi-tenant. Semua halamannya, backend Laravel-nya, dan API tempat engine AI tersambung saya bangun dari nol.

RolePeran
Sole developer of the moduleDeveloper tunggal modul
ProductProduk
ApiAries · Digital Marketing Buzz
Stack
Laravel · stancl/tenancy · MySQL · Blade · Laravel Excel
Status
Passed QA, on stagingLolos QA, di staging
10commits
105files touchedfile diubah
38tenant migrationsmigration tenant
18days, 2 – 20 Octhari, 2 – 20 Okt

My partBagian saya

Everything
but the AI.
Semua,
kecuali AI-nya.

The platform already handled memberships, events and e-courses. iEngageAI was a new paid add-on: a place to feed an AI agent with content, watch its conversations with members and measure the results. The AI model is owned by a separate team, so my job was to build the whole module and leave a clean contract for their engine.Platform ini sudah menangani membership, event dan e-course. iEngageAI adalah add-on berbayar baru: tempat mengisi konten untuk AI agent, memantau percakapannya dengan anggota, dan mengukur hasilnya. Model AI-nya dipegang tim lain, jadi tugas saya membangun seluruh modul dan menyiapkan kontrak yang rapi untuk engine mereka.

Every page under this menu, built from zero.Semua halaman di menu ini, dibangun dari nol.

What I builtYang saya bangun

  • Database design: 38 tenant migrations and 19 modelsDesain database: 38 migration tenant dan 19 model
  • Every admin page in the module, with its Blade views and AJAXSemua halaman admin di modul, beserta Blade view dan AJAX-nya
  • REST endpoints for content, settings and conversationsEndpoint REST untuk konten, pengaturan dan percakapan
  • Scheduled commands, alerts, reports and Excel exportCommand terjadwal, alert, report dan export Excel
  • Add-on gate, credit cost and per-user timezoneGerbang add-on, biaya kredit dan timezone per user
  • Channel-ready: connection status, alerts and the WhatsApp linking screen are built; the live connection is handled outside my scopeSiap channel: status koneksi, alert dan layar penautan WhatsApp sudah dibangun; koneksi live-nya ditangani di luar cakupan saya

Outside my scopeDi luar cakupan saya

  • The AI model and its replies, built by the AI teamModel AI dan balasannya, dibangun tim AI
  • The live WhatsApp connectionKoneksi WhatsApp yang live
  • QA and the release to productionQA dan rilis ke production

How it fits togetherCara semuanya tersambung

One contract,
two teams.
Satu kontrak,
dua tim.

Admins write content and settings in Laravel. The AI engine reads them through the API, and every message it sends or receives comes back through the same API, so the admin sees the full conversation and the reports stay accurate.Admin menulis konten dan pengaturan di Laravel. Engine AI membacanya lewat API, dan setiap pesan yang dikirim atau diterimanya kembali lewat API yang sama, sehingga admin melihat percakapan lengkap dan report tetap akurat.

01 · admin

iEngageAI menuMenu iEngageAI

Dashboard, Knowledge Base, Announcements, Conversations, AI Agent, Settings, Reports: 7 pages, all built by meDashboard, Knowledge Base, Announcements, Conversations, AI Agent, Settings, Reports: 7 halaman, semuanya saya bangun

02 · laravel

Tenant databaseDatabase tenant

One database per client, behind the add-on gateSatu database per klien, di balik gerbang add-on

03 · api

REST API

Read content and settings; inbound, outbound, handover, delivery statusBaca konten dan pengaturan; pesan masuk, keluar, handover, status kirim

04 · ai team

AI engineEngine AI

Answers members using the content it pulls from the APIMenjawab anggota memakai konten yang diambil dari API

05 · members

Member chatChat anggota

Members ask questions and get answersAnggota bertanya dan mendapat jawaban

built by mesaya bangunother teamtim lain

The module, page by pageModulnya, halaman per halaman

Seven parts,
one add-on.
Tujuh bagian,
satu add-on.

Screens below come from staging with dummy data. Click any screen to enlarge it.Tampilan di bawah diambil dari staging dengan data dummy. Klik gambar untuk memperbesar.

01

FoundationFondasi

iEngageAI is sold as an add-on, so it had to switch on per client without touching the core of the platform.iEngageAI dijual sebagai add-on, jadi harus bisa aktif per klien tanpa mengubah inti platform.

  • Its own route group behind an add-on middleware; tenants without the add-on never reach the pagesRoute group sendiri di balik middleware add-on; tenant tanpa add-on tidak bisa membuka halamannya
  • Credit cost wired into the existing add-ons pageBiaya kredit tersambung ke halaman add-on yang sudah ada
  • Sidebar submenu that appears only when the add-on is onSubmenu sidebar yang hanya muncul saat add-on aktif
  • Per-user timezone (middleware and helper), so schedules and reports show local timeTimezone per user (middleware dan helper), supaya jadwal dan report tampil dalam waktu lokal
  • Every table is a tenant migration: each client's data lives in its own databaseSemua tabel adalah migration tenant: data tiap klien ada di database-nya sendiri
02

Knowledge base

The articles the AI agent learns from. Admins organise them the way the association already thinks about its content.Artikel yang menjadi bahan belajar AI agent. Admin menyusunnya sesuai cara asosiasi mengelompokkan kontennya.

  • Sections, categories, labels and tags, each with its own pivot tableSection, kategori, label dan tag, masing-masing dengan tabel pivot sendiri
  • Visibility per member group, so the AI only uses what a member may seeVisibilitas per kelompok anggota, jadi AI hanya memakai yang boleh dilihat anggota tersebut
  • Media as uploaded files or external URLsMedia berupa file upload atau URL eksternal
  • Temporary uploads on the create page, attached when the article is first savedUpload sementara di halaman create, ditempelkan saat artikel pertama kali disimpan
  • Draft and publish, plus one "save all" request that syncs every taxonomy at onceDraft dan publish, plus satu request "save all" yang menyinkronkan semua taksonomi sekaligus
  • Read API (list and by slug) for the AI engineAPI baca (daftar dan per slug) untuk engine AI
Article list: published and draft tabs, search, category filterDaftar artikel: tab published dan draft, pencarian, filter kategori
Editor with categories, tags and attached media (file or URL)Editor dengan kategori, tag dan media lampiran (file atau URL)
03

Announcements

News the AI agent can share with members, with the same structure as the knowledge base plus a publish schedule.Kabar yang bisa dibagikan AI agent ke anggota, dengan struktur sama seperti knowledge base ditambah jadwal publish.

  • Published, draft and scheduled tabsTab published, draft dan scheduled
  • A scheduled command, announcements:publish-scheduled, publishes them on timeCommand terjadwal announcements:publish-scheduled mem-publish tepat waktu
  • Categories, labels, tags, sections, visibility and media like the KBKategori, label, tag, section, visibilitas dan media seperti KB
  • Read API for the AI engineAPI baca untuk engine AI
List with published, draft and scheduled tabsDaftar dengan tab published, draft dan scheduled
Editor with an optional publish scheduleEditor dengan jadwal publish opsional
04

Conversations

Where admins watch the AI talk to members and step in when it cannot help. This is the largest API in the module.Tempat admin memantau AI berbicara dengan anggota dan turun tangan saat AI tidak bisa membantu. Ini API terbesar di modul.

  • Inbound and outbound message endpoints, ready for the AI team's engineEndpoint pesan masuk dan keluar, siap untuk engine tim AI
  • Phone numbers normalised, then matched to the member recordNomor telepon dinormalisasi, lalu dicocokkan ke data anggota
  • "Needs human" handover that the admin can switch on or offHandover "needs human" yang bisa dinyalakan atau dimatikan admin
  • Admin replies, with attachments and soft-deleted messagesBalasan admin, dengan lampiran dan pesan yang di-soft delete
  • Delivery status webhook (sent, failed) stored per messageWebhook status kirim (terkirim, gagal) disimpan per pesan
  • An "AI needs review" alert raised automaticallyAlert "AI needs review" dibuat otomatis
Inbox: matched member, membership plan, last message, "need human" flagInbox: anggota yang cocok, paket membership, pesan terakhir, tanda "need human"
Thread with inbound and outbound messages, attachments and "clear needs human"Thread dengan pesan masuk dan keluar, lampiran, dan "clear needs human"
05

Dashboard & alertsDashboard & alert

The first screen an admin sees: how the agent is doing and what needs attention right now.Layar pertama yang dilihat admin: performa agent dan apa yang perlu ditangani sekarang.

  • KPI cards for conversations, members and messagesKartu KPI untuk percakapan, anggota dan pesan
  • Action-required list built from alerts, one per type, so problems never pile up as duplicatesDaftar action required dari alert, satu per tipe, jadi masalah tidak menumpuk sebagai duplikat
  • Admins resolve alerts; the resolver and time are recordedAdmin me-resolve alert; siapa dan kapan dicatat
  • Integration health refreshed by iengage:refresh-integration-statusKesehatan integrasi diperbarui oleh iengage:refresh-integration-status
  • Automation runs logged with status, payload and errorsAutomation run dicatat dengan status, payload dan error
Status bar, KPI cards and the action-required listStatus bar, kartu KPI dan daftar action required
06

Reports

The numbers a client needs to judge whether the AI agent is worth paying for.Angka yang dibutuhkan klien untuk menilai apakah AI agent layak dibayar.

  • KPIs: conversations, unique members, messages sent, handovers, AI resolution rateKPI: percakapan, anggota unik, pesan terkirim, handover, AI resolution rate
  • Trend chart that picks daily, weekly or monthly points from the date rangeGrafik tren yang memilih titik harian, mingguan atau bulanan sesuai rentang tanggal
  • Outcome and delivery status breakdownsRincian hasil percakapan dan status pengiriman
  • Summary table with AJAX filters (date, agent, language, search) and paginationTabel ringkasan dengan filter AJAX (tanggal, agent, bahasa, pencarian) dan pagination
  • Excel export as a 6-sheet workbookExport Excel berupa workbook 6 sheet
Filters, six KPIs, conversation trend and outcomesFilter, enam KPI, tren percakapan dan hasil
Automation performance, delivery status and the filtered summary tablePerforma automation, status pengiriman dan tabel ringkasan ber-filter
07

AI agent & settingsAI agent & pengaturan

The controls that shape how the agent sounds and which automated messages the client wants to send.Pengaturan yang menentukan gaya bicara agent dan pesan otomatis apa saja yang ingin dikirim klien.

  • Agent profile: name, avatar upload, tone of voice, reply lengthProfil agent: nama, upload avatar, gaya bahasa, panjang balasan
  • Several reply languages, with a live chat previewBeberapa bahasa balasan, dengan preview chat langsung
  • Notification switches grouped by membership, events, e-course and CPDSaklar notifikasi dikelompokkan per membership, event, e-course dan CPD
  • Agent settings exposed through the API, so the AI side reads the same valuesPengaturan agent dibuka lewat API, jadi sisi AI membaca nilai yang sama
Profile, tone, reply length, languages, live preview and the channel linking screenProfil, gaya bahasa, panjang balasan, bahasa, preview langsung dan layar penautan channel
Notification switches by membership, events, e-course and CPDSaklar notifikasi per membership, event, e-course dan CPD

Engineering notesCatatan teknis

The hard
parts.
Bagian yang
sulit.

Decisions that shaped the code, described without sharing any of it.Keputusan yang membentuk kodenya, dijelaskan tanpa membagikan kodenya.

01 · tenancy

One codebase, a database per clientSatu codebase, satu database per klien

Every table ships as a tenant migration and every route sits behind the add-on gate, so turning iEngageAI on for one association never touches another's data.Semua tabel dibuat sebagai migration tenant dan semua route ada di balik gerbang add-on, jadi menyalakan iEngageAI untuk satu asosiasi tidak pernah menyentuh data asosiasi lain.

02 · contract

Built for a team I don't controlDibangun untuk tim di luar kendali saya

The AI engine came from another team, so I defined the API first: read endpoints for content and settings, inbound and outbound for messages, a status webhook. They could plug in without touching the admin.Engine AI datang dari tim lain, jadi saya mendefinisikan API-nya lebih dulu: endpoint baca untuk konten dan pengaturan, masuk dan keluar untuk pesan, dan webhook status. Mereka bisa tersambung tanpa menyentuh admin.

03 · matching

Messy phone numbersNomor telepon yang berantakan

Members store numbers with and without country codes, spaces and symbols. Numbers are normalised before matching, so a conversation lands on the right member and the reports count unique members correctly.Anggota menyimpan nomor dengan dan tanpa kode negara, spasi dan simbol. Nomor dinormalisasi sebelum dicocokkan, sehingga percakapan masuk ke anggota yang tepat dan report menghitung anggota unik dengan benar.

04 · reports

Numbers that agree everywhereAngka yang sama di mana pun

Every chart, the summary table and the Excel workbook go through one shared filter builder, so the dashboard, the screen and the exported file always show the same totals.Semua grafik, tabel ringkasan dan workbook Excel melewati satu filter builder yang sama, jadi dashboard, layar dan file export selalu menampilkan total yang sama.