Skip to content

Conversation

@kingston
Copy link
Collaborator

@kingston kingston commented Oct 27, 2025

Summary by CodeRabbit

  • New Features

    • Infrastructure Settings page to enable/disable services like Redis.
    • Root-level Docker Compose support so infrastructure can be started from the repository root.
  • Documentation

    • Updated quickstart and example READMEs to an infrastructure-first workflow and root-level commands.
  • Refactor

    • Service configuration moved from individual apps to centralized infrastructure settings.
  • Bug Fixes

    • Fixed overwrite behavior for generator files so no-overwrite cases now behave as intended.

@changeset-bot
Copy link

changeset-bot bot commented Oct 27, 2025

🦋 Changeset detected

Latest commit: dd66a50

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@baseplate-dev/sync Patch
@baseplate-dev/project-builder-lib Patch
@baseplate-dev/project-builder-server Patch
@baseplate-dev/project-builder-web Patch
@baseplate-dev/core-generators Patch
@baseplate-dev/fastify-generators Patch
@baseplate-dev/project-builder-common Patch
@baseplate-dev/project-builder-test Patch
@baseplate-dev/react-generators Patch
@baseplate-dev/plugin-auth Patch
@baseplate-dev/plugin-queue Patch
@baseplate-dev/plugin-storage Patch
@baseplate-dev/project-builder-cli Patch
@baseplate-dev/create-project Patch
@baseplate-dev/code-morph Patch
@baseplate-dev/tools Patch
@baseplate-dev/ui-components Patch
@baseplate-dev/utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Oct 27, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Migrates Docker Compose generation from backend packages to the monorepo root and centralizes Redis enablement into new infrastructure settings; adds schema migration and tests, updates compilers and example projects, adds infrastructure UI route, and threads ignore-pattern support through sync metadata operations.

Changes

Cohort / File(s) Summary
Changesets
/.changeset/dull-parts-build.md, /.changeset/move-docker-to-root.md, /.changeset/move-redis-to-infrastructure.md
Adds release notes: patch for sync (noOverwrite fix) and documentation for Docker/Redis config migration.
Infrastructure Schema & Settings
packages/project-builder-lib/src/schema/settings/infrastructure.ts, packages/project-builder-lib/src/schema/settings/settings.ts, packages/project-builder-lib/src/schema/settings/index.ts
New infrastructure settings schema (optional redis.enabled default false); re-exported from settings barrel and integrated into overall settings schema.
Schema Migrations
packages/project-builder-lib/src/migrations/migration-020-move-redis-to-infrastructure.ts, packages/project-builder-lib/src/migrations/migration-020-move-redis-to-infrastructure.unit.test.ts, packages/project-builder-lib/src/migrations/index.ts
Adds migration v20 to move enableRedis from backend apps to settings.infrastructure.redis.enabled and comprehensive unit tests; migration added to SCHEMA_MIGRATIONS.
Backend App Schema
packages/project-builder-lib/src/schema/apps/backend/index.ts
Removes optional enableRedis field from backend app schema.
Infrastructure Utilities
packages/project-builder-server/src/compiler/infrastructure-utils.ts
New utilities: getPostgresSettings, getRedisSettings, isRedisEnabled computing ports/credentials/URLs from ProjectDefinition.
Compiler Changes
packages/project-builder-server/src/compiler/root/root-package-compiler.ts, packages/project-builder-server/src/compiler/backend/backend-compiler.ts, packages/project-builder-server/src/compiler/backend/fastify.ts
Moves Docker Compose generation to root compiler; removes docker child from backend compiler; fastify integration now uses isRedisEnabled and getRedisSettings from infrastructure utils.
Sync: metadata & preparation
packages/sync/src/output/prepare-generator-files/prepare-generator-file.ts, packages/sync/src/output/prepare-generator-files/prepare-generator-file.unit.test.ts, packages/sync/src/templates/extractor/run-template-file-extractors.ts, packages/sync/src/templates/metadata/read-template-info-files.ts, packages/sync/src/templates/metadata/delete-metadata.ts, packages/sync/src/types.ts
Threads ignore-pattern support through metadata reading/deletion and extractor flows (loadIgnorePatterns usage); reorders shouldNeverOverwrite handling; removes one unit test case; extends deleteMetadataFiles signature to accept ignore instance and baseDirectory.
Web: routes & UI
packages/project-builder-web/src/route-tree.gen.ts, packages/project-builder-web/src/routes/settings/infrastructure.tsx, packages/project-builder-web/src/routes/settings/route.tsx, packages/project-builder-web/src/routes/apps/edit.$key/backend.tsx
Adds /settings/infrastructure route and InfrastructureSettingsPage to manage Redis enablement; removes per-app Redis toggle and updates UI text for Bull Queue.
Template README updates
packages/core-generators/src/generators/node/root-readme/templates/package/README.md, packages/fastify-generators/src/generators/core/readme/templates/package/README.md
Updates generated README templates to start infrastructure (docker compose) at repo root and adds infrastructure commands to Quick Start/Common Commands.
Example projects (blog-with-auth, todo-with-auth0)
examples/.../baseplate/project-definition.json, examples/.../baseplate/file-id-map.json, examples/.../docker/docker-compose.yml, examples/.../docker/.env.example, examples/.../apps/backend/.env.example, examples/.../apps/backend/README.md, examples/.../README.md, examples/.../.baseplateignore, examples/.../apps/backend/baseplate/file-id-map.json, examples/.../apps/backend/docker/.env.example
Moves Docker files to root docker/, updates example envs and compose defaults (container names, DB/Redis names & passwords), bumps schemaVersion to 20, removes enableRedis from backend apps, and updates READMEs and file-id-maps.
Tests & CI
packages/project-builder-test/src/tests/simple.test.ts, .github/workflows/lint-examples.yml
Tests and workflow updated to use root docker/docker-compose.yml; lint workflow Docker setup working-directory adjusted to examples/${{ matrix.example }}/docker.

