refactor: move workers/ into apps/workers/; add backend/README.md - #9
Merged
Conversation
Continues the directory reorg. After the previous two PRs the tree still had `workers/` (Cloudflare edge router) as a sibling of `apps/` even though `apps/web` was also a Cloudflare Workers deployment. Two Workers deployments shelved differently — inconsistent. This PR adopts a single rule: every deployable TypeScript / SDK package lives under `apps/*`. The Python backend stays at `backend/` because (a) it's Python (different language), (b) its `app/` module would collide with `apps/` if nested, (c) Python convention is one source tree per project. Mechanical changes: - git mv workers apps/workers — preserves history for every src file. - pnpm-workspace.yaml: collapse to single `apps/*` glob (drop the separate `- "workers"` line; covered by apps/*). - apps/workers/containers.toml: build context `..` → `../..`; dockerfile `../backend/Dockerfile.cloudflare` → `../../backend/...`. - .github/workflows/deploy-cf.yml: every `working-directory: workers` and `workingDirectory: workers` → `apps/workers`; cache-dependency path updated similarly. - scripts/cf-provision.sh: cd into apps/workers; output paths updated. - backend/Dockerfile.cloudflare: comment header references apps/workers/containers.toml. - All docs (architecture, what-is-what, README, citation-envelope, roadmap, strategy/user-journey, strategy/pricing, ADR-0001, ADR-0010, docs/README): workers/... → apps/workers/... - ADR-0006 gets an Amendment Part 3 documenting this move and the rationale (single apps/* workspace rule). - README.md repo tree: workers/ moved under apps/. - CHANGELOG.md is intentionally untouched (historical release notes reference the workers/ path that was correct at the time). apps/backend/ directory removed entirely (it was an empty leftover containing only a gitignored .env from the apps/backend/ collapse PR). The .env was filesystem-copied to backend/.env locally; gitignored so not tracked. Users with their own checkouts need to do the same: cp apps/backend/.env backend/.env && rm -rf apps/backend Audit additions: - backend/README.md created (every other package — apps/web, apps/workers, apps/sdk-ts, apps/sdk-py, apps/sdk-llamaindex — had a README; backend was the lone exception).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Continues the directory reorg. Adopts a single rule: every deployable TypeScript / SDK package lives under
apps/*. The Python backend stays atbackend/because it's Python (different language, conventionally one source tree per project, and itsapp/module would collide withapps/if nested).Before:
```
unsearch/
├── backend/ Python
├── workers/ TypeScript (CF Workers) ← inconsistent shelf
└── apps/
├── web/ TypeScript (CF Workers)
└── sdk-*/
```
After:
```
unsearch/
├── backend/ Python (the only non-apps/ deployable)
└── apps/
├── workers/ TypeScript (CF Workers edge router) — moved
├── web/ TypeScript (CF Workers — Next.js dashboard)
├── sdk-ts/, sdk-py/, sdk-llamaindex/, mcp-server/ (planned)
```
Mechanical changes
git mv workers apps/workers— every TS source file moved with history preserved.pnpm-workspace.yaml: collapses to a single- "apps/*"glob (drops the now-redundant- "workers"line).apps/workers/containers.toml: build context..→../..; dockerfile path../backend/Dockerfile.cloudflare→../../backend/Dockerfile.cloudflare..github/workflows/deploy-cf.yml: everyworking-directory: workers,workingDirectory: workers, andworkers/pnpm-lock.yamlreference →apps/workers.scripts/cf-provision.sh: cd intoapps/workers; output paths updated.backend/Dockerfile.cloudflare: header comment referencesapps/workers/containers.toml.workers/...→apps/workers/...indocs/architecture.md,docs/what-is-what.md,docs/README.md,docs/citation-envelope.md,docs/roadmap.md,docs/strategy/user-journey.md,docs/strategy/pricing.md, ADR-0001, ADR-0010, and the README.md repo tree.apps/*" rule.What did NOT change
wrangler.toml, and all source code are unchanged — only their file system location.CHANGELOG.mdintentionally untouched — historical release notes refer to theworkers/path that was correct at the time; rewriting history is wrong.Other audit cleanup in this PR
apps/backend/directory removedThe empty
apps/backend/directory left behind by the previous restructure PR (it contained only a gitignored.env) is gone. The.envwas filesystem-copied tobackend/.envin this workspace, but since both.envfiles are gitignored neither is in the diff. Users with their own local checkouts will need to do the same dance:```bash
cp apps/backend/.env backend/.env
rm -rf apps/backend
```
Added
backend/README.mdEvery other package (
apps/web,apps/workers,apps/sdk-ts,apps/sdk-py,apps/sdk-llamaindex) had a per-package README.backend/was the lone exception. Added one — covers layout, quickstart (make dev,make test, etc.), env setup, request flow from the Worker, citation envelope pointer.Risk
apps/workerspaths indeploy-cf.ymlupdated; expect green.workers/checkout and pull fresh (or git will refuse to clean a renamed-away dir).Test plan
workers/;apps/workers/exists.README.md,app/,alembic/,tests/, etc.apps/workersas a workspace member.deploy-cf.ymlworker + container + web + smoke jobs.../../backend/Dockerfile.cloudflare.