#1665

[Feature]: Parent projects with independent apps and shared environment lifecycle

Openel-hackopened 26d ago

Existing issue

  • I have searched the existing issues and found no duplicate.

Problem or use case

Today, a project in the dashboard is effectively one deployable application. A product with a frontend, API, and admin app must be represented by separate projects, with no parent that shows they belong to the same product.

I would like two valid creation paths: (1) create a parent project and add several applications to it, or (2) create a standalone application directly. Each application must remain independently deployable, including when it belongs to a parent project.

The environment model is part of the request. A parent project should own its environment definitions (for example, Production and Staging) and their lifecycle. A standalone application should own its environments directly. This would make it possible to see which applications participate in the same product environment without coupling their deployments.

Proposed solution

Proposed product hierarchy:

  • Workspace → parent project → applications → application deployments in each parent environment.
  • Workspace → standalone application → its environments and deployments.

For a parent project, creating, renaming, or archiving an environment applies to the shared environment structure across its applications. Each application keeps its own deployment history, source, domains, runtime settings, and deployment actions. Creating a parent environment must not trigger deployments. Parent environments do not automatically share environment variables or deployment targets between applications. A standalone application manages the same environment lifecycle at application level.

Suggested initial scope: create a parent project, add applications from independent sources, manage parent environments, show applications by parent environment, and continue to support ungrouped applications. Existing project IDs and deployment APIs should keep working. When attaching an existing standalone application, require an explicit environment mapping that preserves its deployments and configuration. Deleting or archiving a parent must never silently delete running applications.

Architecture for maintainer review: the current project_app row represents one source identity with multiple deployable project environment rows. A new parent entity above project_app seems safer than reusing either existing table or a workspace. The exact schema and migration should be agreed here before implementation.

Alternatives considered

Using workspaces as parent projects would also change the access, billing, and infrastructure boundary. Reusing project_app would mix independent applications with environments of a single source. A UI-only folder would not provide a durable environment lifecycle or consistent API behavior.

Additional context

Related but distinct: #558 unified the Projects/Apps entry point; #873 concerned multi-app deployment from one monorepo. This request groups independently deployable applications, potentially from different repositories.

Relevant current model: packages/db/src/schema/project.ts defines project_app as the parent of deployable project environments; apps/dashboard/src/app/(dashboard)/projects/page.tsx renders the current project list.

Acceptance scenarios:

  1. A user can create an empty parent project with Production and Staging, then add a frontend and API from different repositories.
  2. Renaming a parent environment is reflected for both applications without redeploying either one. Each application can deploy or roll back independently in that environment.
  3. A user can create a standalone application and manage its environments without creating a parent.
  4. Existing applications and deployments remain accessible after migration; attaching one to a parent cannot discard its existing environment configuration.
  5. Parent and application ownership remain within the same workspace; authorization does not widen through grouping.

I would be happy to implement this after maintainers agree on the product semantics and an initial slice.

Activity

0

No activity yet.