Frontend Guidelines
Placement rules
- •Collocate page-specific components: create a
_components/folder inside the App Router page directory (the same directory as thepage.tsx,layout.tsx, etc.) and place components used only by that page there. - •Keep shared components and utilities under
frontend/src/following the existing architecture (src/ui/,src/shared/,src/theme/, etc.). - •Prefer shared placement when a component is reused across routes, layouts, or features.
Examples
- •
frontend/app/dashboard/_components/StatsCard.tsxfor a dashboard-only component. - •
frontend/src/ui/Button.tsxfor a reusable button.
Notes
- •Follow existing naming conventions (PascalCase components,
useXhooks) and lint/format rules. - •When unsure about reuse, start collocated; promote to
src/when a second usage appears.