Skip to main content
Here’s the map of your new codebase. This is a single Next.js app (not a monorepo), and everything is organized by what it does, not by file type. Let’s walk through it.

Top-Level Folders

This is your Next.js App Router directory. Everything that has a URL lives here.
  • app/(apps)/ — The main product apps (chat, image studio, voice, etc.)
  • app/auth/ — Auth UI pages (sign-in, reset password, auth errors)
  • app/page.tsx — The signed-in home/dashboard route (/)
  • app/landing/ — The public marketing page
  • app/api/ — Shared API routes (Better Auth, avatars, payments, OG images)
  • app/blog/ — Blog pages
Reusable components organized by what they belong to.
  • components/ui/ — Base UI primitives (buttons, inputs, dialogs)
  • components/landing/ — Marketing page components
  • components/(apps)/ — App-specific UI components
  • components/(ui-components)/ — Shared product UI (auth, payments, blog, alerts, account center)
The brain of your app. Cross-app behavior and integrations live here.
  • lib/ai/ — Model configuration and AI helpers
  • lib/auth/ — Server-side auth helpers
  • lib/db/ — Domain-first database modules + Drizzle client
  • lib/db/schema/ — Database schema (source of truth)
  • lib/actions/ — Server actions
  • lib/config/ — Static registries and app catalogs
  • lib/payments/ — Provider-agnostic billing logic
  • lib/analytics/ — Product analytics and event tracking
  • lib/email/ — Contact sync
  • lib/storage/ — Object storage
  • lib/rag/ — Document chunking, embeddings, retrieval, and citations
  • lib/shared/ — Small cross-domain helpers (formatting, cookies, etc.)
  • lib/integrations/ — Thin vendor SDK wrappers
  • lib/observability/ — Sentry and monitoring adapters
Generated and custom SQL migration files. This is the migration history for your database — don’t edit generated files by hand.
MDX blog posts that power the content collections blog pipeline.
  • docs/public/ — The Mintlify docs site (what you’re reading now!)
  • docs/architecture/ — Internal implementation notes for maintainers

The Marketing + Product Split

Your repo contains both the public-facing marketing site and the signed-in product in one place. Here’s how they stay separate:

Marketing

app/landing/ and components/landing/

Product Apps

app/(apps)/ and components/(apps)/

Shared Infra

lib/ for everything both sides need
This split is great because you can work on “sell the product” and “use the product” without the code getting tangled together.

Product Apps Included

Your app ships with these product surfaces:
  • Chat — AI chat with optional PDF/document context
  • Marketing Plan — AI-powered marketing plan generator
  • Launch Simulator — Simulate a product launch
  • Image Studio — AI image generation
  • Video Studio — AI video generation
  • Voice Studio — AI voice synthesis
  • Audio — Audio transcription and processing
  • Vision — Image analysis and understanding
  • Dashboard — Account center, credits, and billing

Where to Start Exploring

New to the codebase? Start with these folders to build your mental model:
  • /app/(apps)/chat — The flagship AI app, great for understanding the full pattern
  • /lib/ai — How models and providers are configured
  • /lib/rag — How document chat works
  • /components/landing — How the marketing site is built
  • /lib/payments — How billing works