feat: Theme Marketplace & Theme Editor as Next.js multi-zone apps#320
Draft
feat: Theme Marketplace & Theme Editor as Next.js multi-zone apps#320
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Prisma: Add MarketplaceTheme, ThemeInstallation, ThemeRating models + ThemeCategory/ThemeStatus enums - types.ts: Add ThemeCategory, MarketplaceThemeMeta types; extend ThemeTemplateId with 8 new themes - theme-templates.ts: 8 new categorised themes (TechNova, FashionForward, CafeBistro, GlowUp, HomeVibes, SportZone, JewelBox, Bookshelf) - API: /api/marketplace/themes (GET list), /[id] (GET detail), /[id]/install (POST), /[id]/rate (POST) - apps/theme-marketplace/: Full Next.js zone (basePath /themes) with gallery, filters, detail page - apps/theme-editor/: Full Next.js zone (basePath /themes/editor) with live preview, sidebar (colors/typography/layout/CSS) - next.config.ts: Multi-zone rewrites for /themes/* and /themes/editor/* - Appearance page: Add Theme Marketplace & Theme Editor buttons - theme-marketplace-panel.tsx: Add 8 new themes to helper functions + Full Marketplace link Co-authored-by: rezwana-karim <126201034+rezwana-karim@users.noreply.github.com>
- Add MOCK_DOWNLOAD_COUNTS/MOCK_AVERAGE_RATINGS named constants - Type themeConfig as ThemeSettings (not object) in install route - Fix NEXT_PUBLIC_MAIN_APP_URL fallback to 'http://localhost:3000' in zone clients - Extract headingFontSize calculation variable in typography preview - Use radiusClasses object lookup instead of nested ternaries - Remove redundant type assertions in editor page (StorefrontDraft.theme properly typed) - Add Prisma migration SQL for MarketplaceTheme/ThemeInstallation/ThemeRating - Add prisma/seed-marketplace.mjs for seeding 14 themes - Add docs/MULTI_ZONE_SETUP.md with setup guide Co-authored-by: rezwana-karim <126201034+rezwana-karim@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add theme picker and editor for storefront marketplace
feat: Theme Marketplace & Theme Editor as Next.js multi-zone apps
Mar 5, 2026
|
Automated review (GitHub Models): All major features, files, and architectural changes described in the PR are present in the repository, strongly suggesting this PR has already been merged or its contents implemented. Confidence: 0.98 Evidence:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a fully functional Theme Marketplace and Theme Editor as separate Next.js zone apps, routed from the main StormCom app via multi-zone rewrites. Store owners can browse categorised themes, install them to their storefront, and customise every visual token with live preview before publishing.
Multi-Zone Architecture
Zone URLs are configurable via
THEME_MARKETPLACE_URL/THEME_EDITOR_URLenv vars.Changes
Database (
prisma/schema.prisma)MarketplaceTheme— theme catalog with config (JSON), category, tags, ratings, download countThemeInstallation— tracks per-store installsThemeRating— star ratings + optional reviewsThemeCategory/ThemeStatusenumsprisma/migrations/20260305000000_add_theme_marketplace/prisma/seed-marketplace.mjs(14 themes)Theme Templates (
src/lib/storefront/theme-templates.ts)Expanded from 6 → 14 templates; 8 new industry-specific themes:
tech-novafashion-forwardcafe-bistroglow-uphome-vibessport-zonejewel-boxbookshelfMarketplace API (
src/app/api/marketplace/themes/)GET /api/marketplace/themes— paginated list withcategory,q,sort,storeIdparams; falls back to static templates when DB is emptyGET /api/marketplace/themes/:id— detailPOST /api/marketplace/themes/:id/install— applies theme as storefront draft, increments download count, records installation; requires OWNER/ADMIN/CONTENT_MANAGER accessPOST /api/marketplace/themes/:id/rate— upserts rating, recalculates aggregateTheme Marketplace Zone (
apps/theme-marketplace/)Theme Editor Zone (
apps/theme-editor/)Full-screen split editor — sidebar + live
<iframe>preview. Changes are pushed to the preview frame viapostMessageon every keystroke/slider move.Auto-saves draft after 2 s inactivity via
PUT /api/stores/:id/storefront/draft. Publish button writes draft to live config.Main App / Dashboard
next.config.ts: added multi-zonerewrites()(editor rule before marketplace to avoid prefix collision)tsconfig.json: addedapps/toexcludeto prevent zone files from being type-checked in the main compilationThemeMarketplacePanel: updated helper maps for 14 theme IDs; added Full Marketplace ↗ external linkDocs
docs/MULTI_ZONE_SETUP.md— local dev setup, env vars, DB migration, Vercel deployment guide💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.