Skip to main content
Understanding the project structure helps you navigate and customize the starter template.

Directory Overview


Key Directories

/app - Pages and API Routes

The app/ directory uses Next.js App Router conventions:
  • page.tsx files define route pages
  • layout.tsx files define shared layouts
  • api/ contains server-side API route handlers

/components - Reusable Components

Components are organized by scope:
  • Root level: App-wide components (Header, TTAIIframe)
  • auth/: Authentication-related components
  • ui/: shadcn/ui primitive components

/lib - Utilities and Configuration

Core application logic:
  • config.ts: Centralized environment variables
  • constants.ts: App-wide constants and MBTI data
  • store.ts: Zustand state management
  • ttai/: ToughTongue AI integration module

Key Files Explained

lib/config.ts

Centralizes all environment configuration:

lib/constants.ts

Contains routes and static data:

lib/store.ts

Zustand store with localStorage persistence:

lib/ttai/

ToughTongue integration module - see ToughTongue Integration.

Adding New Features

Adding a New Page

  1. Create directory in app/:
  1. Add route to lib/constants.ts:
  1. Add navigation link in components/Header.tsx

Adding a New Component

  • Shared component: Add to components/
  • Feature-specific: Keep in the feature’s directory
  • UI primitive: Add to components/ui/ using shadcn/ui patterns

Adding a New API Route

Create route handler in app/api/:

Next Steps

ToughTongue Integration

Learn the integration patterns

State & Auth

State management and authentication