Sequence Diagram(s)

sequenceDiagram
    participant Old as Old Config Flow
    participant New as New Config Flow

    rect rgba(220,240,255,0.6)
    note over Old,New: Config read
    Old->>Old: backend.app.enableRedis
    New->>New: settings.infrastructure.redis.enabled
    end

    rect rgba(255,235,205,0.6)
    note over Old,New: Build/Compile
    Old->>Old: BackendCompiler checks app.enableRedis
    New->>New: BackendCompiler asks isRedisEnabled()
    end

    rect rgba(205,255,220,0.6)
    note over Old,New: Generation target
    Old->>Old: Generates Redis in backend package/docker
    New->>New: Generates Redis in root docker/ when enabled
    end

    rect rgba(240,220,240,0.6)
    note over New: Migration
    New->>New: migration-020 moves field and removes per-app flag
    end
Loading
sequenceDiagram
    participant Compiler as Project Compiler
    participant Root as Root Compiler
    participant Backend as Backend Compiler
    participant Infra as Infrastructure Utils
    participant Fastify as Fastify Builder

    Compiler->>Root: build root package
    Root->>Infra: getPostgresSettings(projectDef)
    Root->>Infra: isRedisEnabled(projectDef) -> if true getRedisSettings()
    Root->>Root: include docker-compose generator with returned settings

    Compiler->>Backend: build backend package
    Backend->>Fastify: build fastify service
    Fastify->>Infra: isRedisEnabled(projectDef)?
    alt enabled
        Fastify->>Infra: getRedisSettings() -> use returned URL in generator
    else disabled
        Fastify->>Fastify: omit Redis feature
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Areas to focus:
    • migration: correctness across edge cases (missing apps, multiple backends, preserving other settings)
    • compiler changes: ensure root docker generation covers previously per-backend defaults and that backend generation no longer emits docker
    • sync metadata: verify ignore-pattern propagation and behavior of modified prepare-generator-file flow
    • web UI: form validation, persistence via saveDefinitionWithFeedback, and route registration
    • examples: consistency of file-id-map updates and env/docker-compose defaults

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kingston/eng-912-move-docker-compose-file-to-root-instead-of-backend

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between db2cf26 and dd66a50.

