Architecture Overview

Outpost follows a simple, monorepo-based architecture: five application processes sharing a single PostgreSQL database. This keeps operational complexity low while enabling independent scaling.

System Diagram

architecture diagram
┌──────────────────────────────────────────────────────────────────────────────┐
│                          apps/web (Next.js)                                  │
│       Dashboard · Accounts · Tickets · Agents · Broadcasts                   │
├──────────────────┬──────────────────┬──────────────────┬────────────────────┤
│ apps/discord-botapps/slack-botapps/teams-botapps/github-app  │
│ Slash cmds       │  Channels        │  Adaptive Cards  │  Issues            │
│ Threads          │  Block Kit       │  Webhooks        │  Discussions       │
├─────────┬────────┴──┬───────────┬───┴──────────────────┴────────────────────┤
│ pkg/aipkg/queuepkg/sharedpkg/db                        │
│Pathfinder│ Postgres  │ Types &   │              Prisma                       │
│+ Claude │ Job Queue │ Constants │              Schema                       │
├─────────┴───────────┴───────────┴───────────────────────────────────────────┤
│                          PostgreSQL 16                                        │
└──────────────────────────────────────────────────────────────────────────────┘

Applications

apps/web — Next.js Dashboard

The primary user interface. Built with Next.js App Router, it provides the ticket management dashboard, account views, analytics, agent configuration, and broadcast management. Runs on port 3000 by default.

apps/discord-bot — Discord Integration

A standalone Node.js process using discord.js. It connects to Discord via WebSocket, handles slash commands (/ticket, /status, etc.), manages support threads, and creates tickets from Discord messages. Shares the same database as the web app for real-time sync.

apps/github-app — GitHub Integration

A GitHub App that receives webhooks for issues, discussions, and pull requests. It auto-triages incoming issues, syncs labels, and links GitHub activity to Outpost tickets. Runs as an Express server that GitHub sends webhooks to.

apps/slack-bot — Slack Integration

A Slack bot using @slack/bolt. Monitors Slack Connect channels for new messages and threads, creates tickets, enqueues AI responses, and handles feedback via Block Kit action buttons. Supports slash commands (/outpost-assign, /outpost-close, /outpost-escalate, /outpost-priority).

apps/teams-bot — Microsoft Teams Integration

A Microsoft Teams bot using the Bot Framework SDK (botbuilder). Receives webhook posts from Azure Bot Service, creates tickets from channel messages, and responds with Adaptive Cards that include action buttons for feedback and escalation.

Shared Packages

packages/ai — AI Pipeline

The intelligence layer. Uses Pathfinder for semantic search across the knowledge base and Claude for ticket classification, priority assignment, response drafting, and routing decisions. All AI operations go through this package.

packages/queue — Job Queue

A Postgres-backed job queue for reliable background processing. Handles webhook delivery, broadcast sending, SLA check scheduling, and AI pipeline execution. Uses SKIP LOCKED for safe concurrent processing with automatic retries and dead-letter support.

packages/db — Database

Prisma schema and generated client. Defines the data model for tickets, accounts, messages, SLA configurations, routing rules, and more. Uses Prisma for type-safe queries and similarity search.

packages/shared — Shared Utilities

TypeScript types, constants, and utility functions shared across all applications. Includes ticket status enums, priority levels, SLA calculation helpers, and validation schemas.

Sync Engine

Outpost includes a SyncEngine that orchestrates bidirectional synchronization between Outpost tickets and external issue trackers (GitHub Issues, Linear, and more). The sync system uses an adapter plugin pattern — each tracker has a dedicated adapter that handles field mapping, webhook processing, and outbound API calls. See the Sync documentation for details.

Account Intelligence — HubSpot CRM Sync

Beyond ticket sync, Outpost enriches account data from HubSpot CRM. The HubSpot integration pulls company records — name, domain, ACV, close dates, and deal owner — and maps them to Outpost accounts. This runs on a daily schedule via the job queue, with on-demand sync available from the Settings page. Single-account sync by domain is also supported for real-time enrichment when new accounts arrive.

Data Flow

Incoming Ticket

  1. A message arrives via Discord, Slack, Teams, GitHub, or the web form
  2. The integration creates a raw ticket in the database
  3. A job is enqueued for AI triage
  4. The AI pipeline classifies priority, assigns tags, and suggests routing
  5. The SLA engine sets response/resolution deadlines based on priority
  6. The ticket appears in the dashboard and notifications are sent

Outgoing Response

  1. An agent drafts a response in the dashboard
  2. AI suggests improvements or relevant documentation links
  3. The response is sent back to the originating channel
  4. SLA timers are updated

Database

PostgreSQL 16 is the single source of truth. All five processes connect to the same database, which means changes are immediately visible everywhere without any message bus or cache invalidation complexity.

Why one database? Outpost is designed for teams of 1-50 support agents. At this scale, a single Postgres instance handles the load easily, and the simplicity of a shared database eliminates an entire class of consistency bugs.

Technology Stack

ComponentTechnology
Web FrameworkNext.js 14 (App Router)
LanguageTypeScript
DatabasePostgreSQL 16
ORMPrisma
AIClaude (Anthropic) + Pathfinder
Discorddiscord.js
Slack@slack/bolt
TeamsBot Framework SDK (botbuilder)
GitHubOctokit / Probot
MonorepoTurborepo + pnpm workspaces