Skip to content

feat(marketing-pages): add OttaORM marketing pages, admin builder, worker APIs, and Next.js rendering#154

Draft
thinkdj wants to merge 5 commits intomainfrom
codex/build-dynamic-marketing-page-creator
Draft

feat(marketing-pages): add OttaORM marketing pages, admin builder, worker APIs, and Next.js rendering#154
thinkdj wants to merge 5 commits intomainfrom
codex/build-dynamic-marketing-page-creator

Conversation

@thinkdj
Copy link
Copy Markdown
Owner

@thinkdj thinkdj commented Mar 31, 2026

Motivation

  • Provide a DB-driven, drag-and-drop marketing/homepage builder so SaaS founders can create landing pages quickly.
  • Allow apps to "register" blocks (hardcoded in this PR) and make them discoverable to the admin palette and public rendering.
  • Integrate with existing OttaORM/slot patterns so pages can be authored in the TanStack admin and rendered in both TanStack and Next.js homepage apps.

Description

  • Added Drizzle/OttaORM schema and models for marketing pages (pages, page_sections, page_features, page_actions) at ottabase/models/MarketingPage*.ts and exported tables in ottabase/db/schema.ts.
  • Implemented model classes (MarketingPage, PageSection, PageFeature, PageAction) and registered them in worker/lib/db-utils.ts so generic OttaORM CRUD endpoints work.
  • Added worker read endpoints and a block registry in worker/routes/marketing-pages.ts and wired routes into the worker router (/api/blocks, /api/pages/nav, /api/pages/:slug).
  • Added TanStack admin UI pages: /admin/pages list (AdminPagesListPage.tsx) and /admin/pages/$pageId builder (AdminPageBuilderPage.tsx) with a block palette, drag/drop canvas (native DnD handlers for MVP), inline editor, features/actions creation, and duplicate/delete flows.
  • Exposed a public TanStack route /pages/$slug (MarketingPageRenderer.tsx) for preview/live rendering and added a Next.js dynamic route app/[slug]/page.tsx + MarketingPageContent that fetches the worker API for static params + preview rendering.
  • Added client hooks and types (src/hooks/marketingPageHooks.ts, src/types/marketing-pages.ts) and a small Vitest route-level test for the block registry (worker/routes/__tests__/marketing-pages.test.ts).
  • Documented the feature in both apps' READMEs and added an admin entry for "Marketing Pages" in the Admin Console.
  • Notes: run the OttaORM init endpoint to apply DB migrations: curl -X POST http://localhost:3004/api/ottaorm/init.

Testing

  • Ran TypeScript check for the TanStack app with pnpm --filter @ottabase/ottabase-template-app-tanstack type-check, which failed due to many pre-existing workspace-wide type/import issues that are unrelated to this feature and prevented a clean type-check.
  • Ran the TanStack app tests targeting the new route-level test with pnpm --filter @ottabase/ottabase-template-app-tanstack test -- worker/routes/__tests__/marketing-pages.test.ts, but Vitest bootstrap failed early due to existing package resolution/type setup problems in the monorepo; the new test file is present and intended to pass once the workspace test bootstrap issues are resolved.
  • A new route-level test was added at apps/ottabase-template-app-tanstack/worker/routes/__tests__/marketing-pages.test.ts and the feature code is under apps/ottabase-template-app-tanstack/ottabase/models/MarketingPage*, worker/routes/marketing-pages.ts, and admin UI under src/pages/admin/pages/.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant