Instruction file imported from vazinedaalat/vz-frontend (
.cursor/rules/frontend-architecture.mdc). Copyright stays with the author.
Frontend Architecture & Clean Code
Follow feature-based modular architecture (skills/architecture.md).
Structure
src/features/[feature]/
components/ # feature UI only
hooks/
constants/ # copy & sample data
types/
pages/
index.ts # public API
- Features must not import other features directly
- Shared UI:
components/ui,components/shared,components/animated - Pure helpers:
lib/· app shell:app/
TypeScript
- Strict types; no
anyunless unavoidable and justified - Prefer
interfacefor object shapes; export domain types fromtypes/ - Discriminated unions over boolean soup for UI states
- Keep
noUnusedLocals/noUnusedParametersclean
Components
- Small, composable, presentational by default
- Props typed; avoid prop drilling when a feature-local hook/store fits
- No data-fetching inside dumb UI primitives (
components/ui) - Prefer extending
Button/Container/SectionHeadingover one-off styled copies - Name files
kebab-case.tsx; componentsPascalCase
State & data
- Server state → TanStack Query (when APIs exist)
- Client UI state → Zustand only for cross-cutting UI (
app/store) - Form validation → Zod + React Hook Form when forms appear
Extensibility checklist
- New section = new component + constants entry + page composition
- Copy/CTA centralized (
constants) so marketing edits stay one-file - Motion isolated (
Reveal, backdrop components) so pages stay readable - No drive-by refactors outside the requested scope
Canonical references: skills/components.md, skills/development.md