Dev Mode
The dev command starts a full local development environment with hot reload for all services.
npx learnhouse devHow It Works
The command splits infrastructure and application services:
- Infrastructure (Docker): PostgreSQL with pgvector + Redis run in containers via
.learnhouse/docker-compose.dev.yml - Application (local): API, Web, and Collab servers run directly on your machine with hot reload
Requirements
- Docker (for database and Redis)
- bun (for web and collab dependencies)
- uv (for Python API dependencies)
The CLI auto-installs dependencies (bun install, uv sync) if node_modules or .venv are missing.
Startup Flow
- Detect project root — Looks for the monorepo structure (
apps/api,apps/web,apps/collab) - Start infrastructure — Launches PostgreSQL and Redis containers (reuses existing ones if running)
- Health checks — Waits for database and Redis to be ready
- Admin setup — On first run, prompts for admin email and password. Credentials are saved and reused on subsequent runs.
- Install dependencies — Runs
bun installanduv syncif needed - Start services — Launches API, Web, and Collab with color-coded output
Services
| Service | Command | Port |
|---|---|---|
| API | uv run python app.py | 1338 |
| Web | next dev --turbopack | 3000 |
| Collab | tsx watch src/index.ts | 4000 |
Interactive Controls
While running, you can type commands to manage services:
| Key | Action |
|---|---|
ra | Restart API |
rw | Restart Web |
rc | Restart Collab |
rb | Restart all services |
q | Quit (graceful shutdown) |
Enterprise Edition
Use the --ee flag to enable Enterprise Edition features:
npx learnhouse dev --eeWithout the flag, the apps/api/ee/ directory is temporarily hidden during development.
Shutdown
When you quit (q or Ctrl+C):
- Local services (API, Web, Collab) are stopped
- Docker containers (PostgreSQL, Redis) keep running for the next session
- To fully stop infrastructure:
docker compose -f .learnhouse/docker-compose.dev.yml -p learnhouse-dev downDatabase data persists across dev sessions via Docker volumes. Your data is safe between restarts.