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
| Service | Container | Port | Purpose |
|---|---|---|---|
postgres | ubios_postgres | 5432 | PostgreSQL 16 with pgvector. Single instance, 5 tenant schemas + Dify + Metabase databases. |
redis | ubios_redis | 6379 | Cache store, session driver, queue backend, rate limiter. |
minio | ubios-minio | 9000 / 9001 | S3-compatible document storage. Console on port 9001. |
mailpit | ubios_mailpit | 1025 / 8025 | SMTP testing sink. Web UI on port 8025. |
api | ubios_api | 6081→8000 | Laravel 12 API. Serves REST endpoints for frontend and Agno callbacks. |
queue | ubios_queue | — | Laravel queue worker (php artisan queue:listen). Runs document extraction, scheduled agent tasks, and async jobs separately from the API. |
app | ubios_app | 6080→5080 | Nuxt 3 frontend. Proxies /api/* to Laravel internally. |
agno | ubios_agno | 8001 | FastAPI agent runtime. Runs all 8 agent types via litellm library (in-process). |
litellm | ubios_litellm | 4000 | Unified LLM gateway proxy. Exposes OpenAI-compatible API for Dify and other services. Routes to all providers. |
dify-api | ubios_dify_api | 5001 | Dify knowledge pipeline API. Routes LLM calls through litellm proxy. |
dify-worker | ubios_dify_worker | — | Dify Celery worker. Processes document ingestion jobs. |
dify-web | ubios_dify_web | 3080→3000 | Dify admin UI for managing knowledge bases. |
metabase | ubios_metabase | 3000 | Embedded BI dashboards. Uses its own PostgreSQL database. |
uptime-kuma | ubios_uptime_kuma | 3001 | Self-hosted service monitoring. Health checks for all containers, status pages, alerting. |
dozzle | ubios_dozzle | 8080 | Real-time log viewer for all Docker containers. Zero config. |
Profile-Gated Services
These services only start when their profile is explicitly enabled:
| Service | Container | Port | Profile | Purpose |
|---|---|---|---|---|
docling | ubios_docling | 8010 | documents | PDF/document parsing into Markdown. Handles PDFs with text layers. |
paddleocr | ubios_paddleocr | 8015 | documents | Table-aware OCR parsing. Excels at structured tables. Apache 2.0, ~2GB image. |
firecrawl | ubios_firecrawl | 8030 | web | Self-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 -dWhy 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-webPostgreSQL 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
| Service | How it accesses LLMs | Why |
|---|---|---|
| Agno | litellm Python library (in-process) | Hot path — many calls per session, lowest latency |
| Dify | litellm proxy via HTTP (:4000) | Occasional calls during ingestion, unified config |
| Other services | litellm proxy via HTTP | Any future service gets OpenAI-compatible access |