DEV Community

Cover image for Realm: The Dev Environment That Eliminates Terminal Chaos
Wess Cope
Wess Cope

Posted on

Realm: The Dev Environment That Eliminates Terminal Chaos

I have been using this little tool for a bit because I don't always get to have docker in some of the specialized environments or platforms I build for. I decided to polish it up and release it.

The Problem: Development Environment Chaos

Modern full-stack development is surprisingly complex:

  • Multiple terminals: Frontend on port 3000, API on 4000, docs on 8080
  • Runtime management: Node 18 for one project, Node 20 for another
  • Proxy configuration: Manually configuring nginx or setting up CORS
  • Environment isolation: Global package pollution and version conflicts
  • Process orchestration: Remembering which services to start in which order

This complexity multiplies when you're working on multiple projects. Context switching becomes painful, and onboarding new developers means sharing a 50-step setup guide.

What is Realm?

Realm is a single CLI tool that replaces your entire development environment setup. It combines:

  • Virtualenv-like environments for complete project isolation
  • Built-in process manager (like Foreman) with intelligent routing
  • Multi-runtime support (Bun, Node.js, Python, Deno, Go)
  • Zero-config proxy server that routes requests to your services
  • Project templates to eliminate boilerplate
  • One-command deployment with Docker generation

All written in Rust for speed and reliability.

Installation

Getting started is simple:

# Using cargo
cargo install realmenv

# Or using the install script
curl -sSfL https://github.com/wess/realm/releases/latest/download/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

Pre-built binaries are available for macOS (Intel & Apple Silicon), Linux (x64 & ARM64), and Windows.

Quick Start: From Zero to Running in 30 Seconds

The interactive init experience makes setup effortless:

# Initialize with prompts
realm init

# Follow the prompts:
# → Project name: myapp
# → Select runtime: Bun (latest)
# → Use a template?: React + Express
# → Done!

cd myapp
source .venv/bin/activate
realm start

# Visit http://localhost:8000 - it just works!
Enter fullscreen mode Exit fullscreen mode

That's it. No webpack config, no proxy setup, no port juggling. Everything runs on http://localhost:8000 with intelligent routing.

The Magic: How Realm Works

Realm acts as a single command center for your entire development environment:

┌─────────────────────────────────────────────┐
│ 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.1 (per project)                 │
│ └── Node.js 20.5.0 (per project)            │
├─────────────────────────────────────────────┤
│ Environment Manager                         │
│ ├── .env file loading                       │
│ └── Variable isolation                      │
└─────────────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

1. Smart Proxy Routing

Instead of manually configuring nginx or dealing with CORS issues, Realm's built-in proxy handles everything:

# realm.yml
proxy_port: 8000

processes:
  frontend:
    command: "bun run dev"
    port: 4000
    routes: ["/", "/assets/*"]

  backend:
    command: "bun run server"
    port: 4001
    routes: ["/api/*", "/health"]
Enter fullscreen mode Exit fullscreen mode

The proxy automatically:

  • Routes requests based on URL patterns
  • Handles WebSocket connections (for HMR, live reload)
  • Adds CORS headers for development
  • Provides health checks

2. Process Management

Like Foreman or Overmind, but integrated with routing:

realm start  # Start everything
realm stop   # Stop everything
Enter fullscreen mode Exit fullscreen mode

All process output is aggregated with colored prefixes, so you can see what's happening across your entire stack.

3. Runtime Isolation

Similar to virtualenv for Python or nvm for Node, but project-scoped:

# Use latest Bun
realm init myapp --runtime=bun

# Use specific Node.js version
realm init myapp --runtime=node@20

# Use Python with complete isolation
realm init myapp --runtime=python@3.12
Enter fullscreen mode Exit fullscreen mode

Runtimes are downloaded and cached per-project. No more global version conflicts!

Built-in Templates

Realm includes templates for common full-stack patterns:

  • react-express: React + Express (Bun/Node)
  • react-fastapi: React + FastAPI (Python)
  • svelte-fastify: SvelteKit + Fastify
  • vue-express: Vue 3 + Express
  • nextjs: Next.js 14 full-stack app
