Architecture
DealDome is structured as a layered system where a Go backend sits at the centre, connecting Telegram-based team interactions, AI agents powered by Claude, a PostgreSQL database, and a Next.js financial dashboard. Here is how everything fits together.
System overview
The following diagram shows the high-level data flow through the platform:
Telegram <--> Bot (Go) <--> AI Agents <--> Claude API (Anthropic)
|
PostgreSQL
|
REST API (Fiber)
|
Next.js Dashboard
Every user interaction starts in Telegram, flows through the Go bot service into the AI agent layer, and ultimately reads from or writes to PostgreSQL. The REST API exposes the same data to the Next.js dashboard and any external integrations.
Tech stack
Here is the full list of technologies that power DealDome:
| Technology | Purpose |
|---|---|
| Go | Primary backend language for all services |
| Fiber | HTTP framework for the REST API |
| pgx | PostgreSQL driver with connection pooling |
| PostgreSQL 16+ | Primary datastore with pgvector for AI embeddings |
| Claude API (Anthropic SDK) | Powers the AI agents (Alfred, Roos, Elisa) |
| OpenAI | Generates text embeddings for semantic search |
| go-telegram-bot-api | Telegram bot interface for team operations |
| Next.js | Financial dashboard frontend |
| OpenTelemetry | Distributed tracing and metrics |
| Sentry | Error tracking and alerting |
| BetterStack | Uptime monitoring and log aggregation |
| Docker | Containerised deployments |
Layers
Telegram interface
The Telegram bot is the primary interface for the DealDome team. Team members send commands and natural-language messages to the bot, which routes them to the appropriate AI agent. The bot supports inline keyboards, callback queries, and file uploads — all handled by go-telegram-bot-api.
Go backend
The core of the system is a single Go binary that runs both the Telegram bot and the Fiber HTTP server. Shared services like the database pool, Anthropic client, and configuration are initialised once at startup and injected into handlers. The REST API is available at https://api.dealdome.eu and follows standard REST conventions with JSON request and response bodies.
AI layer
Three AI agents — Alfred, Roos, and Elisa — each have distinct roles and system prompts. They are powered by the Anthropic Claude API with tool use, allowing them to call backend functions (look up products, query financials, update records) within conversations. Conversation history and long-term memories are stored in PostgreSQL, and semantic retrieval uses pgvector with OpenAI-generated embeddings.
Database
PostgreSQL 16 with the pgvector extension serves as the single source of truth. It stores products, daily financials, ad spend, fixed costs, financial reports, Shopify sync state, conversation history, agent memories, and user credentials. Migrations are managed with versioned SQL files.
Dashboard
The Next.js financial dashboard connects to the REST API to display P&L reports, product performance charts, ad spend breakdowns, and store-level analytics. It authenticates using the same JWT tokens as other API consumers.