Just cloned the repo? Run this:
make dev
This single command will:
- Generate all
.env
files 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-dev
Want to see everything in action? One command:
make mvp
This 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-up
Option 2: Change the port
Edit the Makefile
(line 28):
DB_PORT := 5434 # Change from 5433
Option 3: Clean up old Docker containers
make broker-db-down
make broker-db-up
The 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 console .env.local
make env-mvp # Just mvp .env
All 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:
make broker-db-reset
This 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 | PostgreSQL port |
ADMIN_PORT | 3001 | Broker admin API |
INTERNAL_PORT | 8080 | Internal broker (realms) |
EXTERNAL_PORT | 8443 | External broker (partners) |
CONSOLE_PORT | 3000 | Web console UI |
ADMIN_API_KEY | admin-key-123 | Dev API key |
Change these in the Makefile and run make env-setup
to regenerate config files.
make help # Show all commands
make dev # Setup dev environment (one command)
make mvp # Run full MVP demo (one command)
make broker-dev # Start broker with hot reload
make console-dev # Start web console
make broker-db-up # Start database
make broker-db-down # Stop database
make broker-db-reset # Reset database (destroys data!)
make broker-db-shell # Open PostgreSQL shell
make kill-all # Kill all running processes
realm-mesh/
├── broker/
│ ├── service/ # Core broker service (WebSocket gateway)
│ └── console/ # Web UI (Next.js)
├── 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 mvp
to 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! 🚀