Skip to content

Windows Development Setup Guide

This guide walks you through setting up the rframe development environment on Windows using WSL (Windows Subsystem for Linux).

Table of Contents

  1. Install WSL
  2. Install Docker Desktop
  3. Set Up Your WSL Environment
  4. Install mise (Tool Version Manager)
  5. Install Rust
  6. Clone and Configure the Project
  7. Start the Database
  8. Run Database Migrations
  9. Build and Run the Application
  10. Troubleshooting

1. Install WSL

WSL (Windows Subsystem for Linux) lets you run a Linux environment directly on Windows. We'll use Ubuntu.

Step 1.1: Open PowerShell as Administrator

  1. Press Win + X
  2. Click "Terminal (Admin)" or "PowerShell (Admin)"

Step 1.2: Install WSL with Ubuntu

Run this command:

wsl --install -d Ubuntu

This will:

  • Enable WSL
  • Install the latest Ubuntu distribution
  • May require a restart

Step 1.3: Restart Your Computer

If prompted, restart your computer.

Step 1.4: Complete Ubuntu Setup

After restart, Ubuntu will open automatically (or search for "Ubuntu" in Start menu).

  1. Wait for the installation to complete
  2. Create a username (lowercase, no spaces) - e.g., mark
  3. Create a password (you'll need this for sudo commands)

Step 1.5: Update Ubuntu

In the Ubuntu terminal, run:

sudo apt update && sudo apt upgrade -y

2. Install Docker Desktop

Docker is required to run the PostgreSQL database.

Step 2.1: Download Docker Desktop

  1. Go to https://www.docker.com/products/docker-desktop/
  2. Download "Docker Desktop for Windows"
  3. Run the installer

Step 2.2: Configure Docker for WSL

  1. Open Docker Desktop
  2. Go to Settings (gear icon)
  3. Go to Resources → WSL Integration
  4. Enable integration with your Ubuntu distribution
  5. Click "Apply & Restart"

Step 2.3: Verify Docker Works in WSL

Open your Ubuntu terminal and run:

docker --version
docker compose version

Both commands should show version numbers. If docker command is not found, close and reopen the Ubuntu terminal.


3. Set Up Your WSL Environment

Step 3.1: Install Essential Build Tools

sudo apt install -y build-essential pkg-config libssl-dev git curl

Step 3.2: Set Up Git (if not already configured)

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Step 3.3: (Optional) Set Up SSH Keys for GitHub

ssh-keygen -t ed25519 -C "your.email@example.com"

Press Enter to accept defaults. Then add the key to your GitHub account:

cat ~/.ssh/id_ed25519.pub

Copy the output and add it at https://github.com/settings/keys.


4. Install mise (Tool Version Manager)

mise manages tool versions (Node.js, pnpm, spawn, etc.) for the project.

Step 4.1: Install mise

curl https://mise.run | sh

Step 4.2: Add mise to Your Shell

echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc
source ~/.bashrc

Step 4.3: Verify mise Installation

mise --version

5. Install Rust

Step 5.1: Install rustup

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

When prompted:

  1. Press 1 for default installation
  2. Press Enter

Step 5.2: Configure Your Shell

source "$HOME/.cargo/env"

Or close and reopen the terminal.

Step 5.3: Verify Rust Installation

rustc --version
cargo --version

Step 5.4: Install cargo-watch (for development)

cargo install cargo-watch

6. Clone and Configure the Project

Step 6.1: Create a Projects Directory

mkdir -p ~/projects
cd ~/projects

Step 6.2: Clone the Repository

Using HTTPS:

git clone https://github.com/saward/rframe.git

Or using SSH (if you set up SSH keys):

git clone git@github.com:saward/rframe.git

Step 6.3: Navigate to the Project

cd rframe

Step 6.4: Let mise Install Project Tools

mise will automatically read .mise.toml and install required tools:

mise trust
mise install

This installs:

  • Node.js 24
  • pnpm 10
  • spawn v0.2.0 (database migration tool)

Step 6.5: Verify Tools Are Installed

node --version    # Should show v24.x.x
pnpm --version    # Should show 10.x.x
spawn --version   # Should show v0.2.0

Step 6.6: Create Your Local Environment File (Optional)

The project includes sensible defaults in .mise.toml that work for local development. You only need a .env file if you want to override specific values.

# Copy the example file (optional - only if you need to override defaults)
cp .env.example .env

The defaults in .mise.toml include:

  • Database connection to the local Docker PostgreSQL
  • Test SMTP credentials (Mailtrap)
  • Test GitHub OAuth credentials
  • Development-friendly settings (caching disabled, debug enabled)

Step 6.7: Install Frontend Dependencies

cd frontend
pnpm install
cd ..

7. Start the Database

Step 7.1: Start PostgreSQL Container

mise run compose-up

This starts a PostgreSQL 18 container. You'll see database logs streaming - this is normal.

Step 7.2: Open a New Terminal Tab

Press Ctrl+Shift+T or open a new Ubuntu window to continue working while the database logs stream.

Step 7.3: Verify Database is Running

docker ps

You should see a container named rframe-db running.


8. Run Database Migrations

Step 8.1: Apply Migrations with Spawn

spawn migration apply

This creates all the database tables, functions, and initial data.

Step 8.2: (Optional) Connect to the Database

To explore the database directly:

mise run db:connect

This opens a PostgreSQL prompt. Type \dt to list tables, \q to quit.


9. Build and Run the Application

You'll need two terminal windows - one for the backend and one for the frontend.

Step 9.1: Start the Backend (Terminal 1)

mise run watch

This:

  • Compiles the Rust application
  • Starts the web server on http://localhost:3002
  • Automatically recompiles when you change Rust files

Step 9.2: Start the Frontend (Terminal 2)

Open a new terminal tab (Ctrl+Shift+T) and run:

cd ~/projects/rframe
mise run frontend

This:

  • Starts the Vite dev server with hot module replacement (HMR)
  • Automatically updates the browser when you change Svelte components
  • No need to refresh the page manually

Step 9.3: Open the Application

Visit http://localhost:3002 in your browser.


10. Troubleshooting

Docker commands not found

Make sure Docker Desktop is running and WSL integration is enabled (see Step 2.2).

Close and reopen your Ubuntu terminal after enabling WSL integration.

Permission denied errors with Docker

Add your user to the docker group:

sudo usermod -aG docker $USER

Then log out and back into WSL:

exit

Then reopen Ubuntu.

mise: command not found

Make sure you added mise to your shell profile:

echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc
source ~/.bashrc

spawn: command not found

Run mise install in the project directory to install all tools.

Database connection refused

  1. Make sure Docker Desktop is running
  2. Make sure the database container is running: docker ps
  3. If not running, start it: mise run compose-up

Rust compilation errors about OpenSSL

Install the OpenSSL development package:

sudo apt install -y libssl-dev pkg-config

Port already in use

If port 3002 or 5437 is already in use:

# Find what's using the port
sudo lsof -i :3002

# Kill the process (replace PID with actual process ID)
kill -9 PID

WSL is very slow

  1. Make sure your project files are in the Linux filesystem (~/projects/), not in /mnt/c/ (Windows filesystem)
  2. Add Windows Defender exclusions for WSL - search "Windows Security" → Virus & threat protection → Manage settings → Exclusions → Add exclusion → Folder → \\wsl$\Ubuntu

How do I access WSL files from Windows?

In Windows Explorer, navigate to:

\\wsl$\Ubuntu\home\YOUR_USERNAME\projects\rframe

Or type explorer.exe . in your WSL terminal to open the current directory in Windows Explorer.


Quick Reference

Task Command
Start database mise run compose-up
Stop database mise run compose-down
Apply migrations spawn migration apply
Connect to database mise run db:connect
Run dev server mise run watch
Run frontend dev mise run frontend
Build frontend cd frontend && pnpm build

Next Steps

  • Read CLAUDE.md for an overview of the project architecture
  • Explore the src/bin/example/ directory for the example application
  • Check out frontend/src/pages/ for Svelte page components