Architecture
Overview
Companion Hub is built as a modern, modular self-hosting platform with several interconnected components.
Core Components
Hub (Local Server)
The Hub is the main application running on your server:
- Backend: NestJSΒ 11 with TypeScriptΒ
- Database: PostgreSQLΒ 14 with Drizzle ORMΒ
- Frontend: ReactΒ 19 dashboard
- Desktop app: Tauri 2Β native wrapper for macOS, Windows, and Linux
- Message Queue: RabbitMQΒ 4 for async task processing
- Reverse Proxy: TraefikΒ v3 for routing and SSL
CI Account (hub.ci.computer)
The cloud companion at hub.ci.computerΒ that provides:
- Remote Hub management
- Device pairing
- Managed Cloudflare Gateway provisioning
- Remote App Store access
Cloudflare Gateway
A managed Cloudflare TunnelΒ that securely exposes your apps without port forwarding. Provisioned and managed through your CI Account.
Docker Layer
All apps run as Docker Compose projects. Each app is isolated in its own compose stack but shares a common Docker network for inter-app communication.
Docker Services
The Hub runs several containers defined in the production compose file:
| Service | Image | Purpose |
|---|---|---|
ci-os-hub | Hub backend + frontend | Main application (API on port 5002) |
ci-hub-db | PostgreSQL 14 | Database (port 6543) |
ci-os-hub-queue | RabbitMQ 4 | Message broker |
ci-hub-traefik | Traefik v3 | Reverse proxy, SSL, routing |
hub-tailscale | Tailscale | Private VPN sidecar (enabled by default; optional to disable) |
cloudflared | Cloudflare tunnel agent | Managed gateway (optional) |
Technologies
- DockerΒ β Containerisation
- TraefikΒ β Reverse proxy and load balancer
- TypeScriptΒ β End-to-end type safety
- NestJSΒ β Backend framework
- ReactΒ β Dashboard frontend
- Tauri 2Β β Cross-platform desktop app
- Drizzle ORMΒ β Type-safe database access
- PostgreSQLΒ β Database
- RabbitMQΒ β Message broker
- TailscaleΒ β Optional private networking
Last updated on