Skip to content

Repository files navigation

Website Intelligence Platform

Phase 1 establishes the project foundation for the first complete loop:

Demo Next.js website -> browser SDK -> ingestion API -> PostgreSQL/Prisma -> dashboard.

This does not implement the full SaaS, AI explanations, billing, auth, queues, or large-scale analytics stores.

Structure

  • apps/dashboard - Next.js dashboard shell for future analytics views.
  • apps/api - Next.js API surface for event ingestion.
  • apps/demo-nextjs - Demo Next.js website wired to the browser SDK.
  • packages/event-schema - Zod schemas and TypeScript event contracts.
  • packages/sdk - Browser SDK boundary for collecting and sending events.
  • packages/ui - Shared React UI primitives.
  • prisma - PostgreSQL data model and initial migration.
  • tests - Foundation tests for shared event validation.
  • docs - Phase notes and implementation boundaries.

Run

  1. Install dependencies:
npm install
  1. Copy environment values:
cp .env.example .env
  1. Start PostgreSQL with Docker:
docker compose up -d postgres
  1. Generate Prisma client and apply the initial migration:
npm run prisma:generate
npm run prisma:migrate

If Prisma's Windows migration engine is blocked locally, apply the same schema SQL with:

npm run db:apply
  1. Start all apps:
npm run dev

By default, the apps are configured for:

  • Dashboard: http://localhost:3000
  • API: http://localhost:3001
  • Demo site: http://localhost:3002

Checks

npm run typecheck
npm test

Demo Flow

  1. Open the dashboard at http://localhost:3000.
  2. Open the demo site at http://localhost:3002.
  3. Click the CTA, focus the email field, and submit the form.
  4. Refresh the dashboard to see live event, visitor, session, and conversion counts.

Check stored database totals with:

npm run db:status

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages