- Introduction
- Tech Stack
- Features
- Quick Start
- Architecture
- Project Structure
- Development Guide
- Known Limitations
This is a client-side prototype for a creator publishing platform, containing 40+ components built to demonstrate complete workflows for email marketing, landing page creation, and experimentation.
Kit Builders serves as:
- β Architectural prototype for creator economy platforms
- β Reference implementation for Next.js App Router patterns
- β Demo playground for stakeholder presentations
- β Learning resource for modern front-end patterns
β οΈ Note: This is a prototype/POC, not production-ready. All data is stored in localStorage only β no backend, no database, no authentication. Security hardening, comprehensive testing, and backend integration are intentionally deferred for rapid iteration.
- Next.js 15.5 β React framework with App Router & Server Components
- React 19 β Latest features including enhanced hooks
- TypeScript 5 β Full type safety across the codebase
- Tailwind CSS 4 β Utility-first styling with custom design system
- TipTap v2 β Rich text editor for email/broadcast composition
- Radix UI β Accessible component primitives (Dialog, Tooltip, Popover)
- shadcn/ui β Pre-built components with Radix + Tailwind
- Zustand β Lightweight state management with persist middleware
- Framer Motion β Smooth animations and transitions
- Lucide React β Icon library
- Zod β Runtime validation and type inference
- localStorage β Draft storage, published snapshots, event logs
- Zustand Persist β State hydration and synchronization
- pnpm β Fast, disk-efficient package manager
- ESLint β Code linting with Next.js configuration
- PostCSS β CSS processing for Tailwind
- Rich text editor with TipTap (bold, italic, headings, lists, links, images)
- Subject line editor with:
- Character count and optimal length guidance
- 7 auto-generated subject suggestions (deterministic rotation)
- A/B variant testing with predicted open rates
- Lift calculation between variants
- Preheader field with character count
- Draft auto-save to localStorage
- Spam detection system:
- Keyword-based scoring with weighted triggers
- Severity classification (low/medium/high)
- Inline hint display for risky terms
- Link analysis:
- UTM parameter detection
- Duplicate link identification
- HTTPS security warnings
- Domain extraction
- Merge tag support:
- Popover insertion panel
- Inline
{{autocomplete trigger - 5 built-in tags (first_name, last_name, company, etc.)
- Content snippets:
- CTA button templates
- Email signature
- Divider elements
- Body rewrite variants:
- Concise version (removes filler words)
- Action-oriented close
- Bullet point extraction
- Insert or Replace functionality
- Metrics display:
- Word count and reading time estimation
- Character count
- Link count
- Preview modal with desktop/mobile toggle
- Assistant side panel (collapsible, state persisted)
- Subject history (last 25 saved)
- Floating action bar for Send/Preview/Test
- Template gallery with 4 starter templates:
- Creator Newsletter
- Product Launch
- Free eBook Lead Magnet
- Webinar Registration
- Full-bleed responsive grid (1-4 columns)
- Active template selection with visual glow
- Draft vs Published snapshot system:
- Immutable published versions
- Dirty state detection badge
- Timestamp tracking
- Variant history with labeled snapshots
- Theme accent extraction (synced to email designer)
- Smart headline generation:
- Topic/benefit/tone inputs
- 5 generated variations
- Real-time preview with gradient theming
- Bullet point editing
- CTA customization
- Traffic simulation controls:
- Start/Pause/Resume/Stop
- Speed adjustment (Calm/Normal/Fast)
- Progress bar with tick countdown
- Campaign presets (1h, 24h, launch)
- Synthetic event generation:
- Page views with traffic spikes
- Signup conversion (4-14% rate)
- Email sends
- Event log panel:
- Virtualized rendering for performance
- Incremental load (default 100 events)
- "Load All" / "Collapse" controls
- Persisted visible count
- Timestamp display
- Conversion funnel metrics:
- Page views
- Signups (with conversion %)
- Emails sent
- Sparkline trend visualization
- Goal tracking panel
- Quick action cards (Send Email, Newsletter, Landing Page)
- Focus & goals panel
- Funnel metrics overview
- Event log with real-time updates
- Simulation panel
- Reset/refresh controls
- Layered background system (
--bg,--bg-1,--bg-2,--bg-3) - Glass/blur surfaces with gradient overlays
- Dark mode with high-contrast tokens
- Soft shadows and depth layers
- Gradient text effects
- Accessible focus rings (Radix-based)
- Custom scrollbars
- Smooth animations with reduced motion support
- Responsive typography with clamp scaling
Ensure you have these installed:
- Node.js 18+
- pnpm (enable with
corepack enable)
# 1. Clone the repository
git clone https://github.com/rostwal95/kit-next-variant.git
cd kit-next-variant
# 2. Install dependencies
pnpm install
# 3. Start development server
pnpm devVisit http://localhost:3000 β Auto-redirects to /dashboard
# Development
pnpm dev # Start Next.js dev server (port 3000)
pnpm build # Production build
pnpm start # Start production server
pnpm lint # Run ESLint
# Testing
pnpm typecheck # TypeScript type checking- Dashboard (
/dashboard) β View metrics and start simulation - Landing Page (
/page) β Select a template and customize - Email Designer (
/builder/email/demo) β Compose a broadcast - Published Page (
/builder/page/demo) β Publish and view live snapshot
βββββββββββββββββββββββββββββββββββββββββββ
β Next.js Frontend β
β (Client-Side Rendering) β
β β
β ββββββββββββββββ ββββββββββββββββ β
β β Pages/ β β Components/ β β
β β Routes ββββββ€ UI Layer β β
β ββββββββ¬ββββββββ ββββββββββββββββ β
β β β
β βΌ β
β ββββββββββββββββ ββββββββββββββββ β
β β Zustand ββββββ€ lib/utils β β
β β Store β β (helpers) β β
β ββββββββ¬ββββββββ ββββββββββββββββ β
β β β
β βΌ β
β ββββββββββββββββββββββββββββββββββββ β
β β localStorage β β
β β (Drafts, Snapshots, History) β β
β ββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββ
User edits draft β Draft auto-saved to localStorage
β
User clicks "Publish"
β
Snapshot created with timestamp
β
Appended to snapshotHistory array
β
hasPublished flag set
β
Synthetic views incremented
β
Event logged
User enters Subject A β Open rate predicted (heuristic)
β
User enters Variant B
β
Open rate predicted for B
β
Lift calculated (B - A)
β
Displayed with color-coded indicator
User clicks "Start Simulation" β Timer interval started
β
runTick() fires every N ms
β
Random traffic spike generated
β
Views/signups/emails incremented
β
Event log updated
β
Trends array appended
β
localStorage persisted (Zustand)
kit-next-variant/
βββ src/
β βββ app/
β β βββ dashboard/
β β β βββ page.tsx # Main dashboard with metrics
β β βββ page/
β β β βββ page.tsx # Public landing page viewer
β β βββ builder/
β β β βββ page/[pageId]/
β β β β βββ page.tsx # Landing page editor
β β β βββ email/[emailId]/
β β β βββ page.tsx # Email broadcast designer
β β βββ broadcast/
β β β βββ page.tsx # Broadcast index
β β βββ sequence/
β β β βββ page.tsx # Sequence builder (stub)
β β βββ media/
β β β βββ page.tsx # Media library (stub)
β β βββ publish/
β β β βββ email/[emailId]/route.ts
β β β βββ page/[pageId]/route.ts
β β βββ api/
β β β βββ events/route.ts # Event tracking endpoint
β β β βββ unsplash/route.ts # Image search proxy
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home redirect
β β βββ globals.css # Global styles + design tokens
β β
β βββ components/
β β βββ ui/ # shadcn/ui primitives
β β β βββ button.tsx
β β β βββ card.tsx
β β β βββ input.tsx
β β β βββ dropdown-menu.tsx
β β β βββ tooltip.tsx
β β β βββ badge.tsx
β β β βββ separator.tsx
β β β βββ skeleton.tsx
β β β βββ scroll-area.tsx
β β β βββ tag.tsx
β β βββ CommandPalette.tsx # Global command menu
β β βββ Drawer.tsx # Side drawer component
β β βββ EmptyState.tsx # Placeholder UI
β β βββ EventLogPanel.tsx # Virtualized event log
β β βββ FieldGroup.tsx # Form field wrapper
β β βββ GoalsPanel.tsx # Goal tracking display
β β βββ MetricCard.tsx # Metric card with sparkline
β β βββ OnboardingDrawer.tsx # First-run guide
β β βββ PageHeading.tsx # Page header component
β β βββ RichTextEditor.tsx # Tiptap wrapper
β β βββ SimulationPanel.tsx # Traffic simulation controls
β β βββ Sparkline.tsx # Mini trend chart
β β βββ SplashScreen.tsx # Loading screen
β β βββ ThemeProvider.tsx # Dark mode provider
β β βββ ToastHost.tsx # Toast notification system
β β βββ TopBar.tsx # Global navigation
β β
β βββ lib/
β β βββ editor/
β β β βββ tiptap.tsx # Tiptap editor configuration
β β βββ stores/
β β β βββ useBuilder.ts # Page builder store
β β β βββ useFunnel.ts # Funnel metrics store
β β β βββ useTheme.ts # Theme store
β β βββ analytics.ts # PostHog stub
β β βββ db.ts # Dexie (unused)
β β βββ models.ts # Zod schemas
β β βββ store.ts # Main Zustand store
β β βββ utils.ts # Helper functions
β β βββ validation.ts # Form validation
β β
βββ docs/
β βββ demo-poster.png # Video thumbnail
β βββ demo.mp4 # Demo video
β
βββ design_doc.md # Comprehensive architecture doc
βββ package.json # Dependencies
βββ tsconfig.json # TypeScript config
βββ next.config.mjs # Next.js config
βββ tailwind.config.ts # Tailwind config
βββ postcss.config.mjs # PostCSS config
βββ README.md # This file
Zustand Store (src/lib/store.ts):
// Main store with persist middleware
const useAppStore = create<AppState>()(
persist(
(set, get) => ({
funnel: { views: 0, signups: 0, emailsSent: 0 },
publishedSnapshot: null,
snapshotHistory: [],
log: [],
trends: { views: [], signups: [], emails: [] },
// ... actions
}),
{ name: "kit_app_store", version: 1 }
)
);localStorage Keys:
| Key | Purpose | Max Size |
|---|---|---|
kit_app_store |
Main Zustand state | Unlimited |
kit_email_draft_<emailId> |
Email draft (subject, body) | ~1MB |
kit_email_subject_history_<emailId> |
Saved subject variants | 25 items |
kit_email_assistant_open |
Assistant panel state | Boolean |
kit_draft_page |
Landing page draft | ~100KB |
kit_migrated_v2 |
Migration flag | Boolean |
- β No Backend β All data is localStorage only
- β No Database β Clearing browser storage wipes all data
- β No API β Cannot sync across devices or users
- β Single-user only β No multi-tenancy or collaboration
- β No authentication β Open access to all features
- β No rate limiting β Client-side only
- β No input sanitization β XSS vulnerable in email preview
- β No CSRF protection β Client-side only
- β HTML injection risk β
dangerouslySetInnerHTMLused in preview - β No content security policy
- β localStorage exposed β All data readable in DevTools
- β No soft deletes β Data permanently deleted
- β No data migration strategy β Schema changes break storage
- β No backup/restore β Manual export/import not implemented
- β Storage quota limits β Can hit 5-10MB browser limit
- β No conflict resolution β Last write wins
β οΈ AI features are heuristic β No real LLM integrationβ οΈ Email sending is simulated β Toast notifications onlyβ οΈ Analytics are synthetic β Random event generationβ οΈ Image upload disabled β Base64 only (memory intensive)β οΈ No deliverability checks β DKIM/SPF not validatedβ οΈ No spam testing β Keyword-based scoring onlyβ οΈ No A/B test execution β Predictions only, no real sendingβ οΈ Sequence execution missing β Draft UI only
β οΈ Large event logs slow down β 500 event cap helps but not optimalβ οΈ No pagination β All data loaded at onceβ οΈ No lazy loading β Components rendered immediatelyβ οΈ No service worker β No offline supportβ οΈ No code splitting β Single bundle
- β No unit tests β Zero test coverage
- β No integration tests β Component interactions untested
- β No E2E tests β User flows not verified
- β No accessibility audit β WCAG compliance unknown
- β No performance testing β Metrics not tracked
- β No error tracking β No Sentry/Rollbar
- β No analytics β PostHog stub only
- β No logging β Console only
- β No monitoring β No health checks
- β No GDPR flows β Data deletion not implemented
- β No consent tracking β No cookie banners
- β No data export β DSAR handling missing
- β No audit logs β Changes not tracked
This is a proof-of-concept demonstration. Do not use in production without:
β Backend implementation Β β Security audit Β β Authentication Β β Input sanitization Β β Testing suite
For more details, see design_doc.md