Architecture

Services

The 15 Docker services that make up the Binexia stack.

Binexia runs as a single Docker Compose stack with 15 core services + 3 optional profile-gated services. All inter-service communication uses Docker network DNS — the browser only reaches the Nuxt frontend.

Service Map

Browser (:6080)
  └─► Nuxt 3 Frontend
        │  Proxies /api/* to Laravel

        └─► Laravel 12 API (:6081)
              ├─► PostgreSQL 16 (:5432) — 5 schemas + pgvector
              ├─► Redis 7 (:6379) — cache, queues, sessions
              ├─► Agno FastAPI (:8001) ─► LLM providers (via litellm library)
              ├─► LiteLLM Proxy (:4000) ─► unified LLM gateway
              │     └─► OpenAI/Compatible, Anthropic, Google Gemini, Mistral, OpenRouter, Cohere
              ├─► Dify API (:5001) + Worker ─► LiteLLM Proxy ─► LLM providers
              ├─► MinIO (:9000) — document storage
              ├─► Mailpit (:1025) — SMTP testing
              ├─► Metabase (:3000) — BI dashboards
              ├─► Uptime Kuma (:3001) — service monitoring
              ├─► Dozzle (:8080) — log viewer

              ├─► [profile: documents]
              │     ├─► Docling (:8010) — PDF/document parsing
              │     └─► PaddleOCR (:8015) — table-aware OCR parsing

              └─► [profile: web]
                    └─► Firecrawl (:8030) — web crawler (scrape/crawl/map)

Services

ServiceContainerPortPurpose
postgresubios_postgres5432PostgreSQL 16 with pgvector. Single instance, 5 tenant schemas + Dify + Metabase databases.
redisubios_redis6379Cache store, session driver, queue backend, rate limiter.
minioubios-minio9000 / 9001S3-compatible document storage. Console on port 9001.
mailpitubios_mailpit1025 / 8025SMTP testing sink. Web UI on port 8025.
apiubios_api6081→8000Laravel 12 API. Serves REST endpoints for frontend and Agno callbacks.
queueubios_queueLaravel queue worker (php artisan queue:listen). Runs document extraction, scheduled agent tasks, and async jobs separately from the API.
appubios_app6080→5080Nuxt 3 frontend. Proxies /api/* to Laravel internally.
agnoubios_agno8001FastAPI agent runtime. Runs all 8 agent types via litellm library (in-process).
litellmubios_litellm4000Unified LLM gateway proxy. Exposes OpenAI-compatible API for Dify and other services. Routes to all providers.
dify-apiubios_dify_api5001Dify knowledge pipeline API. Routes LLM calls through litellm proxy.
dify-workerubios_dify_workerDify Celery worker. Processes document ingestion jobs.
dify-webubios_dify_web3080→3000Dify admin UI for managing knowledge bases.
metabaseubios_metabase3000Embedded BI dashboards. Uses its own PostgreSQL database.
uptime-kumaubios_uptime_kuma3001Self-hosted service monitoring. Health checks for all containers, status pages, alerting.
dozzleubios_dozzle8080Real-time log viewer for all Docker containers. Zero config.

Profile-Gated Services

These services only start when their profile is explicitly enabled:

ServiceContainerPortProfilePurpose
doclingubios_docling8010documentsPDF/document parsing into Markdown. Handles PDFs with text layers.
paddleocrubios_paddleocr8015documentsTable-aware OCR parsing. Excels at structured tables. Apache 2.0, ~2GB image.
firecrawlubios_firecrawl8030webSelf-hosted web crawler. Scrape, crawl, and map URLs into Markdown. AGPL-3.0.
# Start document parsing services
docker compose --profile documents up -d

# Start web crawler
docker compose --profile web up -d

Why Each Service Exists

LiteLLM Proxy — Unified LLM gateway. Dify and other services send OpenAI-format requests to one endpoint, litellm routes to the correct provider. One set of API keys for the entire stack.

Dify — Manages the document ingestion pipeline: upload → chunk → embed → store in pgvector. Routes LLM calls through litellm proxy.

Metabase — Provides embedded BI dashboards accessed via signed iFrame with a postMessage bridge. Derives its metric definitions from the semantic model.

Uptime Kuma — Monitors health of all services via HTTP, TCP, and Docker checks. Provides status pages and 90+ notification channels.

Dozzle — Zero-config log viewer. Mounts Docker socket, shows real-time logs for every container in the stack.

Mailpit — Replaces Amazon SES in development. Captures all outgoing email (password resets, alert notifications) for inspection.

Queue worker — Separates long-running jobs (document extraction, scheduled agent runs) from the HTTP request cycle. Uses Redis as the queue backend.

Dependencies

postgres (healthy) → api, agno, dify-api, metabase
api queue, app
minio (healthy) → dify-api, dify-worker
litellm dify-api, dify-worker
dify-api dify-worker, dify-web

PostgreSQL must be healthy before any application service starts. MinIO must be healthy before Dify starts. Dify depends on litellm proxy for LLM access.

LLM Access Patterns

ServiceHow it accesses LLMsWhy
Agnolitellm Python library (in-process)Hot path — many calls per session, lowest latency
Difylitellm proxy via HTTP (:4000)Occasional calls during ingestion, unified config
Other serviceslitellm proxy via HTTPAny future service gets OpenAI-compatible access