Skip to content

Development Workflow

Available Commands

CommandDescription
npm run devStart development server with HMR
npm run buildBuild for production
npm run previewPreview production build locally
npm run postinstallRun nuxt prepare (generates types)
npm testRun tests in watch mode
npm run test:runSingle test run
npm run test:coverageGenerate coverage report
npm run test:uiOpen Vitest UI dashboard
npm run docs:devStart documentation site
npm run docs:buildBuild documentation for production

Development Server

bash
npm run dev

The Nuxt development server starts at http://localhost:3000 with:

  • Hot Module Replacement (HMR) — Changes reflect instantly
  • Auto-imports — Components, composables, and utilities are auto-imported
  • DevTools — Nuxt DevTools available for debugging

Dev Auth Bypass

For rapid local development without configuring Supabase Auth:

ini
NUXT_PUBLIC_DEV_AUTH_BYPASS=true

When enabled:

  • Authentication middleware is skipped
  • A mock user session is created automatically
  • All RLS policies are bypassed (client-side only; server routes still use the service role)

WARNING

Never enable this in production. It completely disables authentication.

Testing

PIP AI uses Vitest for testing with happy-dom as the test environment.

Running Tests

bash
# Watch mode (re-runs on changes)
npm test

# Single run
npm run test:run

# With coverage report
npm run test:coverage

# Interactive UI
npm run test:ui

Test Structure

Tests are located in tests/ and follow the pattern *.test.ts:

tests/
├── setup.ts           # Global test setup
├── composables/       # Composable tests
└── ...

Mocking Supabase

Tests mock the Supabase client. See tests/setup.ts for the global mock configuration.

Code Style

  • Vue 3 Composition API with <script setup> syntax
  • TypeScript throughout
  • Tailwind CSS for styling
  • Auto-imported composables from app/composables/
  • Auto-imported stores from app/stores/
  • Components auto-imported from app/components/

Branch Strategy

  • main — Production-ready code
  • Feature branches — feature/description or fix/description

Building for Production

bash
npm run build

This generates a production build in .output/. Preview it locally:

bash
npm run preview

Built with VitePress