Skip to content

Demo of AI-powered guided tours for React and Next.js apps. Wrap any UI element, and an AI assistant guides users step-by-step to the right features, no component rewr…

Notifications You must be signed in to change notification settings

eventop-s/demo-app

Repository files navigation

Eventop Demo - Cleaned Architecture

1. Proper Next.js App Router Structure

app/
├── page.tsx              # Redirects to /dashboard
├── layout.tsx            # Root layout with Nav + TourStatusBar
├── dashboard/page.tsx    # Dashboard route
├── canvas/page.tsx       # Canvas route
├── templates/page.tsx    # Templates route
└── api/guide/route.ts    # API endpoint

2. Component Organization

components/
├── ui.tsx                      # Reusable UI primitives
├── nav.tsx                     # Top navigation
├── TourStatusBar.tsx           # Tour status indicator
├── eventop-provider.tsx        # Eventop SDK provider
├── dashboard/
│   ├── stats-row.tsx
│   ├── project-grid.tsx
│   └── team-section.tsx
├── canvas/
│   ├── canvas-toolbar.tsx
│   ├── canvas-stage.tsx
│   ├── effects-panel.tsx
│   ├── shadow-controls.tsx
│   └── export-panel.tsx
└── templates/
    └── template-grid.tsx

3. Better TypeScript

  • Added proper type definitions for all props
  • Used as const for immutable arrays
  • Improved type safety throughout

4. Code Quality Improvements

  • Consistent naming: All files use kebab-case
  • Better state management: Used functional updates (prev => !prev)
  • Improved handlers: Named functions instead of inline arrows
  • Added validation: Email validation in team invite
  • Error handling: Try-catch in API route
  • Accessibility: Added ARIA attributes to interactive elements

5. Removed Code Smells

  • ❌ No more client-side routing state
  • ❌ No more duplicate component definitions
  • ❌ No more inconsistent prop passing
  • ✅ Single source of truth for routes
  • ✅ Proper separation of concerns
  • ✅ Consistent component patterns

Project Structure

eventop-demo/
├── app/
│   ├── api/guide/route.ts       # Anthropic API proxy
│   ├── canvas/page.tsx          # Canvas editor
│   ├── dashboard/page.tsx       # Dashboard home
│   ├── templates/page.tsx       # Template selector
│   ├── layout.tsx               # Root layout
│   ├── page.tsx                 # Redirect to dashboard
│   └── globals.css              # Global styles
├── components/
│   ├── canvas/                  # Canvas-related components
│   ├── dashboard/               # Dashboard components
│   ├── templates/               # Template components
│   ├── eventop-provider.tsx     # SDK provider
│   ├── nav.tsx                  # Navigation
│   ├── TourStatusBar.tsx        # Tour indicator
│   └── ui.tsx                   # UI primitives
└── package.json

Key Features Preserved

Multi-step tours with EventopStepDual registration (Effects button is both standalone + step) ✅ Async validation in team invite ✅ Cross-component flows (drop-shadow spans multiple components) ✅ Navigation handling via Next.js router ✅ All Eventop SDK features working as intended

Running the App

npm install
npm run dev

Then navigate to http://localhost:3000 — you'll be redirected to /dashboard.

Environment Variables

GEMINI_API_KEY=your_key_here

Next Steps

  1. Add loading states for API calls
  2. Implement actual export functionality
  3. Add error boundaries
  4. Add analytics tracking
  5. Create E2E tests for tour flows

About

Demo of AI-powered guided tours for React and Next.js apps. Wrap any UI element, and an AI assistant guides users step-by-step to the right features, no component rewr…

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published