Set up monorepo scaffold with Yarn workspaces for Web and API #1

Closed
opened 2026-05-24 05:24:24 +00:00 by marko · 1 comment
Owner

User Story

As a developer, I want a monorepo scaffold using Yarn workspaces so that the project can contain a React frontend in /web using Vite and React 19, and a Django API in /api backed by a PostgreSQL database, with Docker Compose for development.

Acceptance Criteria

  • Root directory contains a package.json with workspaces field listing "web" and "api".
  • /web folder exists with a complete Vite project structure:
    • package.json with react version 19 and vite dependencies.
    • src/ directory with entry point (main.jsx or index.jsx), basic React component.
    • vite.config.js configured for development.
  • /api folder exists with a Django project scaffold:
    • use uv to manage dependencies and the environment.
    • manage.py present.
    • project/ directory with Django settings, including a settings.py that configures PostgreSQL (DATABASES with ENGINE = 'django.db.backends.postgres', NAME, USER, PASSWORD, HOST, PORT).
    • Minimal installed apps list (e.g., ['django.contrib.contenttypes', 'django.contrib.auth']).
  • Docker Compose file (docker-compose.yml) at repository root defines services:
    • db: PostgreSQL image (postgres:15), with volume for data persistence, environment variable POSTGRES_DB set to default database name.
    • web: Build context ./web, exposes port 3000, environment variable REACT_APP_API_URL set appropriately, depends_on db with condition service_healthy.
    • api: Build context ./api, exposes port 8000, environment variable DATABASE_URL pointing to db:5432, command to run migrations before startup (python manage.py migrate && python manage.py runserver 0.0.0.0:8000), depends_on db with health check.
    • Health check for db service that waits until PostgreSQL accepts connections.
    • Volumes are mounted for both web and api services for live development.
    • The compose setup can be started with docker compose up and both services become reachable on localhost.
    • No testing framework or CI/CD pipelines are required per clarification.
    • Environment variables are limited to those needed for DB connection (DATABASE_URL) and any API URLs; no additional env vars unless required.
## User Story As a developer, I want a monorepo scaffold using Yarn workspaces so that the project can contain a React frontend in `/web` using Vite and React 19, and a Django API in `/api` backed by a PostgreSQL database, with Docker Compose for development. ## Acceptance Criteria - Root directory contains a `package.json` with `workspaces` field listing "web" and "api". - `/web` folder exists with a complete Vite project structure: - `package.json` with `react` version 19 and `vite` dependencies. - `src/` directory with entry point (`main.jsx` or `index.jsx`), basic React component. - `vite.config.js` configured for development. - `/api` folder exists with a Django project scaffold: - use `uv` to manage dependencies and the environment. - `manage.py` present. - `project/` directory with Django settings, including a `settings.py` that configures PostgreSQL (`DATABASES` with `ENGINE` = 'django.db.backends.postgres', `NAME`, `USER`, `PASSWORD`, `HOST`, `PORT`). - Minimal installed apps list (e.g., ['django.contrib.contenttypes', 'django.contrib.auth']). - Docker Compose file (`docker-compose.yml`) at repository root defines services: - `db`: PostgreSQL image (`postgres:15`), with volume for data persistence, environment variable `POSTGRES_DB` set to default database name. - `web`: Build context `./web`, exposes port 3000, environment variable `REACT_APP_API_URL` set appropriately, depends_on `db` with condition `service_healthy`. - `api`: Build context `./api`, exposes port 8000, environment variable `DATABASE_URL` pointing to `db:5432`, command to run migrations before startup (`python manage.py migrate && python manage.py runserver 0.0.0.0:8000`), depends_on `db` with health check. - Health check for `db` service that waits until PostgreSQL accepts connections. - Volumes are mounted for both `web` and `api` services for live development. - The compose setup can be started with `docker compose up` and both services become reachable on localhost. - No testing framework or CI/CD pipelines are required per clarification. - Environment variables are limited to those needed for DB connection (`DATABASE_URL`) and any API URLs; no additional env vars unless required.
marko added this to the (deleted) project 2026-05-24 05:24:24 +00:00
marko changed title from Vite React 19 Project scaffold to monorepo scaffold with /web and /api folders 2026-05-24 05:28:27 +00:00
marko changed title from monorepo scaffold with /web and /api folders to Set up monorepo scaffold with Yarn workspaces for Web and API 2026-05-24 05:57:24 +00:00
marko removed this from the (deleted) project 2026-05-26 01:09:58 +00:00
Owner

Closing — monorepo scaffold setup is already implemented on main. Related PR #11 was closed as superseded.

— Reid (Hermes Reviewer)

Closing — monorepo scaffold setup is already implemented on main. Related PR #11 was closed as superseded. — Reid (Hermes Reviewer)
reid closed this issue 2026-05-26 01:50:49 +00:00
Sign in to join this conversation.
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: HermesFactory/job-tracker#1