Use:
ecomm-frontend/
├── public/
│ └── favicon.ico
│
├── src/
│ ├── assets/ # images, icons, fonts
│ ├── components/ # reusable UI components (buttons, modals, cards)
│ │ ├── ui/ # atomic components
│ │ ├── layouts/ # shared layouts (Navbar, Footer)
│ │ └── index.ts # export barrel file
│ │
│ ├── features/ # domain-specific modules
│ │ ├── products/
│ │ │ ├── components/
│ │ │ ├── pages/
│ │ │ ├── hooks/
│ │ │ ├── api/
│ │ │ └── index.ts
│ │ ├── cart/
│ │ ├── auth/
│ │ └── orders/
│ │
│ ├── pages/ # route-level components
│ │ ├── Home.tsx
│ │ ├── ProductList.tsx
│ │ ├── ProductDetail.tsx
│ │ ├── Cart.tsx
│ │ └── Checkout.tsx
│ │
│ ├── hooks/ # custom global hooks
│ ├── context/ # Context Providers (AuthContext, ThemeContext)
│ ├── utils/ # helper functions (formatDate, priceFormatter)
│ ├── services/ # axios configs, API clients
│ ├── constants/ # app-wide constants (API URLs, keys)
│ ├── types/ # TypeScript types & interfaces
│ ├── router/ # central routing setup
│ ├── store/ # Zustand/Recoil/Redux store (if used)
│ ├── App.tsx
│ ├── main.tsx
│ └── index.css
│
├── .env
├── .eslintrc.js
├── .prettierrc
├── package.json
├── tsconfig.json
└── README.md
| Type | Convention | Example |
|---|---|---|
| Components | PascalCase | ProductCard.tsx |
| Hooks | camelCase + use prefix |
useCart.ts |
| Files/Folders | kebab-case | product-details/, auth-context.ts |
| Variables | camelCase | totalPrice |
| Constants | UPPER_SNAKE_CASE | API_BASE_URL |
| CSS classes | kebab-case | btn-primary |