Just cloned the repo? Run this:
make devThis single command will:
- Generate all
.envfiles with sensible defaults - Install all dependencies (broker, console, SDK, MVP)
- Start PostgreSQL database
- Apply Prisma database schema
- Show you what to do next
Then start the services in separate terminals:
# Terminal 1
make broker-dev
# Terminal 2
make console-devNexus is the next-generation gateway. To set it up:
# Generate environment files
make env-nexus # Creates nexus/server/.env
make env-nexus-console # Creates nexus/console/.env.local
# Or generate all at once
make env-setup
# Start database and apply schema
make nexus-db-up
make nexus-db-setup
# Start services
make nexus-dev # Terminal 1: Nexus server
# Open nexus/console and run: npm run dev # Terminal 2: Nexus consoleThe Nexus console will be available at http://localhost:4001
Want to see everything in action? One command:
make mvpThis automatically:
- Sets up environment and dependencies
- Starts database
- Launches broker service
- Starts pricing and inventory agents
- Runs the price-check scenario
- Shows you the demo in action!
If you see:
❌ ERROR: Port 5433 is already in use!
Option 1: Stop the conflicting process
lsof -ti :5433 | xargs kill
make broker-db-upOption 2: Change the port
Edit the Makefile (line 28):
DB_PORT := 5434 # Change from 5433Option 3: Clean up old Docker containers
make broker-db-down
make broker-db-upThe Makefile auto-generates .env files, but if you need to regenerate them:
make env-setup # Generates all .env files
make env-broker # Just broker .env
make env-console # Just broker console .env.local
make env-mvp # Just mvp .env
make env-nexus # Just nexus server .env
make env-nexus-console # Just nexus console .env.localAll configuration is in the Makefile (lines 22-52), so you can customize:
- Database ports
- API keys
- Service ports
- Environment settings
Reset the database and reapply schema:
# Broker database
make broker-db-reset
# Nexus database
make nexus-db-reset
# Nuclear option: Destroy ALL databases
make db-nuke-allThis will:
- Destroy all data (be careful!)
- Recreate the database
- Apply Prisma schema
- Generate Prisma client
All non-sensitive configuration is stored in the Makefile:
| Variable | Default | What it's for |
|---|---|---|
| DB_PORT | 5433 | Broker PostgreSQL port |
| ADMIN_PORT | 3001 | Broker admin API |
| INTERNAL_PORT | 8080 | Internal broker (realms) |
| EXTERNAL_PORT | 8443 | External broker (partners) |
| CONSOLE_PORT | 3000 | Broker web console UI |
| ADMIN_API_KEY | admin-key-123 | Dev API key |
| Variable | Default | What it's for |
|---|---|---|
| NEXUS_DB_PORT | 5434 | Nexus PostgreSQL port |
| NEXUS_PORT | 4000 | Nexus server port |
| NEXUS_CONSOLE_PORT | 4001 | Nexus console UI |
| NEXUS_CONSOLE_API_KEY | nexus-console-key-... | Dev API key |
| NEXUS_JWT_SECRET | nexus-jwt-secret-... | JWT signing secret (dev only) |
Change these in the Makefile and run make env-setup to regenerate config files.
# Help & Setup
make help # Show all commands with descriptions
make env-setup # Generate all .env files from Makefile config
# Broker Commands
make broker-dev # Start broker with hot reload
make console-dev # Start broker web console
make broker-db-up # Start broker database
make broker-db-down # Stop broker database
make broker-db-reset # Reset broker database (destroys data!)
make broker-db-shell # Open PostgreSQL shell
# Nexus Commands
make nexus-dev # Start nexus server with hot reload
make nexus-db-up # Start nexus database
make nexus-db-down # Stop nexus database
make nexus-db-reset # Reset nexus database (destroys data!)
make nexus-db-setup # Apply Prisma schema to nexus database
make nexus-db-shell # Open nexus PostgreSQL shell
# Development Workflows
make dev # Setup dev environment (one command)
make mvp # Run full MVP demo (one command)
make kill-all # Kill all running processes
make db-nuke-all # Nuclear option: destroy ALL databasesrealm-mesh/
├── broker/
│ ├── service/ # Core broker service (WebSocket gateway)
│ └── console/ # Broker web UI (Next.js)
├── nexus/
│ ├── server/ # Next-gen Nexus gateway (Express + Prisma)
│ ├── console/ # Nexus web UI (Next.js)
│ └── shared/ # Shared types & DTOs (TypeScript)
├── mvp/ # MVP demo scenarios
│ ├── agents/ # Sample agents (pricing, inventory)
│ └── scenarios/ # Demo scripts
├── sdk/node/ # Node.js SDK for building realms
└── Makefile # One-command workflows
- Start the broker and console (see above)
- Open http://localhost:3000 to see the console
- Run
make mvpto see agents in action - Check the MVP scenarios in
mvp/scenarios/to learn the patterns - Build your own realms using the SDK in
sdk/node/
Happy hacking! 🚀