BESTDESK Production Architecture

BESTDESK Production Architecture A architecture diagram generated by Archify. Bestinet VPS · Ubuntu 24.04 · self-managed JWT + bcrypt · key-only SSH · fail2ban Operators & Teams · CM OPS · SD · PS · JWT + bcrypt · key-only SSH · fail2ban · Desktop first Operators & Teams CM OPS · SD · PS Desktop first nginx · TLS · same-origin · Bestinet VPS · Ubuntu 24.04 · self-managed › JWT + bcrypt · key-only SSH · fail2ban · bestdesk.my nginx TLS · same-origin bestdesk.my FastAPI Application · backend/main.py · Bestinet VPS · Ubuntu 24.04 · self-managed · SQLAlchemy sync FastAPI Application backend/main.py SQLAlchemy sync Asternic Poller · systemd · 5s poll · Bestinet VPS · Ubuntu 24.04 · self-managed · X-Poller-Secret Asternic Poller systemd · 5s poll X-Poller-Secret PostgreSQL · tickets · KB · reference · Bestinet VPS · Ubuntu 24.04 · self-managed · pool 2+3 PostgreSQL tickets · KB · reference pool 2+3 Claude Haiku · claude-haiku-4-5 · Architecture component · 30s timeout Claude Haiku claude-haiku-4-5 30s timeout Ollama llama3.2 · fallback when no key · Bestinet VPS · Ubuntu 24.04 · self-managed Ollama llama3.2 fallback when no key Gmail Mailbox · IMAP poll + SMTP send · Architecture component · Email Triage Gmail Mailbox IMAP poll + SMTP send Email Triage Bestinet SST API · ePLKS / VDR status · Architecture component · API-key auth Bestinet SST API ePLKS / VDR status API-key auth Asternic Call Center Stats · bestinet.oren.cloud · Architecture component · scraped Asternic Call Center Stats bestinet.oren.cloud scraped Telegram Bot API · breach + escalation alerts · Architecture component Telegram Bot API breach + escalation alerts HTTPS + JWT reverse proxy /api SQLAlchemy AI assist IMAP poll status recheck breach alerts scrape realtime POST /call-events/snapshot Legend Backend Database Cloud External

Deployment and hosting

  • • nginx terminates TLS and serves the same origin as the API
  • • systemd services: bestdesk for the API, a separate unit for the call poller
  • • GitHub Actions deploys by SSH: git pull, chown, restart, /api/health poll
  • • Render remains a paused fallback with auto-deploy disabled

Data and persistence

  • • Self-hosted PostgreSQL holds tickets, KB v3.1, bulk request items and the 340,000+ FWCMS reference records
  • • SQLAlchemy with a small persistent connection pool plus a 4-minute heartbeat
  • • SQLite remains the local development database
  • • Schema migrations and seeds run in the startup bootstrap

AI layer

  • • Claude Haiku (claude-haiku-4-5) is primary, with a 30-second budget and graceful fallback
  • • Ollama llama3.2 takes over when no Anthropic API key is set
  • • Five wired functions: classify, draft reply, summarize, suggest escalation, detect sentiment
  • • AI never blocks ticket creation and never auto-sends a customer reply

External integrations

  • • Asternic call center portal scraped every 5 seconds for phone sessions
  • • Gmail inbox polled over IMAP with AI-assisted email triage and SMTP replies
  • • Bestinet SST API supplies live ePLKS and VDR status rechecks
  • • Telegram bot delivers breach and escalation alerts