Skip to main content
Skip to content

Last updated on 4 June 2026

Project Structure

This template is a full-stack Next.js App Router application. The public website, authenticated app, API routes, database schema, migrations, email templates, and operational scripts all ship in one repository so buyers can customise the product without stitching separate starters together.

Root Files

  • README.md -- quick start and feature overview.
  • INSTALLATION.md -- local setup, demo database, migrations, seed data, and first run.
  • DEPLOYMENT.md -- production deployment, environment variables, Docker, and hardening.
  • CUSTOMIZATION.md -- branding, copy, theme, legal pages, and buyer replacement checklist.
  • COMPLIANCE.md -- privacy, DSAR, deletion, cookies, GPC, and audit-log scaffold.
  • PROJECT_STRUCTURE.md -- repository map and ownership guide.
  • DESIGN_TOKENS.md -- theme-token and rebrand workflow.
  • ACCESSIBILITY.md -- accessibility baseline and buyer audit checklist.
  • FAQ.md -- common setup, stack, and customisation questions.
  • LICENCE.md -- commercial licence terms.
  • .env.example -- documented environment variable template.
  • docker-compose.demo.yml -- local PostgreSQL demo database.
  • drizzle.config.ts -- Drizzle migration configuration.

Application Code

txt
src/
  app/
    (auth)/          Login, register, reset, magic link, and verification pages
    (dashboard)/     Authenticated app pages
    (marketing)/     Legal and marketing routes
    (storefront)/    Storefront routes when the template includes commerce
    docs/            Buyer-facing documentation routes when included
    api/             Route handlers for auth, account, uploads, webhooks, docs, etc.
    globals.css      Tailwind v4 imports, semantic design tokens, focus styles
    layout.tsx       Root metadata, theme provider, cookie consent, demo banner gate
  components/
    <feature>/       Domain folders such as dashboard, commerce, CRM, content, etc.
    landing/         Marketing page sections
    layout/          Sidebar, header, theme provider, navigation
    ui/              Shared UI primitives
  lib/
    auth/            JWT, refresh sessions, OAuth, password helpers
    db/              Drizzle schema, migrations, seed, cleanup helpers
    email/           Nodemailer transport and transactional templates
    uploads/         Storage drivers and file validation
    site-config.ts   Buyer-facing brand, compliance, contact, and feature config
  services/          Business logic used by pages and API routes
  validators/        Zod schemas for request validation

Route groups and feature folders vary by vertical. Use this tree as a map of the shared shape, then inspect the actual src/app and src/components folders in your template for the domain-specific surfaces.

Database And Migrations

The database layer is PostgreSQL via Drizzle ORM. Schema definitions live in src/lib/db/schema.ts; migrations live under src/lib/db/migrations.

Run migrations with:

bash
pnpm db:migrate

Seed the local demo data with:

bash
pnpm db:seed

Some template editions expose a more specific seed command in package.json. Use the command documented in INSTALLATION.md for the template you are working with.

API Routes

API routes live under src/app/api. They use server-side validation, structured errors, auth/session helpers, rate limiting, and audit logging where applicable. The generated API documentation route is exposed at /api/docs when included by the template.

Branding And Product Identity

Buyer-facing identity is centralised in src/lib/site-config.ts. Start there when changing:

  • product name and brand name
  • legal entity details
  • support, privacy, legal, and security contacts
  • region/compliance toggles
  • API key settings and any local limits exposed by the template config
  • upload provider settings

Marketing copy and dashboard copy may also live in component or content files. Search for the exact text you want to replace before editing structure.

Repository
Loading file tree…