⛔ Files ignored due to path filters (26)
  • examples/blog-with-auth/apps/backend/baseplate/generated/.env.example is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/apps/backend/baseplate/generated/README.md is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/apps/backend/baseplate/generated/docker/.env.example is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/baseplate/generated/README.md is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/baseplate/generated/docker/.env.example is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/baseplate/generated/docker/docker-compose.yml is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/apps/backend/baseplate/generated/.env.example is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/apps/backend/baseplate/generated/README.md is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/apps/backend/baseplate/generated/docker/.env.example is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/baseplate/generated/README.md is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/baseplate/generated/docker/.env.example is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/baseplate/generated/docker/docker-compose.yml is excluded by !**/generated/**, !**/generated/**
  • tests/simple/README.md is excluded by !tests/**
  • tests/simple/apps/backend/.env.example is excluded by !tests/**
  • tests/simple/apps/backend/baseplate/file-id-map.json is excluded by !tests/**
  • tests/simple/apps/backend/baseplate/generated/.env.example is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/apps/backend/baseplate/generated/README.md is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/apps/backend/baseplate/generated/docker/.env.example is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/apps/backend/docker/.env.example is excluded by !tests/**
  • tests/simple/baseplate/file-id-map.json is excluded by !tests/**
  • tests/simple/baseplate/generated/README.md is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/baseplate/generated/docker/.env.example is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/baseplate/generated/docker/docker-compose.yml is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/baseplate/project-definition.json is excluded by !tests/**
  • tests/simple/docker/.env.example is excluded by !tests/**
  • tests/simple/docker/docker-compose.yml is excluded by !tests/**
📒 Files selected for processing (51)
  • .changeset/dull-parts-build.md (1 hunks)
  • .changeset/move-docker-to-root.md (1 hunks)
  • .changeset/move-redis-to-infrastructure.md (1 hunks)
  • .github/workflows/lint-examples.yml (1 hunks)
  • examples/blog-with-auth/.baseplateignore (1 hunks)
  • examples/blog-with-auth/README.md (2 hunks)
  • examples/blog-with-auth/apps/backend/.baseplateignore (1 hunks)
  • examples/blog-with-auth/apps/backend/.env.example (1 hunks)
  • examples/blog-with-auth/apps/backend/README.md (1 hunks)
  • examples/blog-with-auth/apps/backend/baseplate/file-id-map.json (0 hunks)
  • examples/blog-with-auth/apps/backend/docker/.env.example (0 hunks)
  • examples/blog-with-auth/baseplate/file-id-map.json (1 hunks)
  • examples/blog-with-auth/baseplate/project-definition.json (1 hunks)
  • examples/blog-with-auth/docker/.env.example (1 hunks)
  • examples/blog-with-auth/docker/docker-compose.yml (2 hunks)
  • examples/todo-with-auth0/.baseplateignore (1 hunks)
  • examples/todo-with-auth0/README.md (2 hunks)
  • examples/todo-with-auth0/apps/backend/.baseplateignore (1 hunks)
  • examples/todo-with-auth0/apps/backend/.env.example (1 hunks)
  • examples/todo-with-auth0/apps/backend/README.md (1 hunks)
  • examples/todo-with-auth0/apps/backend/baseplate/file-id-map.json (0 hunks)
  • examples/todo-with-auth0/apps/backend/docker/.env.example (0 hunks)
  • examples/todo-with-auth0/baseplate/file-id-map.json (1 hunks)
  • examples/todo-with-auth0/baseplate/project-definition.json (1 hunks)
  • examples/todo-with-auth0/docker/.env.example (1 hunks)
  • examples/todo-with-auth0/docker/docker-compose.yml (2 hunks)
  • packages/core-generators/src/generators/node/root-readme/templates/package/README.md (2 hunks)
  • packages/fastify-generators/src/generators/core/readme/templates/package/README.md (1 hunks)
  • packages/project-builder-lib/src/migrations/index.ts (2 hunks)
  • packages/project-builder-lib/src/migrations/migration-020-move-redis-to-infrastructure.ts (1 hunks)
  • packages/project-builder-lib/src/migrations/migration-020-move-redis-to-infrastructure.unit.test.ts (1 hunks)
  • packages/project-builder-lib/src/schema/apps/backend/index.ts (0 hunks)
  • packages/project-builder-lib/src/schema/settings/index.ts (1 hunks)
  • packages/project-builder-lib/src/schema/settings/infrastructure.ts (1 hunks)
  • packages/project-builder-lib/src/schema/settings/settings.ts (3 hunks)
  • packages/project-builder-server/src/compiler/backend/backend-compiler.ts (1 hunks)
  • packages/project-builder-server/src/compiler/backend/fastify.ts (2 hunks)
  • packages/project-builder-server/src/compiler/backend/utils.ts (0 hunks)
  • packages/project-builder-server/src/compiler/infrastructure-utils.ts (1 hunks)
  • packages/project-builder-server/src/compiler/root/root-package-compiler.ts (3 hunks)
  • packages/project-builder-server/src/sync/types.ts (2 hunks)
  • packages/project-builder-test/src/tests/simple.test.ts (1 hunks)
  • packages/project-builder-web/src/route-tree.gen.ts (11 hunks)
  • packages/project-builder-web/src/routes/apps/edit.$key/backend.tsx (1 hunks)
  • packages/project-builder-web/src/routes/settings/infrastructure.tsx (1 hunks)
  • packages/project-builder-web/src/routes/settings/route.tsx (1 hunks)
  • packages/sync/src/output/prepare-generator-files/prepare-generator-file.ts (1 hunks)
  • packages/sync/src/output/prepare-generator-files/prepare-generator-file.unit.test.ts (0 hunks)
  • packages/sync/src/templates/extractor/run-template-file-extractors.ts (2 hunks)
  • packages/sync/src/templates/metadata/delete-metadata.ts (1 hunks)
  • packages/sync/src/templates/metadata/read-template-info-files.ts (4 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link

vercel bot commented Oct 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
baseplate-project-builder-web Ready Ready Preview Comment Oct 27, 2025 10:06pm

@kingston kingston merged commit 839cbdf into main Oct 27, 2025
15 checks passed
@kingston kingston deleted the kingston/eng-912-move-docker-compose-file-to-root-instead-of-backend branch October 27, 2025 22:17
@github-actions github-actions bot mentioned this pull request Oct 27, 2025
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.

2 participants