From 6930faa247e1a7e7bcdadc6bdd9dea3429723d62 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 16:42:14 +0000 Subject: [PATCH 01/10] Initial plan From 6395a9ca28b077e8cc9b52dfb483023e6c00068c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 16:50:14 +0000 Subject: [PATCH 02/10] feat: add homepage slot framework with variant components, config system, and config page Agent-Logs-Url: https://github.com/thinkdj/ottabase/sessions/727333a7-edea-4b82-9a29-3919a7439a95 Co-authored-by: thinkdj <688055+thinkdj@users.noreply.github.com> --- .../app/homepage-config/page.tsx | 96 +++++++++++ .../app/layout-shell.tsx | 27 ++-- .../app/page.tsx | 149 +++++++++--------- .../app/providers.tsx | 3 +- .../components/Navbar.tsx | 1 + .../components/SlotRenderer.tsx | 82 ++++++++++ .../components/index.ts | 1 + .../components/variants/cta/CTABanner.tsx | 34 ++++ .../components/variants/cta/CTADefault.tsx | 30 ++++ .../components/variants/cta/CTAMinimal.tsx | 32 ++++ .../components/variants/cta/index.ts | 4 + .../components/variants/cta/types.ts | 16 ++ .../variants/features/FeaturesCards.tsx | 25 +++ .../variants/features/FeaturesGrid.tsx | 20 +++ .../variants/features/FeaturesList.tsx | 23 +++ .../components/variants/features/index.ts | 4 + .../components/variants/features/types.ts | 11 ++ .../variants/footer/FooterColumns.tsx | 83 ++++++++++ .../variants/footer/FooterDefault.tsx | 46 ++++++ .../variants/footer/FooterMinimal.tsx | 16 ++ .../components/variants/footer/index.ts | 4 + .../components/variants/footer/types.ts | 12 ++ .../components/variants/hero/HeroCentered.tsx | 39 +++++ .../components/variants/hero/HeroMinimal.tsx | 37 +++++ .../components/variants/hero/HeroSplit.tsx | 51 ++++++ .../components/variants/hero/index.ts | 4 + .../components/variants/hero/types.ts | 17 ++ .../variants/navbar/NavbarCentered.tsx | 127 +++++++++++++++ .../variants/navbar/NavbarDefault.tsx | 119 ++++++++++++++ .../variants/navbar/NavbarMinimal.tsx | 21 +++ .../components/variants/navbar/index.ts | 4 + .../components/variants/navbar/types.ts | 12 ++ .../lib/homepage-config-context.tsx | 58 +++++++ .../lib/homepage-config.ts | 120 ++++++++++++++ 34 files changed, 1242 insertions(+), 86 deletions(-) create mode 100644 apps/ottabase-template-app-nextjs-homepage/app/homepage-config/page.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/SlotRenderer.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/cta/CTABanner.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/cta/CTADefault.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/cta/CTAMinimal.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/cta/index.ts create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/cta/types.ts create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/features/FeaturesCards.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/features/FeaturesGrid.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/features/FeaturesList.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/features/index.ts create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/features/types.ts create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/footer/FooterColumns.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/footer/FooterDefault.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/footer/FooterMinimal.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/footer/index.ts create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/footer/types.ts create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/hero/HeroCentered.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/hero/HeroMinimal.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/hero/HeroSplit.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/hero/index.ts create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/hero/types.ts create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/navbar/NavbarCentered.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/navbar/NavbarDefault.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/navbar/NavbarMinimal.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/navbar/index.ts create mode 100644 apps/ottabase-template-app-nextjs-homepage/components/variants/navbar/types.ts create mode 100644 apps/ottabase-template-app-nextjs-homepage/lib/homepage-config-context.tsx create mode 100644 apps/ottabase-template-app-nextjs-homepage/lib/homepage-config.ts diff --git a/apps/ottabase-template-app-nextjs-homepage/app/homepage-config/page.tsx b/apps/ottabase-template-app-nextjs-homepage/app/homepage-config/page.tsx new file mode 100644 index 000000000..196a0e0cb --- /dev/null +++ b/apps/ottabase-template-app-nextjs-homepage/app/homepage-config/page.tsx @@ -0,0 +1,96 @@ +'use client'; + +import { RotateCcw } from 'lucide-react'; +import { useHomepageConfig } from '../../lib/homepage-config-context'; +import { SLOT_NAMES, SLOT_REGISTRY } from '../../lib/homepage-config'; +import type { SlotName } from '../../lib/homepage-config'; + +export default function HomepageConfigPage() { + const { config, setVariant, resetConfig } = useHomepageConfig(); + + return ( +
+ Switch component variants for each section. Changes are saved automatically and applied + instantly. +
++ Choose which {slot.label} variant to render. +
+{description}
} +{description}
} +{description}
} +{f.description}
+{subtitle}
} + + {body &&{body}
} + + {actions && actions.length > 0 && ( +{subtitle}
} + + + + {actions && actions.length > 0 && ( +{subtitle}
} + + {body &&{body}
} + + {actions && actions.length > 0 && ( +- A modern, production-ready Next.js homepage template for Cloudflare Workers. -
-- This is a barebone Next.js homepage template designed to be easily deployed to Cloudflare - Workers using OpenNext. It provides a solid foundation for building beautiful, performant - homepages with modern web technologies. -
- -To get started with this template:
-pnpm install
- pnpm dev
-
- The template includes Brand Engine integration, allowing you to easily customize colors,
- typography, and theming. Edit{' '}
- config/brand.config.ts to configure your
- brand settings. Choose from 8 built-in theme presets or create your own custom theme.
-
- Deploy to Cloudflare Workers with a single command: -
-
- pnpm deploy
-
- - Make sure you have configured your Cloudflare credentials before deploying. -
-+ {description ?? 'A modern, production-ready Next.js homepage template for Cloudflare Workers.'} +
++ This is a barebone Next.js homepage template designed to be easily deployed to Cloudflare + Workers using OpenNext. It provides a solid foundation for building beautiful, performant + homepages with modern web technologies. +
+ +To get started with this template:
+pnpm install
+ pnpm dev
+
+ The template includes Brand Engine integration, allowing you to easily customize colors,
+ typography, and theming. Edit{' '}
+ config/brand.config.ts to configure your
+ brand settings. Choose from 8 built-in theme presets or create your own custom theme.
+
+ Deploy to Cloudflare Workers with a single command: +
+
+ pnpm deploy
+
+ + Make sure you have configured your Cloudflare credentials before deploying. +
++ {description ?? + 'A modern, production-ready Next.js homepage template designed for Cloudflare Workers.'} +
+{f.body}
++ {description ?? + 'A Next.js homepage template for Cloudflare Workers. Brand Engine themes, dark mode, and edge deployment — all out of the box.'} +
+pnpm install
+ Install dependencies with{' '}
+
+ pnpm install
+
pnpm dev
+ Run the dev server with{' '}
+
+ pnpm dev
+
The template includes Brand Engine integration, allowing you to easily customize colors,
typography, and theming. Edit{' '}
- config/brand.config.ts to configure your
- brand settings. Choose from 8 built-in theme presets or create your own custom theme.
+
+ config/brand.config.ts
+ {' '}
+ to configure your brand settings. Choose from 8 built-in theme presets or create your own custom
+ theme.
Deploy to Cloudflare Workers with a single command:
--pnpm deploy++pnpm deployMake sure you have configured your Cloudflare credentials before deploying. From ae5a8ab47dcb65ff0a3981a61bc0775e011ed2f4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 30 Mar 2026 08:05:27 +0000 Subject: [PATCH 08/10] fix: consolidate tab positioning, improve swatch spacing for accessibility Agent-Logs-Url: https://github.com/thinkdj/ottabase/sessions/3a0cb30f-9fa3-4884-8215-16082520cfbd --- .../components/ConfigPanel.tsx | 6 ++---- .../components/ThemePresetSwitcher.tsx | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/ottabase-template-app-nextjs-homepage/components/ConfigPanel.tsx b/apps/ottabase-template-app-nextjs-homepage/components/ConfigPanel.tsx index a91c53a8a..9bea1761a 100644 --- a/apps/ottabase-template-app-nextjs-homepage/components/ConfigPanel.tsx +++ b/apps/ottabase-template-app-nextjs-homepage/components/ConfigPanel.tsx @@ -107,12 +107,10 @@ export function ConfigPanel() { diff --git a/apps/ottabase-template-app-nextjs-homepage/components/ThemePresetSwitcher.tsx b/apps/ottabase-template-app-nextjs-homepage/components/ThemePresetSwitcher.tsx index 6ee2ca018..090b11991 100644 --- a/apps/ottabase-template-app-nextjs-homepage/components/ThemePresetSwitcher.tsx +++ b/apps/ottabase-template-app-nextjs-homepage/components/ThemePresetSwitcher.tsx @@ -124,13 +124,13 @@ export function ThemePresetSwitcher({ onSwitch }: ThemePresetSwitcherProps = {}) }`} > {/* Color swatches — compact row */} -
+{['primary', 'secondary', 'accent'].map((token) => { const hsl = presetColors?.[token]; return ( Date: Mon, 30 Mar 2026 08:41:19 +0000 Subject: [PATCH 09/10] feat: improve HeroMinimal sizing, config panel UX with icons and primary tab, add HOMEPAGE_vNEXT.MD roadmap Agent-Logs-Url: https://github.com/thinkdj/ottabase/sessions/53769cb6-592f-4ab6-bac8-012553e84fa6 --- .../HOMEPAGE_vNEXT.MD | 203 ++++++++++++++++++ .../components/ConfigPanel.tsx | 55 ++++- .../components/ThemePresetSwitcher.tsx | 18 +- .../components/variants/hero/HeroMinimal.tsx | 16 +- 4 files changed, 267 insertions(+), 25 deletions(-) create mode 100644 apps/ottabase-template-app-nextjs-homepage/HOMEPAGE_vNEXT.MD diff --git a/apps/ottabase-template-app-nextjs-homepage/HOMEPAGE_vNEXT.MD b/apps/ottabase-template-app-nextjs-homepage/HOMEPAGE_vNEXT.MD new file mode 100644 index 000000000..8d739d383 --- /dev/null +++ b/apps/ottabase-template-app-nextjs-homepage/HOMEPAGE_vNEXT.MD @@ -0,0 +1,203 @@ +# Homepage vNEXT — Roadmap + +> Roadmap for the Next.js homepage template: deep integration with the Ottabase core framework and feature enhancements for the dynamic, slot-based homepage system. + +--- + +## 1. Core Framework Integration + +### 1.1 Database-Backed Content (OttaORM + D1) + +**Goal:** Store homepage section content in Cloudflare D1 so that all slots (hero, features, CTA, about, etc.) render from a single source of truth — edit once, render any way you want. + +- [ ] Add Cloudflare D1 binding to `wrangler.jsonc` and `cloudflare-env.d.ts` +- [ ] Create `HomepageSection` model using OttaORM `BaseModel`: + ```typescript + // Schema: id, sectionType (hero|features|cta|about), contentJson, sortOrder, isActive, createdAt, updatedAt + export class HomepageSection extends BaseModel { + static entity = 'homepage_sections'; + static table = homepageSectionsTable; + } + ``` +- [ ] Create `HomepageFeature` model for the features list (title, description, icon, sortOrder) +- [ ] Create `HomepageAction` model for CTA buttons (label, href, variant, isExternal) +- [ ] Wire models into `db-utils.ts` and register in `schemas-helper.ts` for auto-migration +- [ ] Create API routes: `GET /api/homepage/sections`, `PATCH /api/homepage/sections/:id` +- [ ] Refactor `SlotRenderer` to accept data from DB queries (SSR via `fetch()` in server components) while falling back to static defaults when no DB is configured +- [ ] Add seed script to populate initial content matching current static data + +### 1.2 Brand Engine Persistence + +**Goal:** Save the active theme preset and slot variant selections in the database so configuration survives across browsers and can be managed by admins. + +- [ ] Use `@ottabase/brand-engine/persistence` (`BrandKit`, `LayoutTemplate`, `MenuSlotAssignment`) models +- [ ] Store active theme preset + slot config in `BrandKit` table instead of (or in addition to) localStorage +- [ ] Add admin endpoint: `POST /api/brand/homepage-config` to save config +- [ ] ConfigPanel reads from DB on mount (with localStorage as cache/fallback) +- [ ] Multi-tenant support: different orgs can have different homepage configs + +### 1.3 Authentication Integration + +**Goal:** Add optional auth so that admins can edit homepage content via an inline editing UI. + +- [ ] Wire `@ottabase/auth` with D1 adapter into the homepage worker +- [ ] Add optional login/signup button in navbar (hidden when auth is not configured) +- [ ] Create `AdminGuard` wrapper that shows edit controls only when authenticated as admin +- [ ] Inline edit mode: click-to-edit hero text, feature cards, CTA copy — saves to DB via OttaORM +- [ ] Role check via `@ottabase/rbac` for admin-only editing permissions + +### 1.4 Media & File Uploads + +**Goal:** Allow hero images, feature icons, and logo to be uploaded and served from Cloudflare R2. + +- [ ] Add R2 binding for asset storage +- [ ] Integrate `@ottabase/ottaupload` for drag-and-drop image upload in admin mode +- [ ] Store media references in `@ottabase/medialibrary` `Media` model +- [ ] Hero variants can render a dynamic background image from R2 +- [ ] Feature cards support uploaded icons/illustrations + +### 1.5 Blog Integration + +**Goal:** Surface recent blog posts on the homepage as a dynamic section. + +- [ ] Add a `blog` slot with variants: `BlogLatest` (3-card grid), `BlogFeatured` (single spotlight), `BlogList` (compact list) +- [ ] Fetch posts from `@ottabase/ottablog` `Post` model via API: `GET /api/ottaorm/posts?limit=3&orderBy=createdAt` +- [ ] Link to full blog powered by ottablog package +- [ ] Support draft/published filtering, tag-based filtering + +### 1.6 Analytics & Tracking + +**Goal:** Track page views and section engagement using Cloudflare Analytics Engine. + +- [ ] Integrate `@ottabase/analytics` for page-view tracking +- [ ] Add section-level visibility tracking (which hero/features/CTA variants get more engagement) +- [ ] Dashboard widget showing homepage analytics in admin panel +- [ ] A/B testing support: randomly assign visitors to different slot variants and track conversion + +### 1.7 Email & Newsletter + +**Goal:** Add a newsletter signup component as a homepage slot. + +- [ ] Create `newsletter` slot with variants: inline form, modal popup, footer-embedded +- [ ] Integrate `@ottabase/email` for sending confirmation emails +- [ ] Store subscribers in a `NewsletterSubscriber` OttaORM model +- [ ] Double opt-in flow with verification token + +### 1.8 Comments & Feedback + +**Goal:** Allow visitors to leave feedback or testimonials. + +- [ ] Create `testimonials` slot using `@ottabase/comments` for user-submitted reviews +- [ ] Admin moderation panel for approving/rejecting testimonials +- [ ] Display approved testimonials in a carousel or grid variant + +### 1.9 Real-Time Updates + +**Goal:** Push live content updates to visitors without page reload. + +- [ ] Integrate `@ottabase/cf-realtime` WebSocket pub/sub +- [ ] Admin edits to homepage content broadcast live to connected visitors +- [ ] Live visitor count display (optional widget) + +--- + +## 2. Feature Enhancements + +### 2.1 New Slot Types + +- [ ] **Pricing** — pricing table with tiers (Free, Pro, Enterprise) and feature comparison +- [ ] **FAQ** — accordion-based frequently asked questions section +- [ ] **Team** — team member cards with photos, roles, and social links +- [ ] **Testimonials** — customer quotes in carousel, grid, or marquee layouts +- [ ] **Stats/Metrics** — animated counters showing key numbers (users, uptime, etc.) +- [ ] **Integrations/Partners** — logo cloud with partner/integration badges +- [ ] **Changelog** — recent updates feed (could pull from `ChangelogEntry` model) +- [ ] **Contact** — contact form with email integration via `@ottabase/email` +- [ ] **Blog Preview** — latest posts section (see §1.5) +- [ ] **Newsletter** — email signup section (see §1.7) + +### 2.2 Enhanced Config Panel UX + +- [ ] Drag-and-drop slot reordering (change section order on the homepage) +- [ ] Live preview thumbnails for each variant option +- [ ] Import/export config as JSON for sharing configurations +- [ ] Undo/redo for config changes +- [ ] Preset homepage layouts (e.g., "SaaS Landing", "Developer Docs", "Portfolio") +- [ ] Section visibility toggle (show/hide individual slots without removing them) + +### 2.3 Animation & Transitions + +- [ ] Scroll-triggered fade-in animations for each section +- [ ] Smooth section transitions when switching variants in the config panel +- [ ] Parallax effects for hero backgrounds +- [ ] Animated number counters for stats sections +- [ ] Page transition animations between routes + +### 2.4 SEO & Performance + +- [ ] Dynamic `` tags and Open Graph data from DB content +- [ ] JSON-LD structured data for homepage sections +- [ ] Automatic sitemap generation including dynamic pages +- [ ] Image optimization pipeline (WebP/AVIF via Cloudflare Images) +- [ ] Critical CSS extraction per active variant combination +- [ ] Lighthouse CI integration for automated performance monitoring + +### 2.5 Internationalization (i18n) + +- [ ] Multi-language support for all homepage content +- [ ] Language switcher in navbar +- [ ] DB-backed translations per section and locale +- [ ] RTL layout support +- [ ] Automatic browser locale detection + +### 2.6 Multi-Page Support + +- [ ] Extend slot system to arbitrary pages (not just homepage + about) +- [ ] Page builder: create new pages with drag-and-drop slot composition +- [ ] Dynamic routes from DB: `/pages/:slug` renders slot-composed pages +- [ ] Navigation auto-generated from page registry + +### 2.7 Developer Experience + +- [ ] CLI command: `pnpm ottabase homepage:seed` to populate DB with sample content +- [ ] CLI command: `pnpm ottabase homepage:export` to export current config +- [ ] Storybook stories for every slot variant (visual documentation) +- [ ] Variant development mode: hot-reload preview of variant changes +- [ ] TypeScript codegen for slot data types from DB schema + +### 2.8 Deployment & Multi-Tenancy + +- [ ] Per-tenant homepage configuration (different orgs get different homepages) +- [ ] Custom domain mapping per tenant homepage +- [ ] Preview deployments with config snapshots +- [ ] Staging/production config promotion workflow +- [ ] Config versioning with rollback support + +--- + +## Priority Tiers + +### Tier 1 — Foundation (Do First) +1. §1.1 Database-backed content (OttaORM models for sections) +2. §1.2 Brand engine persistence (save config to DB) +3. §2.2 Enhanced config panel (reorder, show/hide, presets) +4. §2.1 New slots: Pricing, FAQ, Testimonials + +### Tier 2 — Growth +5. §1.3 Authentication + inline editing +6. §1.5 Blog integration +7. §1.4 Media uploads (R2) +8. §2.4 SEO and performance +9. §2.3 Animations + +### Tier 3 — Scale +10. §1.6 Analytics and A/B testing +11. §1.7 Newsletter integration +12. §2.5 Internationalization +13. §2.6 Multi-page support +14. §2.8 Multi-tenancy + +### Tier 4 — Polish +15. §1.8 Comments and testimonials from users +16. §1.9 Real-time updates +17. §2.7 Developer experience tooling diff --git a/apps/ottabase-template-app-nextjs-homepage/components/ConfigPanel.tsx b/apps/ottabase-template-app-nextjs-homepage/components/ConfigPanel.tsx index 9bea1761a..7a32957f1 100644 --- a/apps/ottabase-template-app-nextjs-homepage/components/ConfigPanel.tsx +++ b/apps/ottabase-template-app-nextjs-homepage/components/ConfigPanel.tsx @@ -9,13 +9,36 @@ * - Defaults to visible when `NODE_ENV !== 'production'` */ -import { ChevronLeft, ChevronRight, RotateCcw, X } from 'lucide-react'; +import { + ChevronLeft, + ChevronRight, + FileText, + Grid3X3, + Layout, + Megaphone, + Navigation, + Palette, + Rows3, + RotateCcw, + Sparkles, + X, +} from 'lucide-react'; import { useCallback, useEffect, useState } from 'react'; import { useHomepageConfig } from '../lib/homepage-config-context'; import { SLOT_NAMES, SLOT_REGISTRY } from '../lib/homepage-config'; import type { SlotName } from '../lib/homepage-config'; import { ThemePresetSwitcher } from './ThemePresetSwitcher'; +/** Icons mapped to each slot for visual scannability in the config panel. */ +const SLOT_ICONS: Record> = { + navbar: Navigation, + hero: Sparkles, + features: Grid3X3, + cta: Megaphone, + footer: Rows3, + about: FileText, +}; + /** Check if the config panel should be shown based on env vars. */ function shouldShowPanel(): boolean { const envFlag = process.env.NEXT_PUBLIC_SHOW_CONFIG_PANEL; @@ -59,7 +82,10 @@ export function ConfigPanel() { > {/* Panel header */} -- {/* Sleek pull-out tab — right edge, vertically centered */} + {/* Sleek pull-out tab — right edge, vertically centered, primary colour */}Configurator
+++ Configurator
+