Expense Analyser Frontend Component Builder
Build frontend features that match the current repo conventions:
- •Reusable UI in
src/components - •Thin page wrappers in
src/views - •Data/state logic in Pinia stores (
src/stores) - •API logic in services (
src/services) - •Route entries in
src/router/index.tsfor new pages
Read references/frontend-component-conventions.md before implementation.
Use templates from assets/component-options-template.vue and assets/view-wrapper-template.vue when bootstrapping files.
Workflow
- •Decide scope first.
- •Add only a component when UI is embedded in an existing page.
- •Add both component + view when creating a new route/page.
- •Write tests first for each impacted layer.
- •Create or update component tests in
src/components/__tests__/. - •Create or update store tests in
src/stores/<Domain>/__tests__/index.spec.ts. - •Create or update service tests in
src/services/__tests__/<Domain>Service.spec.ts. - •Start with failing tests that describe expected behavior for new UI flow.
- •Place files in the correct layer.
- •
src/components/<Feature>.vuefor feature UI. - •
src/views/<Feature>View.vueas route wrapper. - •
src/stores/<Domain>/index.tsfor actions/state needed by UI. - •
src/modelsfor form/request/response types.
- •Implement layers to satisfy tests.
- •Implement service methods first.
- •Implement store state/actions next.
- •Implement component/view behavior last.
- •Follow existing component style.
- •Prefer Vuetify primitives (
v-container,v-row,v-col,v-card,v-form,v-btn,v-alert). - •Use
defineComponentwith TypeScript in components. - •Keep component names in
ea*style to match current usage. - •Keep local styles
scopedunless intentionally global.
- •Keep data flow architecture-safe.
- •Use stores for stateful logic and async actions.
- •Keep API calls in
src/services, not inside components. - •Use
computedfor store-derived state andreffor local form/UI state.
- •Add route only when needed.
- •Register new page routes in
src/router/index.ts. - •Add route meta fields following current pattern (
title,description, guards).
- •Validate.
- •Run
npx vitest runor targeted test files first. - •Run
npm run type-check. - •Run
npm run lint. - •Confirm component imports resolve and route navigation works.
Guardrails
- •Preserve path aliases and imports (
@/stores,@/models,@/services) where already used. - •Keep views minimal wrappers when no page-level logic is required.
- •Avoid broad style refactors while adding a single component.
- •Do not introduce new state libraries or component frameworks.