Getting Started
Installation
Complete installation guide with prerequisites, environment setup, and verification.
This guide walks through every step needed to get the Realtime Platform running from scratch.
Prerequisites
| Dependency | Version | Purpose |
|---|---|---|
| Node.js | >= 20.0.0 | Runtime for all services |
| pnpm | >= 9.0.0 | Monorepo package manager |
| PostgreSQL | >= 14 | Platform metadata + CDC source |
| Redis | >= 7.0 (with RedisJSON) | Document state, pub/sub, queues |
Install Node.js
We recommend using nvm to manage Node.js versions:
nvm install 20
nvm use 20
node --version # v20.x.xInstall pnpm
npm install -g pnpm@9
pnpm --version # 9.x.xPostgreSQL
The included docker-compose.yml starts PostgreSQL automatically:
docker-compose up -d postgresRedis with RedisJSON
The platform requires Redis with the RedisJSON module for sync document storage.
docker-compose up -d redisThe Docker Compose file uses redis/redis-stack-server which includes RedisJSON.
Clone the Repository
git clone <repo-url> realtime
cd realtimeInstall Dependencies
pnpm installThis installs dependencies for all packages and apps in the monorepo. pnpm's workspace protocol ensures shared dependencies are hoisted efficiently.
Environment Configuration
Copy the example environment file:
cp .env.example .envRequired Variables
# PostgreSQL (platform metadata database)
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=realtime
POSTGRES_PASSWORD=realtime_secret
POSTGRES_DB=realtime
# Redis
REDIS_URL=redis://localhost:6379Optional Variables
# Server
NODE_ENV=development
PORT=3000
LOG_LEVEL=debug
# JWT Authentication
JWT_SECRET=your-jwt-secret-here
# CDC (Change Data Capture) - your application database
CDC_DATABASE_URL=postgresql://user:password@host:5432/your_app_db
CDC_POLL_INTERVAL_MS=1000
CDC_SLOT_NAME=realtime_cdc_slot
# Admin UI
VITE_API_URL=http://localhost:3000Info
See the full Configuration reference for all variables and their defaults.
Build
Build all packages in dependency order:
pnpm buildTurborepo handles the build graph automatically — shared packages build first, then apps.
Verify Installation
Run Tests
pnpm testAll 221+ tests should pass across 12 packages.
Start the Platform
pnpm devVerify each service is running:
| Service | Check | Expected |
|---|---|---|
| Backend | curl http://localhost:3000/health | {"status":"ok"} |
| Admin UI | Open http://localhost:5173 | Login/setup page |
| Workers | Check terminal output | Workers started log |
Docker Compose (Full Stack)
The included docker-compose.yml provides PostgreSQL and Redis for local development:
services:
postgres:
image: postgres:14-alpine
environment:
POSTGRES_USER: realtime
POSTGRES_PASSWORD: realtime_secret
POSTGRES_DB: realtime
ports:
- "5432:5432"
redis:
image: redis/redis-stack-server:latest
ports:
- "6379:6379"Start both services:
docker-compose up -dMonorepo Structure
After installation, the workspace contains:
realtime/
├── apps/
│ ├── backend/ # Express API + Socket.IO server
│ ├── workers/ # Background workers (CDC, webhooks, etc.)
│ ├── admin-ui/ # React management dashboard
│ └── docs/ # This documentation site
├── packages/
│ ├── shared-types/ # TypeScript interfaces
│ ├── shared-utils/ # Common utilities
│ ├── shared-config/ # Environment config (Zod)
│ ├── observability/ # Logging + metrics
│ ├── redis-layer/ # Redis client + pub/sub
│ ├── auth/ # JWT + permissions
│ ├── event-router/ # Event normalization + routing
│ ├── topic-registry/ # Topic CRUD + validation
│ ├── schema-registry/ # Schema versioning + compatibility
│ ├── metrics/ # Prometheus metrics
│ ├── database/ # Knex migrations + connection
│ └── sdk/ # Client SDK
├── docker-compose.yml
├── turbo.json
└── pnpm-workspace.yaml