Development Workflow
Available Commands
| Command | Description |
|---|---|
npm run dev | Start development server with HMR |
npm run build | Build for production |
npm run preview | Preview production build locally |
npm run postinstall | Run nuxt prepare (generates types) |
npm test | Run tests in watch mode |
npm run test:run | Single test run |
npm run test:coverage | Generate coverage report |
npm run test:ui | Open Vitest UI dashboard |
npm run docs:dev | Start documentation site |
npm run docs:build | Build documentation for production |
Development Server
bash
npm run devThe 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=trueWhen 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:uiTest 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/descriptionorfix/description
Building for Production
bash
npm run buildThis generates a production build in .output/. Preview it locally:
bash
npm run preview