# Create from template
realm init myapp --template=react-fastapi --runtime=python@3.12

cd myapp
source .venv/bin/activate
pip install -r backend/requirements.txt
realm start
Enter fullscreen mode Exit fullscreen mode

You can also create your own templates with custom variables:

# template.yaml
name: my-stack
description: My custom template

variables:
  - name: project_name
    prompt: "Project name"
    default: "{{directory_name}}"

  - name: api_port
    prompt: "API port"
    default: "3001"
Enter fullscreen mode Exit fullscreen mode

Production: One Command to Deploy

When you're ready to deploy, Realm generates production-ready Docker artifacts:

realm bundle
Enter fullscreen mode Exit fullscreen mode

This creates a dist/ folder with:

  • Dockerfile: Multi-stage build for all processes
  • docker-compose.yml: Complete service orchestration
  • nginx.conf: Reverse proxy with your routing rules
  • deploy.sh: One-command deployment script

No more wrestling with Docker or deployment configurations.

Real-World Comparison

The Old Way 🔥

# Terminal 1
cd frontend && npm run dev

# Terminal 2
cd backend && npm run server

# Terminal 3
nginx -c nginx.conf

# Terminal 4
export NODE_ENV=development
export API_URL=http://localhost:4001
source .env

# Remember all ports, manage processes manually...
Enter fullscreen mode Exit fullscreen mode

The Realm Way ✨

realm init myapp --template=react-express
source .venv/bin/activate
realm start

# Everything runs on http://localhost:8000
Enter fullscreen mode Exit fullscreen mode

When Should You Use Realm?

Realm shines when you're:

  • Building full-stack applications with separate frontend/backend
  • Working on multiple projects that need different runtime versions
  • Onboarding developers and want a simple setup experience
  • Tired of managing terminals and proxy configurations
  • Want fast deployment without Docker expertise

Community Runtimes

Beyond the built-in support for Bun, Node, and Python, Realm supports custom runtimes through YAML configuration:

# Add Deno support
curl -o ~/.realm/runtimes-config/deno.yaml \
  https://raw.githubusercontent.com/wess/realm/main/runtimes/deno.yaml

realm init --runtime=deno

# Add Go support
curl -o ~/.realm/runtimes-config/go.yaml \
  https://raw.githubusercontent.com/wess/realm/main/runtimes/go.yaml

realm init --runtime=go
Enter fullscreen mode Exit fullscreen mode

Check out the community runtimes for more options.

Under the Hood

Realm is built in Rust with a modular architecture:

  • CLI layer: Command-line interface with clap
  • Config parsing: YAML configuration with serde
  • Runtime management: Version downloads and caching
  • Process management: Lifecycle orchestration
  • Proxy server: HTTP routing with tokio
  • Template engine: Tera-based scaffolding
  • Bundle generator: Docker artifact creation

The entire tool is focused on developer experience: fast startup, clear error messages, and zero configuration when possible.

Feature Comparison

Feature Realm Docker Compose Foreman Create-React-App
Process Management
Built-in Proxy
Runtime Isolation
Project Templates
Production Deploy
Zero Config
Multi-Runtime

Realm combines the best aspects of these tools into a cohesive development environment.

Getting Started

Ready to simplify your development workflow?

  1. Install Realm: cargo install realmenv
  2. Initialize a project: realm init
  3. Start developing: realm start

Check out the GitHub repository for documentation, examples, and to contribute.

Conclusion

Modern full-stack development doesn't have to be complex. With Realm, you get:

  • One command to start your entire stack
  • Automatic routing without proxy configuration
  • Runtime isolation without global pollution
  • Templates to eliminate boilerplate
  • Deployment generation without Docker expertise

If you've ever felt frustrated managing multiple terminals, runtime versions, or proxy configurations, give Realm a try. It might just change how you approach development environments.


Have you tried Realm? What's your biggest pain point in full-stack development? Let me know in the comments!

Links:

Top comments (0)