Project Structure & Standards
- •
Directory Layout:
- •
app/: All routes and pages. - •
components/:- •
ui/: Raw shadcn components (buttons, inputs). - •
features/: Business logic components (e.g.,ProductCard,CartSummary). - •
layout/: Global layout elements (Sidebar, Navbar).
- •
- •
lib/: Utility functions and Supabase clients (supabase.ts,utils.ts). - •
types/: Global TypeScript interfaces (prefer generated database types).
- •
- •
Naming Conventions:
- •Files:
kebab-case.tsx(e.g.,product-card.tsx). - •Components:
PascalCase(e.g.,ProductCard). - •Functions:
camelCase(e.g.,calculateTotal).
- •Files:
- •
Environment:
- •Access variables ONLY via
process.env.NEXT_PUBLIC_...on client. - •Never commit
.envfiles.
- •Access variables ONLY via