Skip to content

~ Add dynamic Marketing Pages system with worker API, Next.js renderer, and admin builder#156

Draft
thinkdj wants to merge 1 commit intomainfrom
codex/build-dynamic-marketing-page-creator-6i5n6w
Draft

~ Add dynamic Marketing Pages system with worker API, Next.js renderer, and admin builder#156
thinkdj wants to merge 1 commit intomainfrom
codex/build-dynamic-marketing-page-creator-6i5n6w

Conversation

@thinkdj
Copy link
Copy Markdown
Owner

@thinkdj thinkdj commented Mar 31, 2026

Motivation

  • Provide a dynamic, worker-driven marketing pages system so the homepage and landing pages can be authored in-app and rendered by the Next/TanStack worker API.
  • Add an editor/admin UI for creating, duplicating, reordering and publishing landing pages composed of reusable blocks.
  • Support monorepo development ergonomics by adding path/webpack aliases and dev helpers for importing package source during local build.

Description

  • Worker API: add routes and handlers for a blocks registry and marketing pages at /api/blocks, /api/pages/nav, and /api/pages/:slug with full section/feature/action payloads in worker/routes/marketing-pages.ts.
  • Data model and policies: add Drizzle/ottaorm schemas MarketingPage.schema.ts, models MarketingPage.ts, RLS policies marketingPagesPolicy.ts, and register them in schema helpers and DB init flow.
  • Admin UI and client: add page list and page builder React pages (AdminPagesListPage, AdminPageBuilderPage), a client renderer (MarketingPageRenderer), hooks (marketingPageHooks.ts) and types under the TanStack app, plus router entries to surface admin and public page routes.
  • Next.js integration: add dynamic Next route app/[slug]/page.tsx and marketing-page-content.tsx plus lib/api.ts to fetch pages/nav from the worker API, update README.md for dynamic pages, and adjust navbar imports to the new shared @ottabase/ui-components export.
  • Dev/build config: enable webpack invocation for dev/build via --webpack in package.json scripts, add monorepo webpack aliases in next.config.js, extend tsconfig.json path mappings, and set typescript.ignoreBuildErrors to true to avoid sibling-package type errors during Next builds.
  • Robustness: enhance ottaorm-crud to auto-run autoInit migrations in development on missing-table/column errors to recover from local schema drift.
  • Tests: add a unit test worker/routes/__tests__/marketing-pages.test.ts validating the blocks registry and handler.

Testing

  • Ran unit tests with pnpm test (Vitest), including the new marketing-pages.test.ts, and they succeeded.
  • Exercised worker CRUD flow and page endpoints in development with automatic autoInit enabled for schema drift, and requests to /api/blocks, /api/pages/nav, and /api/pages/:slug returned expected payload shapes during local testing.

Codex Task

@thinkdj thinkdj changed the title Add dynamic Marketing Pages system with worker API, Next.js renderer, and admin builder ~ Add dynamic Marketing Pages system with worker API, Next.js renderer, and admin builder Apr 1, 2026
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