Skip to main content
userTourKit
Examples

Dashboard (full integration)

Reference example exercising every @tour-kit/* package in one Next.js 16 + React 19 + Tailwind v4 + shadcn/ui app.

domidex01Published

examples/dashboard-next/ is the canonical, end-to-end integration of the entire Tour Kit suite. It's a small team-workspace dashboard ("Stacks") with an onboarding tour, hints, announcements, a checklist, adoption nudges, CSAT surveys, and an AI help panel — every package wired into realistic product surfaces.

Why this example exists

Unit tests catch bugs inside a package. They don't catch the class of bugs that appear when eight providers stack together and every headless component is mounted at once — the "works in isolation, breaks in integration" failures. Tour Kit caught four such regressions (see Troubleshooting) only because this demo was built against real packages. It's the required pre-release smoke test.

Run it

git clone https://github.com/domidex01/tour-kit
cd tour-kit
pnpm install
pnpm --filter dashboard-next dev

Open http://localhost:3000. License validation bypasses localhost, so no keys are needed in dev.

Stack

  • Next.js 16.2 (App Router, Turbopack)
  • React 19.2
  • Tailwind CSS v4
  • shadcn/ui on @base-ui/react
  • All 11 @tour-kit/* packages via workspace:*

Provider stack

Peel the onion in app/providers.tsx:

LicenseProvider
└── AnalyticsProvider (console plugin)
    └── HintsProvider
        └── AnnouncementsProvider
            └── ChecklistProvider
                └── AdoptionProvider
                    └── SurveysProvider
                        └── AiChatProvider

Package map

PackageFileWhat it does here
@tour-kit/licenseapp/providers.tsx, app/dashboard/settings/page.tsxWraps the app; Settings → Billing gates Pro controls behind <LicenseGate>.
@tour-kit/analyticsapp/providers.tsxconsolePlugin streams every event (tour/hint/announcement/checklist/adoption) to the browser console.
@tour-kit/reactcomponents/tour-kit/onboarding-tour.tsx5-step dashboard tour using <Tour autoStart> + <TourStep>. onComplete fires the CSAT survey.
@tour-kit/hintscomponents/tour-kit/hints.tsxDarkModeHint on #dark-mode-toggle; ExportHint on #export-btn.
@tour-kit/announcementslib/tour-kit-config.ts, components/tour-kit/announcements-host.tsxWelcome modal (with <TourMedia>), maintenance banner (Pro audience + business-hours schedule), AI-live toast.
@tour-kit/checklistslib/tour-kit-config.ts, components/tour-kit/checklist-dock.tsx4-item "Get started" checklist with auto-completion via DOM events.
@tour-kit/adoptionlib/tour-kit-config.ts, app/dashboard/projects/[id]/page.tsxTracks dark-mode, keyboard-shortcuts, export-csv. <NewFeatureBadge> fades after use.
@tour-kit/mediacomponents/tour-kit/announcements-host.tsx<TourMedia> with a YouTube URL inside the welcome modal.
@tour-kit/schedulingcomponents/tour-kit/scheduled-banner.tsxuseSchedule gates the maintenance banner to business hours.
@tour-kit/surveyslib/tour-kit-config.ts, components/tour-kit/csat-survey-host.tsxCSAT modal on tour completion, 90-day cooldown.
@tour-kit/aiapp/api/chat/route.ts, app/dashboard/help/page.tsxcreateChatRouteHandler + <AiChatPanel> with tourContext: true.

What to look at

  • lib/tour-kit-config.ts — the only "config" file. Every package reads from it.
  • app/providers.tsx — the full provider stack.
  • app/dashboard/layout.tsx — where Tour Kit's visible surfaces mount (<OnboardingTour>, <AnnouncementsHost>, <ChecklistDock>, <DarkModeHint>, <CsatSurveyHost>).

Once Tour Kit 0.4.3 / 0.1.5 is released, this example is the reference for how to wire the suite correctly. Earlier demo versions worked around four bugs; those workarounds are removed and called out in the example's README.

Known limitation

Production next build currently fails on the synthetic /_global-error and /_not-found prerender step with TypeError: Cannot read properties of null (reading 'useContext'). This reproduces on the upstream demo too and appears to be a Next 16.2 + React 19.2 + Turbopack SSR quirk unrelated to Tour Kit. pnpm dev and pnpm typecheck both work; use dev mode for integration testing until upstream lands a fix.