Skip to content

Full-featured email marketing & landing page platform prototype with broadcasts, A/B testing, and analytics simulation

Notifications You must be signed in to change notification settings

rostwal95/kit-next-variant

Repository files navigation

Kit Builders β€” Creator Publishing Platform


Next.js React TypeScript Tailwind CSS Zustand Tiptap

Email Marketing & Landing Page Platform Prototype

Client-side demonstration of creator publishing workflows with broadcasts, A/B testing, and analytics simulation

Dashboard Preview

Click to view demo video


πŸ“‹ Table of Contents

πŸš€ Introduction

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.

βš™οΈ Tech Stack

Frontend (Client-Side Only)

  • 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

Storage & Persistence

  • localStorage – Draft storage, published snapshots, event logs
  • Zustand Persist – State hydration and synchronization

Development Tools

  • pnpm – Fast, disk-efficient package manager
  • ESLint – Code linting with Next.js configuration
  • PostCSS – CSS processing for Tailwind

⚑ Features

πŸ“§ Email Broadcasting

  • 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

🎨 Landing Page Builder

  • 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

πŸ” Event Simulation & Analytics

  • 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

🎯 Dashboard

  • 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

🎨 Design System

  • 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

πŸš€ Quick Start

Prerequisites

Ensure you have these installed:

  • Node.js 18+
  • pnpm (enable with corepack enable)

Local Development

# 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 dev

Visit http://localhost:3000 β†’ Auto-redirects to /dashboard

Available Scripts

# 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

First Steps After Launch

  1. Dashboard (/dashboard) – View metrics and start simulation
  2. Landing Page (/page) – Select a template and customize
  3. Email Designer (/builder/email/demo) – Compose a broadcast
  4. Published Page (/builder/page/demo) – Publish and view live snapshot

πŸ—οΈ Architecture

High-Level Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          Next.js Frontend               β”‚
β”‚       (Client-Side Rendering)           β”‚
β”‚                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   Pages/     β”‚    β”‚  Components/ β”‚   β”‚
β”‚  β”‚   Routes     │◄────   UI Layer   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚         β”‚                               β”‚
β”‚         β–Ό                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   Zustand    │◄────  lib/utils   β”‚   β”‚
β”‚  β”‚   Store      β”‚    β”‚  (helpers)   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚         β”‚                               β”‚
β”‚         β–Ό                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚      localStorage                β”‚   β”‚
β”‚  β”‚  (Drafts, Snapshots, History)    β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow Examples

1. Landing Page Publish Flow

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

2. Email Subject A/B Testing

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

3. Event Simulation Flow

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)

πŸ“ Project Structure

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

πŸ› οΈ Development Guide

State Management

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

⚠️ Known Limitations

Architecture & Design

  • ❌ 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

Security

  • ❌ No input sanitization – XSS vulnerable in email preview
  • ❌ No CSRF protection – Client-side only
  • ❌ HTML injection risk – dangerouslySetInnerHTML used in preview
  • ❌ No content security policy
  • ❌ localStorage exposed – All data readable in DevTools

Data & Persistence

  • ❌ 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

Features

  • ⚠️ 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

Performance

  • ⚠️ 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

Testing

  • ❌ 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

Observability

  • ❌ No error tracking – No Sentry/Rollbar
  • ❌ No analytics – PostHog stub only
  • ❌ No logging – Console only
  • ❌ No monitoring – No health checks

Compliance

  • ❌ 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

⚠️ Prototype Disclaimer

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


About

Full-featured email marketing & landing page platform prototype with broadcasts, A/B testing, and analytics simulation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published