Realm 🏰
What is Realm?
Realm eliminates the complexity of modern full-stack development by providing:
- Virtualenv-like environments for complete project isolation
- Built-in process manager (like Foreman) with intelligent routing
- Multi-runtime support (Bun, Node.js, Python) with automatic version management
- Zero-config proxy server that routes requests to your services
- Project templates to eliminate boilerplate
- One-command deployment with Docker generation
Installation
From crates.io (Recommended)
# Install using cargo
From Source
# Clone and build from source
Pre-built Binaries
Download the latest release for your platform:
- macOS (Intel): realm-macos-amd64
- macOS (Apple Silicon): realm-macos-arm64
- Linux (x64): realm-linux-amd64
- Linux (ARM64): realm-linux-arm64
- Windows: realm-windows-amd64.exe
Quick Install Script (macOS/Linux)
|
This will download and install realm to /usr/local/bin.
Quick Start
JavaScript Stack (Bun/Node)
# Create a new full-stack project
# Activate the environment
# Start everything (processes + proxy)
# Visit http://localhost:8000 - it just works!
Python Stack (FastAPI)
# Create a FastAPI + React project
# Activate the environment
# Install Python dependencies
# Start everything (processes + proxy)
# Visit http://localhost:8000 - it just works!
Core Workflow
1. Initialize Environment
# Create with specific runtime and template
# Or just create empty environment
2. Activate Environment
# Your shell now shows: (realm) $
3. Start Development
# Start all processes + proxy server
# Or start components separately
4. Deploy
# Generate Docker deployment artifacts
&&
Configuration
Realm uses realm.yml for project configuration:
proxy_port: 8000
env:
NODE_ENV: development
API_URL: http://localhost:4001
env_file: .env
processes:
frontend:
command: "bun run dev"
port: 4000
routes:
working_directory: "frontend"
backend:
command: "bun run server"
port: 4001
routes:
working_directory: "backend"
Templates
Realm includes built-in templates for common stacks:
Available Templates
react-express- React frontend + Express backend (Bun/Node)react-fastapi- React frontend + FastAPI backend (Python)svelte-fastify- SvelteKit + Fastify backend (Bun/Node)vue-express- Vue 3 + Express backend (Bun/Node)nextjs- Next.js 14 full-stack app (Bun/Node)
Using Templates
# List available templates
# Create project from template
# Create your own template
Runtime Management
Realm automatically manages runtime versions per project:
# Use latest Bun (default)
# Use specific Node.js version
# Use specific Bun version
# Use Python with per-project isolation
Python Support:
- Downloads and manages Python from python-build-standalone
- Creates per-project
site-packagesfor complete isolation - Automatically sets
VIRTUAL_ENVfor compatibility with pip, poetry, etc. - Symlinks Python binary from shared installation
- Works seamlessly with existing Python tooling
Runtimes are isolated per realm environment - no global pollution!
Proxy Server
The built-in proxy intelligently routes requests:
- Route matching:
/api/*→ backend:4001,/→ frontend:4000 - WebSocket support: For Vite HMR, live reload, etc.
- CORS handling: Automatic CORS headers for development
- Health checks: Built-in
/healthendpoint - Fallback routing: Sensible defaults when routes don't match
Process Management
Realm's process manager handles service lifecycle:
- Foreman-like: Define processes in
realm.yml - Intelligent startup: Processes start in dependency order
- Log aggregation: Combined output with process prefixes
- Graceful shutdown: Proper process cleanup
- Auto-restart: Restart failed processes (optional)
Deployment
Generate production-ready artifacts:
Creates dist/ with:
- Dockerfile - Multi-stage build for all processes
- docker-compose.yml - Complete service orchestration
- nginx.conf - Reverse proxy with your routing
- deploy.sh - One-command deployment script
Architecture
┌─────────────────────────────────────────────┐
│ Realm CLI │
├─────────────────────────────────────────────┤
│ Proxy Server (port 8000) │
│ ├── Route: /api/* → backend:4001 │
│ ├── Route: / → frontend:4000 │
│ └── Route: /health → built-in │
├─────────────────────────────────────────────┤
│ Process Manager │
│ ├── frontend: bun run dev │
│ ├── backend: bun run server │
│ └── docs: bun run docs │
├─────────────────────────────────────────────┤
│ Runtime Manager │
│ ├── Bun 1.0.0 (per project) │
│ └── Node.js 20.5.0 (per project) │
├─────────────────────────────────────────────┤
│ Environment Manager │
│ ├── .env file loading │
│ └── Variable isolation │
└─────────────────────────────────────────────┘
Commands Reference
Environment Management
realm init [path]- Create new realm environmentsource .venv/bin/activate- Activate environmentdeactivate- Exit realm environment
Process Management
realm start- Start all processes + proxyrealm stop- Stop all processes + proxyrealm proxy- Start proxy server only
Templates
realm templates list- List available templatesrealm create --template=name- Create template from current project
Deployment
realm bundle- Generate deployment artifacts
Options
--runtime=bun|node- Specify runtime (default: bun)--runtime=node@20- Specify runtime version--template=name- Use project template
Why Realm?
Before Realm:
# Terminal 1: Start frontend
&&
# Terminal 2: Start backend
&&
# Terminal 3: Start proxy
# Terminal 4: Set up environment
# Remember all the ports, manage processes, configure nginx...
With Realm:
# Done. Everything runs on http://localhost:8000
The Difference:
- One command instead of managing multiple terminals
- Automatic routing instead of nginx configuration
- Environment isolation instead of global pollution
- Template scaffolding instead of boilerplate setup
- Deployment generation instead of Docker wrestling
Installation
From Source
Prerequisites
- Rust 1.70+
- Git (for template management)
Contributing
Realm is built in Rust with a modular architecture:
src/cli/- Command-line interfacesrc/config/- Configuration parsing (realm.yml)src/runtime/- Runtime version managementsrc/process/- Process lifecycle managementsrc/proxy/- HTTP proxy server with routingsrc/templates/- Project scaffoldingsrc/bundle/- Deployment artifact generationtests/- Comprehensive test suite
Running Tests
Development
# Build in development mode
# Run with debug output
RUST_LOG=debug
License
MIT License - see LICENSE file.
Comparison
| Feature | Realm | Docker Compose | Foreman | Create-React-App |
|---|---|---|---|---|
| Process Management | ✅ | ✅ | ✅ | ❌ |
| Built-in Proxy | ✅ | ❌ | ❌ | ❌ |
| Runtime Isolation | ✅ | ✅ | ❌ | ❌ |
| Project Templates | ✅ | ❌ | ❌ | ✅ |
| Production Deploy | ✅ | ✅ | ❌ | ✅ |
| Zero Config | ✅ | ❌ | ❌ | ✅ |
| Multi-Runtime | ✅ | ✅ | ❌ | ❌ |
| Environment Isolation | ✅ | ✅ | ❌ | ❌ |
Realm combines the best aspects of these tools into a single, cohesive development environment.