This guide covers using the dev.sh script to quickly set up a local development environment.
# Clone and start
git clone https://github.com/meawoppl/agent-portal.git
cd agent-portal
./scripts/dev.sh startThat's it! Open http://localhost:3000/ and you'll be logged in as testing@testing.local.
The script handles the complete setup automatically:
- Starts PostgreSQL via Docker Compose
- Waits for database to be ready
- Runs migrations using Diesel CLI (auto-installs if missing)
- Builds frontend using Trunk (auto-installs if missing)
- Starts backend in dev mode (OAuth bypassed)
| Command | Description |
|---|---|
./scripts/dev.sh start |
Start all services |
./scripts/dev.sh stop |
Stop all services |
./scripts/dev.sh restart |
Restart all services |
./scripts/dev.sh status |
Show status of all services |
./scripts/dev.sh logs |
Tail backend logs |
./scripts/dev.sh build |
Rebuild frontend only |
- Container:
claude-portal-test-db - Port: 5432
- Database:
claude_portal - User:
claude_portal - Password:
dev_password_change_in_production
Access the database directly:
./scripts/db-shell.sh- URL: http://localhost:3000
- Log file:
/tmp/agent-portal-backend.log - Mode: Dev mode (OAuth bypassed)
- Test user:
testing@testing.local
- Built to:
frontend/dist/ - Served by: Backend at http://localhost:3000
The script will automatically install these if missing:
| Tool | Purpose |
|---|---|
diesel_cli |
Database migrations |
trunk |
WASM build tool |
wasm32-unknown-unknown |
Rust WASM target |
For more control, you can run components separately:
docker-compose -f docker-compose.test.yml up -d dbexport DATABASE_URL="postgresql://claude_portal:dev_password_change_in_production@localhost:5432/claude_portal"
cargo run -p backend -- --dev-modecd frontend
trunk serve
# Opens at http://localhost:8080 with auto-reloadcargo run -p claude-portal -- --backend-url ws://localhost:3000For rapid iteration with auto-reload:
# Backend with auto-reload (requires cargo-watch)
cargo install cargo-watch
cargo watch -x 'run -p backend -- --dev-mode'
# Frontend with hot reload
cd frontend
trunk serve# Run migrations
cd backend && diesel migration run
# Create new migration
diesel migration generate add_new_feature
# Revert last migration
diesel migration revert
# Reset database (destroys all data)
./scripts/dev.sh stop
docker-compose -f docker-compose.test.yml down -v
./scripts/dev.sh start# Find what's using it
lsof -i :3000
# Kill the process or use a different port
cargo run -p backend -- --dev-mode --port 3001# Check if PostgreSQL is running
docker ps | grep claude-portal-test-db
# Restart the database
./scripts/dev.sh stop
./scripts/dev.sh start# Ensure WASM target is installed
rustup target add wasm32-unknown-unknown
# Clean and rebuild
cd frontend
trunk clean
trunk build# Update Rust and reinstall
rustup update stable
cargo install diesel_cli --no-default-features --features postgres# Check migration status
cd backend
diesel migration list
# If stuck, reset the database
cd ..
./scripts/dev.sh stop
docker-compose -f docker-compose.test.yml down -v
./scripts/dev.sh startThe dev script sets these automatically, but you can override them:
| Variable | Default | Description |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Database connection |
HOST |
0.0.0.0 |
Backend bind address |
PORT |
3000 |
Backend port |
- Development Guide - Full development workflow, testing, contributing
- Docker Guide - Docker-based deployment
- Deployment Guide - Production deployment