Kosan Pagar Putih — Architecture

WhatsApp automation for a boarding house · architecture overview

SELF-MANAGED VPS · Linux · Docker Compose · private access (Tailscale)webhooksendAPIwritereadTailscaleProspects,tenants & ownerWhatsAppchatOwnerphone / laptopbrowserWAHAWhatsApp HTTP APIdockern8nworkflow engine · one webhook, several flowsdockerCHATBOTkeyword templates firstGemini for the rest8 s debounce · lead statusowner reply pauses botOWNER COMMANDSclosing · pay · cashvacate · summarytransfer proof read byGemini, owner confirmsSCHEDULED JOBSmonthly bills · reminderslead follow-upauto-close silent leadsauto-vacate roomsWEEKLY SUMMARYMonday owner digestfigures computed in codeGemini writes narrativecash split by pocketDASHBOARD SYNCSheets → snapshot every minuteedit webhook → Sheets + edit logKosPanelowner dashboardoccupancy · revenue · arrearsedits with conflict checkFastAPI + Reactdocker · private access onlyBACKUPSdaily job · workflow datakeeps the last 7HARDENINGfirewall: only SSH open to the internetservices bound to localhostsecrets in env files and n8n credentialscontainers restart on bootGeminiclassify intent · write replyread transfer-proof imagesexternal APIGOOGLE SHEETSLeads — status pipelineTenants — room · rent · due dayPayments — period · billed · paidCash — in / out · pocketChat log — every messageProofs — pending transfersEdit log — dashboard auditSettings — rates · templatesRecaps — formula tabssingle source of truth —written by n8n, read by KosPanelexternal, Google CloudLEGENDfrontendworkflow engineself-hosted infraAI / external APIdata storepeople / devicesinternal n8n flowVPS boundary

Automation (n8n)

  • • Chatbot: keyword templates first, Gemini for the rest; owner replies pause the bot
  • • Lead pipeline with automatic follow-up and auto-close after silence
  • • Owner runs operations from WhatsApp: closing, payments, cash, vacate, summary
  • • Monthly bills and reminders; weekly summary with figures computed in code

Infrastructure

  • • Self-managed Linux VPS, Docker Compose: WAHA, n8n, KosPanel
  • • Private access over Tailscale; only SSH open to the internet
  • • Daily backup job, last 7 kept; containers restart on boot
  • • Secrets in env files and n8n credentials

KosPanel

  • • Owner view: occupancy, revenue, arrears, monthly status per room
  • • Reads a Sheets snapshot (about a minute old); edits go through an n8n webhook
  • • Edits are conflict-checked and written to an edit log
  • • FastAPI + React in Docker on the same VPS, private access only