System Architecture

Last updated: March 24, 2026

Three channels, one orchestrator

Board Game Librarian runs on 20 PM2 processes. All three user-facing channels -- Telegram bot, web chat, and partner widget -- route through a single orchestrator service. That is where the Q&A logic lives.

Loading diagram...

The orchestrator is the critical path. If it goes down, all three channels stop answering questions. Everything else can be degraded without a total outage.

The 20 services

Critical (must run)

ServicePortRole
rules-orchestrator3460Q&A pipeline, AI synthesis
telegram-bot3461Telegram webhook handler
web-frontend3474Next.js: chat, admin, marketing
game-library-api3459Game catalog, user management
embedding-api3462Vector generation (Python/Flask)

Supporting (degraded without)

ServicePortRole
pdf-api3457PDF extraction (Apache Tika)
crawlee-api3456BGG forum scraping
redis-cache-api3463Game data cache
game-data-sync3471Nightly BGG metadata sync
corpus-analyzer3481Query expansion, intent detection

Publisher sync (scheduled)

ServicePortSchedule
eog-sync3466Daily 03:30
gmt-sync3470Daily 03:31
stonemaier-sync3469Daily 03:32
tabletopia-sync3464Daily + weekly
ludus-magnus-sync3473Weekly Sun 01:00

Technology stack

LayerTechnology
DatabasePostgreSQL 16 + pgvector extension
Vector indexingHNSW (approximate nearest neighbor)
AI synthesisOpenRouter -> GPT-4o / Claude
Embeddingsjina-v2-small-en (768-dim, Python)
Web frameworkNext.js 15 (App Router)
Backend APIsExpress 4.x (Node.js)
CacheRedis 7
Process managerPM2
ObservabilityJaeger + Phoenix + OpenTelemetry