This example demonstrates devloop orchestrating a typical full-stack web development environment with multiple components running in parallel.
- Go Backend API: Simple TODO API with GET and POST endpoints
- Frontend: Vanilla JavaScript single-page application
- Database Migrations: SQL migration scripts that run on changes
- API Documentation: Auto-generated docs from templates
- Go 1.20 or higher
- Node.js 14 or higher
- devloop installed (
go install github.com/panyam/devloop@latest)
-
Install dependencies:
make deps
-
Run with devloop:
make run # Or directly: devloop -c .devloop.yaml -
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:20202/api/todos
When you run make run, devloop will start all services immediately:
[devloop] Starting orchestrator...
[devloop] Executing rule "backend" on initialization (run_on_init: true)
[devloop] Executing rule "frontend" on initialization (run_on_init: true)
[devloop] Executing rule "db" on initialization (run_on_init: true)
[devloop] Executing rule "docs" on initialization (run_on_init: true)
[backend] Building Go server...
[backend] Starting server on http://localhost:20202
[frontend] Starting web server...
[db] Checking for pending migrations...
[docs] Generating API documentation...
Devloop will continue monitoring for file changes and automatically rebuild/restart services as needed.
-
Modify the backend (
backend/main.go):- Add a new field to the TODO struct
- Watch devloop rebuild and restart the server
-
Update the frontend (
frontend/app.js):- Change the UI or add a feature
- See instant updates without manual restart
-
Add a migration (
migrations/002_add_field.sql):- Create a new SQL file
- Watch the migration runner execute automatically
-
Update API docs (
docs/api_template.md):- Modify the template
- See regenerated documentation
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Frontend │────▶│ Backend │────▶│ Database │
│ localhost │ │ API │ │ (in-memory) │
│ :3000 │ │ :20202 │ │ │
└─────────────┘ └─────────────┘ └─────────────┘
.devloop.yaml- Orchestration configurationbackend/main.go- Go API serverfrontend/app.js- JavaScript applicationmigrations/*.sql- Database migrations
- Port already in use: Kill existing processes or change ports in the code
- Dependencies missing: Run
make depsagain - Changes not detected: Check glob patterns in
.devloop.yaml