Skip to content

feat(infra): add frontend service to compose for one-command local stack - #216

Closed
parthrohit22 wants to merge 1 commit into
Second-Origin:devfrom
parthrohit22:feat/214-frontend-compose-service
Closed

feat(infra): add frontend service to compose for one-command local stack#216
parthrohit22 wants to merge 1 commit into
Second-Origin:devfrom
parthrohit22:feat/214-frontend-compose-service

Conversation

@parthrohit22

Copy link
Copy Markdown
Collaborator

Summary

Adds a frontend service to the Compose stack so npm run docker:up boots the entire local environment — API + PostgreSQL + Redis + frontend dev server — in one command. Previously the frontend had to be run in a separate terminal; this closes that gap.

Builds on the #214 hardening (data tier is host-isolated on the internal data network); the frontend service joins that same data network and reaches the API by its compose service name, not localhost.

Linked issue

Related to #214 (infra hardening / self-hosted operability, W7). No dedicated issue; this is a developer-experience follow-on to the Compose work.

Roadmap alignment

  • Roadmap §23 workstream this advances: W7 (Platform / operability) — a reproducible one-command local stack lowers the barrier for trusted local operation and contributor onboarding.
  • §28 market-fit criterion this moves toward: "Deployment repeatability" (hosted and supported self-hosted reference environments install cleanly) and contributor onboarding speed.
  • Accepted evidence it is real: npm run docker:config validates the composed file; the frontend service resolves in the generated config with correct build context, dependency on api, and data network membership.

What changed

  • apps/frontend/Dockerfile (new): Node 20 image, installs deps, runs vite --host 0.0.0.0 --port 5173, sets VITE_API_URL=http://api:8000.
  • docker-compose.yml: added frontend service — published 5173:5173, source mounted for hot reload (with /app/node_modules preserved), depends_on: api, on data network.
  • README.md: documented the one-command stack and kept npm run dev:frontend as the out-of-Compose alternative.

Acceptance criteria completed

  • npm run docker:up starts api + postgres + redis + frontend together.
  • Frontend reachable at http://localhost:5173 from the host.
  • Frontend reaches the API via the internal network (no localhost assumption).
  • npm run docker:config validates; service resolves.
  • README updated; no fabricated claims (live boot left to operator run step).

Testing performed

npm run docker:config     # compose validates; 'frontend' service present and well-formed

Live boot (npm run docker:up, then open http://localhost:5173) is the operator's verification step and was not executed here to avoid a multi-minute image build; the config-level checks pass.

Screenshots

Not applicable (infra change).

Security and data considerations

Dependencies and blocked work

None.

Scope changes or remaining work

None. The backend image build and Postgres/Redis host isolation from #214 are unchanged.

Contributor checklist

  • This PR targets dev
  • The branch was created from an up-to-date upstream/dev
  • This PR addresses one clearly scoped issue
  • This PR advances a §23 workstream toward a §28 market-fit criterion (Roadmap alignment filled)
  • Every acceptance criterion I claim as complete is actually complete
  • Relevant tests pass (compose config validation)
  • Documentation is updated for any user-visible change
  • No secrets, credentials, local env files, or generated artifacts are included
  • No unrelated files were changed
  • Closing syntax (Closes) is used only because the issue is fully resolved
  • Dependencies and follow-up work are linked

- New apps/frontend/Dockerfile runs the Vite dev server (binds 0.0.0.0:5173).
- docker-compose.yml now includes a 'frontend' service on the internal
  'data' network, reaching the API via its service name (VITE_API_URL=
  http://api:8000). Source is mounted for hot reload.
- 'npm run docker:up' now boots api + postgres + redis + frontend together,
  so local dev no longer needs a separate terminal for the frontend.
- README updated to document the one-command stack.

Verified: 'npm run docker:config' validates; frontend service resolves in the
composed config. Live boot (docker:up + localhost:5173) is the operator's
run step.
@parthrohit22

Copy link
Copy Markdown
Collaborator Author

Reverting per owner decision; one-command compose stack to be re-planned later.

@parthrohit22
parthrohit22 deleted the feat/214-frontend-compose-service branch July 27, 2026 13:43
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