Skip to content

Frontend ​

The UI is Vue 3, TypeScript and Tailwind v4 on top of Nuxt UI. The write frontend code skill holds the project rules. The shared Vue and TypeScript skills cover the general ones. Each folder under resources/js/components and resources/js/pages has a README.md with its own rules. Read it before you add a file there.

Where code goes ​

  • components/base holds thin App* wrappers over Nuxt UI. Only this folder imports @nuxt/ui.
  • components/common holds reusable components with no domain knowledge.
  • components/domain holds feature components, grouped by feature.
  • components/layout holds panels and navigation.
  • pages holds route views that only compose components.
  • composables and stores hold reactive logic and Pinia state. API calls and business logic go there or in domain components. They never go in pages or base components.

Rules ​

  • Use <script setup lang="ts">, then the template, then styles if needed.
  • Type everything. Do not use any or non-null assertions to quiet the compiler. Use import type for types and @/ for imports.
  • Backend types come from @/interfaces/generated. Never edit that folder. Run php bin/intellisense after a backend change.
  • Keep state minimal. Derive values with computed. Split a component that does more than one thing.
  • Use gap for spacing between siblings, not margins.
  • Style with the semantic and token utilities. See the design system.
  • Support dark mode. Use icons by full literal name such as i-hugeicons-cancel-01.
  • Add data-testid to elements that tests need.
  • Let npm run style:fix format the code.

Tests ​

  • Vitest specs live in resources/js/tests and mirror the source path. Start from resources/js/tests/_templates/component.test.template.ts.
  • Test behavior. Select by data-testid or role, never by class name. Mock API calls and stores.
  • A flow that crosses pages gets a Playwright spec in tests/E2E/tests.