The Stack
How 16 products share one infrastructure
Brainz Lab isn't one product. It's sixteen.
Recall, Reflex, Pulse, Signal, Vault, Flux, Synapse, Dendrite, Vision, Platform, Beacon, Cortex, Nerve, Sentinel—and more coming.
How do you run sixteen products without sixteen ops teams?
You share everything possible.
The architecture
Every Brainz Lab product is a Rails 8 application. Same framework. Same patterns. Same deployment model.
They share:
PostgreSQL — One database cluster. Each product has its own schema. Shared connection pooling.
Redis — One Redis instance. Namespaced by product. Caching, sessions, pub/sub.
TimescaleDB — Time-series extension for PostgreSQL. Logs, metrics, traces—all time-series data.
Traefik — Reverse proxy. Routes by subdomain. SSL termination. Load balancing.
The docker-compose
services:
traefik:
image: traefik:v3
ports:
- "80:80"
- "443:443"
postgres:
image: timescale/timescaledb:latest-pg16
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
recall:
build: ./recall
labels:
- "traefik.http.routers.recall.rule=Host(`recall.localhost`)"
reflex:
build: ./reflex
labels:
- "traefik.http.routers.reflex.rule=Host(`reflex.localhost`)"
# ... 14 more products
One command: docker-compose up
Sixteen products running. All interconnected.
Subdomain routing
Each product gets a subdomain:
recall.brainzlab.ai— Logsreflex.brainzlab.ai— Errorspulse.brainzlab.ai— Tracessignal.brainzlab.ai— Alertsplatform.brainzlab.ai— Auth and billing
Traefik handles the routing. Products don't care about networking.
In development: recall.localhost, reflex.localhost, etc.
Same URLs, different environments.
Shared libraries
Products share code through gems:
brainzlab-ui — Component library. Buttons, cards, modals. Consistent design.
brainzlab-sdk — Client library. Products call each other through this.
hive-core — AI executor framework. Background AI work.
Build a feature once. Use it everywhere.
The dependency graph
Products depend on each other:
Layer 1: Infrastructure
├── PostgreSQL
├── Redis
└── Traefik
Layer 2: Platform
└── Platform (auth, billing)
Layer 3: Core Observability
├── Recall (logs)
├── Reflex (errors)
├── Pulse (traces)
└── Signal (alerts)
Layer 4: Extended
├── Flux (metrics)
├── Vault (secrets)
├── Dendrite (docs)
├── Vision (visual testing)
└── Synapse (AI command center)
Layer 5: Coming Soon
├── Beacon (uptime)
├── Cortex (feature flags)
├── Nerve (job monitoring)
└── Sentinel (host monitoring)
Lower layers don't depend on higher layers. Clear boundaries.
Database strategy
Shared PostgreSQL, separate schemas:
-- Each product has its own schema
CREATE SCHEMA recall;
CREATE SCHEMA reflex;
CREATE SCHEMA pulse;
-- Tables are namespaced
recall.log_entries
reflex.errors
pulse.traces
Products can join across schemas when needed. Platform validates access.
The ops story
Sixteen products. One deployment:
# Update everything
docker-compose pull
docker-compose up -d
# Scale a specific product
docker-compose up -d --scale recall=3
# View logs
docker-compose logs -f reflex
Same ops patterns for everything. No special cases.
Why this works
Sharing infrastructure means:
- Faster development — New products inherit everything
- Consistent experience — Same patterns everywhere
- Simpler ops — One way to deploy, monitor, debug
- Lower costs — Shared resources, not duplicated
The tradeoff is coupling. Products can't diverge wildly. For Brainz Lab, that's a feature—consistency matters.
Self-hosting friendly
The whole stack runs in Docker Compose. That means:
- Local development — Run everything on your laptop
- Self-hosted production — Deploy to your own servers
- Cloud agnostic — Works on any Docker host
No vendor lock-in. Your infrastructure, your control.
Try it
git clone https://github.com/brainz-lab/stack
cd stack
docker-compose up -d
Open your browser. Sixteen products, running locally.
This is what infrastructure leverage looks like.
— Andres