Skip to content

refactor: restructure repo into apps/ + deployment/ monorepo layout - #49

Merged
AhmadHammad21 merged 4 commits into
mainfrom
refactor/monorepo-apps-layout
May 24, 2026
Merged

AhmadHammad21 merged 4 commits into
mainfrom
refactor/monorepo-apps-layout

Conversation

@AhmadHammad21

@AhmadHammad21 AhmadHammad21 commented May 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Reorganizes the project from a flat layout into an apps/ + deployment/ monorepo structure so each piece is self-contained and independently dockerizable.

  • src/ + migrations/ + tests/ + scripts/ + pyproject.toml → apps/backend/
  • frontend/ → apps/frontend/
  • docs/ → apps/documentation/ (future hosted docs site slot)
  • docker-compose.yml → deployment/docker-compose/
  • Dockerfile → apps/backend/Dockerfile
  • Dockerfile.railway + railway.toml → deployment/railway/

Code changes

  • apps/backend/src/api/app.py — fix _DIST path with Docker-layout fallback so uv run devops-agent ui works locally and the Railway image serves the built frontend correctly
  • apps/backend/pyproject.toml — add config, skills, providers to hatch packages list (fixes latent gap where a non-editable wheel build would omit them)
  • deployment/railway/Dockerfile.railway — update COPY paths to apps/ layout
  • deployment/docker-compose/docker-compose.yml — update build contexts and env_file path
  • deployment/railway/railway.toml — update dockerfile path
  • .github/workflows/ci.yml — add defaults.run.working-directory: apps/backend
  • Makefile — root-level convenience targets so existing one-command workflow is preserved (make dev, make test, make compose-up, etc.)
  • .dockerignore — per-app files for apps/backend and apps/frontend build contexts; root file updated for Railway's repo-root context
  • CLAUDE.md + README.md — all path references, commands, and doc links updated

Test plan

  • cd apps/backend && uv run pytest -q — 218 passed ✅ (verified locally)
  • cd apps/backend && uv run dev — server boots at http://localhost:8000
  • cd apps/frontend && npm install && npm run dev — UI loads, SSE chat works
  • make compose-up — all three services healthy
  • docker build -f deployment/railway/Dockerfile.railway . from repo root succeeds

Reorganizes the project to match an opik-style monorepo so each piece is
independently buildable and the layout is ready for future services (docs
site, sandbox executor, etc.).

Layout changes:
- src/ + migrations/ + tests/ + scripts/ + pyproject.toml → apps/backend/
- frontend/ → apps/frontend/
- docs/ → apps/documentation/
- docker-compose.yml → deployment/docker-compose/
- Dockerfile + Dockerfile.railway + railway.toml → apps/backend/ / deployment/railway/

Code/config changes:
- apps/backend/src/api/app.py: fix _DIST path with Docker fallback
- apps/backend/pyproject.toml: add config/skills/providers to hatch packages
- deployment/railway/Dockerfile.railway: update COPY paths to apps/ layout
- deployment/docker-compose/docker-compose.yml: update build contexts and env_file
- deployment/railway/railway.toml: update dockerfile path
- .github/workflows/ci.yml: add working-directory: apps/backend
- Makefile: root convenience targets wrapping cd apps/backend && uv run ...
- CLAUDE.md: update all path references, commands, add repo structure section
- README.md: update commands, project structure tree, docs/ links
- apps/backend/.dockerignore: excludes venv, pycache, tests, .env, data
- apps/frontend/.dockerignore: excludes node_modules, dist, .vite
- root .dockerignore: updated paths for railway build (repo-root context)
Move the agent loop, tools, providers, models, skills, integrations, DB
backends, and baseline migrations into an installable opendevops-core
package (apps/core). The OSS backend now depends on it via a uv path
source and injects its settings through CoreSettings + configure(), so
the agent core has no web/CLI coupling and can be reused by the product.

Migrations now live in the core package and apply via a source-aware
runner (schema_migrations ledger) that runs core-then-app. CLI, MCP
server, scripts, tests, and docs updated for the new layout.
Add optional org_id/user_id to upsert_session and an optional org_id
filter to list_sessions/get_messages across the DatabaseBackend ABC and
all backends. Postgres enforces scoping (filtered lists + cross-org read
denial); memory scopes it; sqlite accepts-but-ignores (single-tenant).
Default None preserves single-tenant OSS behavior; the seam exists for
downstream multi-tenant consumers. save_turn passes org/user through.
@AhmadHammad21
AhmadHammad21 merged commit 4537e99 into main May 24, 2026
2 checks passed
@AhmadHammad21
AhmadHammad21 deleted the refactor/monorepo-apps-layout branch May 24, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant