OmoiOS / rules
Cursor rule79 starsChanged 10 months agoApache-2.0View on GitHub
Development environment setup and commands for backend services
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- backend/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .claude/skills/oip-proposal/CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- frontend/CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- browser-useSkill
- agent-browserSkill
- billing-automationSkill
- canvas-designSkill
- claude-agent-sdk-pythonSkill
- doc-expanderSkill
- docxSkill
- frontend-designSkill
- internal-commsSkill
- litho-budgeted-analysisSkill
- mcp-builderSkill
- oip-proposalSkill
- paypal-integrationSkill
- pci-complianceSkill
- pdfSkill
- pptxSkill
- skill-creatorSkill
- spec-driven-devSkill
- stripe-integrationSkill
- template-skillSkill
- theme-factorySkill
- webapp-testingSkill
- web-artifacts-builderSkill
- xlsxSkill
The file
Files
---
description: Development environment setup and commands for backend services
globs: ["backend/**/*", "docker-compose*.yml", "Justfile"]
alwaysApply: false
---
# Backend Development Mode
## Starting the Development Environment
To run the backend services with hot-reload during development:
```bash
# From the project root directory
just watch
```
This command:
- Starts PostgreSQL and Redis containers
- Builds and runs the API, Worker, and Orchestrator services
- Enables hot-reload via `docker compose watch` - changes to Python files automatically restart services
## Service Architecture
The `just watch` command runs these services:
- **backend**: FastAPI server (port 8000)
- **worker**: Background task worker
- **postgres**: PostgreSQL database (port 15432)
- **redis**: Redis cache (port 16379)
The **orchestrator loop** runs inside the backend service and:
- Polls for pending tasks every 10 seconds
- Spawns Daytona sandboxes (when `DAYTONA_SANDBOX_EXECUTION=true`)
- Logs heartbeats every 30 seconds (JSON format via structlog)
## Viewing Logs
```bash
# All services
docker compose logs -f
# Specific service
docker compose logs -f backend
# Filter orchestrator JSON logs with jq
docker compose logs backend 2>&1 | grep -E '^\{' | jq 'select(.event == "heartbeat")'
```
## Common Issues
### "too many clients already" (PostgreSQL)
Connection pool exhaustion. Restart services:
```bash
docker compose restart postgres
# or full restart
docker compose down && just watch
```
### Multiple Alembic Heads
```bash
cd backend
uv run alembic heads # Check for multiple heads
uv run alembic merge <head1> <head2> -m "merge_heads"
```
## Important Paths
- **Justfile**: `/senior_sandbox/Justfile` (main commands)
- **Docker Compose**: `/senior_sandbox/backend/docker-compose.yml`
- **Orchestrator Worker**: `/senior_sandbox/backend/omoi_os/workers/orchestrator_worker.py`
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

