n8n/docs/generated/sqlite-schema/app.md
Bernhard Wittmann 6fbdfcecdd
feat(core): Add Apps — a top-level App/Page entity with a first UI
Day 1 scaffold for the Webpage Node / App-concept Hackweek project: a
project-scoped App entity and its Page tree, decoupled from the
workflow canvas, plus enough editor UI to build one end-to-end.

Backend (packages/cli/src/modules/apps, packages/@n8n/db migration):
- App entity (namespace, theme JSON) and Page entity, pages forming a
  tree via a self-referencing parentPageId. A page's route can be a
  static slug, a dynamic :param segment (e.g. :id), or empty (meaning
  it's the index/home page for its level).
- Business rules enforced server-side: a namespace is unique per
  project; a page's route is unique among its siblings; an index page
  (empty route) can't have children, since it contributes no path
  segment of its own and a child would collide with a sibling's URL.
- New app:* scopes, an appId branch in userHasScopes, an opt-in
  backend module (apps) enabled by default alongside data-table.

Frontend (packages/frontend/editor-ui/src/features/apps):
- Apps list, App detail (page tree), and Page detail views, reachable
  both from the project view and the home overview tab bar.
- Create App / Create Page via modals (matching Data Table's pattern),
  not inline forms.
- Page hierarchy shown as a flat card grid per level with drill-down
  navigation (mirrors n8n's own Folders feature) instead of a fully
  expanded indented tree.
- AppBreadcrumbs: App > ancestor pages > current page/app, each a link
  back up except the current one.
- The App's and each Page's full served URL shown as a copyable field,
  live as the route is edited.
- Delete (with confirmation) on Apps and Pages throughout.

Goal package: goals/webpage-node/ (facts.md, plan.md, plan-week.md).
2026-09-07 14:46:51 +02:00

2.5 KiB
Generated

app

Description

Table Definition
CREATE TABLE "app" ("id" varchar(36) PRIMARY KEY NOT NULL, "name" varchar(128) NOT NULL, "namespace" varchar(128) NOT NULL, "theme" text, "projectId" varchar(36) NOT NULL, "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "FK_f84dd7eb539e46e0c233fa09b20" FOREIGN KEY ("projectId") REFERENCES "project" ("id") ON DELETE CASCADE)

Columns

Name Type Default Nullable Children Parents Comment
createdAt datetime(3) STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') false
id varchar(36) false page
name varchar(128) false
namespace varchar(128) false
projectId varchar(36) false project
theme TEXT true
updatedAt datetime(3) STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') false

Constraints

Name Type Definition
- (Foreign key ID: 0) FOREIGN KEY FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE
id PRIMARY KEY PRIMARY KEY (id)
sqlite_autoindex_app_1 PRIMARY KEY PRIMARY KEY (id)

Indexes

Name Definition
IDX_app_namespace_projectId CREATE UNIQUE INDEX "IDX_app_namespace_projectId" ON "app" ("namespace", "projectId")
sqlite_autoindex_app_1 PRIMARY KEY (id)

Relations

erDiagram

"page" }o--|| "app" : "FOREIGN KEY (appId) REFERENCES app (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
"app" }o--|| "project" : "FOREIGN KEY (projectId) REFERENCES project (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"

"app" {
  datetime_3_ createdAt
  varchar_36_ id PK
  varchar_128_ name
  varchar_128_ namespace
  varchar_36_ projectId FK
  TEXT theme
  datetime_3_ updatedAt
}
"page" {
  varchar_36_ appId FK
  TEXT content
  datetime_3_ createdAt
  varchar_36_ id PK
  varchar_36_ parentPageId FK
  varchar_255_ route
  datetime_3_ updatedAt
}
"project" {
  datetime_3_ createdAt
  varchar creatorId FK
  TEXT customTelemetryTags
  varchar_512_ description
  TEXT icon
  varchar_36_ id PK
  varchar_255_ name
  varchar_36_ type
  datetime_3_ updatedAt
}

Generated by tbls