classic-watch-upgraded/
βββ π package.json # Dependencies & scripts
βββ π tsconfig.json # TypeScript configuration
βββ π vite.config.ts # Vite build config
βββ π .eslintrc.cjs # ESLint rules
βββ π .prettierrc # Code formatting rules
βββ π .gitignore # Git ignore patterns
βββ π .env.example # Environment template
βββ π README.md # Main documentation
βββ π UPGRADE_SUMMARY.md # Detailed upgrade report
βββ π QUICK_START.md # Quick setup guide
βββ π index.html # HTML entry point
β
βββ π src/ # Source code
βββ π main.tsx # React entry point
βββ π App.tsx # Main App component
βββ π vite-env.d.ts # Vite type definitions
β
βββ π api/ # API layer (React Query)
β βββ π products.api.ts # Product queries & mutations
β βββ π orders.api.ts # Order queries & mutations
β βββ π reviews.api.ts # Review queries & mutations
β βββ π users.api.ts # User queries & mutations
β
βββ π components/ # Reusable components
β βββ π common/ # Shared components
β β βββ π ProtectedRoute.tsx
β β βββ π AdminRoute.tsx
β β βββ π LoadingScreen.tsx
β β βββ π ErrorFallback.tsx
β β βββ π SkeletonLoader.tsx
β β βββ π EmptyState.tsx
β β
β βββ π layout/ # Layout components
β β βββ π MainLayout.tsx
β β βββ π DashboardLayout.tsx
β β βββ π Header.tsx
β β βββ π Footer.tsx
β β βββ π Sidebar.tsx
β β
β βββ π ui/ # Base UI components
β βββ π Button.tsx
β βββ π Card.tsx
β βββ π Modal.tsx
β βββ π Badge.tsx
β βββ π Tooltip.tsx
β
βββ π features/ # Feature modules
β β
β βββ π auth/ # Authentication
β β βββ π pages/
β β β βββ π LoginPage.tsx
β β β βββ π RegisterPage.tsx
β β β βββ π ProfilePage.tsx
β β βββ π components/
β β β βββ π LoginForm.tsx
β β β βββ π RegisterForm.tsx
β β β βββ π SocialLogin.tsx
β β βββ π hooks/
β β βββ π useAuthForm.ts
β β
β βββ π products/ # Products
β β βββ π pages/
β β β βββ π ProductsPage.tsx
β β β βββ π ProductDetailPage.tsx
β β β βββ π WishlistPage.tsx
β β βββ π components/
β β β βββ π ProductCard.tsx
β β β βββ π ProductGrid.tsx
β β β βββ π ProductFilters.tsx
β β β βββ π ProductSort.tsx
β β β βββ π ProductDetail.tsx
β β β βββ π ProductGallery.tsx
β β βββ π hooks/
β β βββ π useProductFilters.ts
β β
β βββ π cart/ # Shopping Cart
β β βββ π pages/
β β β βββ π CartPage.tsx
β β β βββ π CheckoutPage.tsx
β β βββ π components/
β β β βββ π CartItem.tsx
β β β βββ π CartSummary.tsx
β β β βββ π CheckoutForm.tsx
β β β βββ π PaymentForm.tsx
β β βββ π hooks/
β β βββ π useCheckout.ts
β β
β βββ π orders/ # Orders
β β βββ π pages/
β β β βββ π MyOrdersPage.tsx
β β β βββ π OrderDetailPage.tsx
β β βββ π components/
β β β βββ π OrderCard.tsx
β β β βββ π OrderTimeline.tsx
β β β βββ π OrderStatusBadge.tsx
β β βββ π hooks/
β β βββ π useOrderTracking.ts
β β
β βββ π reviews/ # Product Reviews
β β βββ π components/
β β β βββ π ReviewCard.tsx
β β β βββ π ReviewForm.tsx
β β β βββ π ReviewList.tsx
β β β βββ π RatingStars.tsx
β β βββ π hooks/
β β βββ π useReviewForm.ts
β β
β βββ π dashboard/ # User Dashboard
β β βββ π pages/
β β β βββ π DashboardPage.tsx
β β βββ π components/
β β βββ π DashboardStats.tsx
β β βββ π RecentOrders.tsx
β β
β βββ π admin/ # Admin Panel
β β βββ π pages/
β β β βββ π AdminDashboardPage.tsx
β β β βββ π ManageProductsPage.tsx
β β β βββ π ManageOrdersPage.tsx
β β β βββ π ManageUsersPage.tsx
β β β βββ π AddProductPage.tsx
β β βββ π components/
β β βββ π AdminStats.tsx
β β βββ π ProductTable.tsx
β β βββ π OrderTable.tsx
β β βββ π UserTable.tsx
β β βββ π ProductForm.tsx
β β
β βββ π home/ # Home Page
β βββ π pages/
β β βββ π HomePage.tsx
β βββ π components/
β βββ π Hero.tsx
β βββ π FeaturedProducts.tsx
β βββ π LatestProducts.tsx
β βββ π Categories.tsx
β βββ π Testimonials.tsx
β
βββ π store/ # Global State (Zustand)
β βββ π auth.store.ts # Authentication state
β βββ π cart.store.ts # Shopping cart state
β βββ π wishlist.store.ts # Wishlist state
β βββ π theme.store.ts # Theme/Dark mode state
β
βββ π hooks/ # Custom React Hooks
β βββ π useDebounce.ts
β βββ π useLocalStorage.ts
β βββ π useMediaQuery.ts
β βββ π useOnClickOutside.ts
β βββ π useIntersectionObserver.ts
β
βββ π lib/ # Third-party integrations
β βββ π firebase.ts # Firebase setup
β βββ π axios.ts # Axios instance & interceptors
β βββ π queryClient.ts # React Query client
β
βββ π types/ # TypeScript Types
β βββ π index.ts # Global types
β βββ π api.types.ts # API response types
β βββ π form.types.ts # Form types
β
βββ π utils/ # Utility Functions
β βββ π helpers.ts # General helpers
β βββ π validators.ts # Validation functions
β βββ π formatters.ts # Data formatters
β βββ π constants.ts # App constants
β
βββ π styles/ # Styles
β βββ π global.css # Global CSS
β βββ π theme.ts # MUI theme configuration
β
βββ π config/ # Configuration
β βββ π index.ts # App config
β
βββ π assets/ # Static Assets
βββ π images/ # Images
βββ π icons/ # Icons
βββ π fonts/ # Custom fonts
- PascalCase:
ProductCard.tsx,UserProfile.tsx - Suffix with type:
LoginPage.tsx,CartItem.tsx
- camelCase with 'use' prefix:
useAuth.ts,useProducts.ts
- camelCase:
helpers.ts,validators.ts
- PascalCase:
User,Product,Order - Suffix interfaces with 'Props':
ButtonProps,CardProps
- UPPER_SNAKE_CASE:
API_BASE_URL,MAX_FILE_SIZE
// β
Good (using @/ alias)
import { useAuthStore } from '@/store/auth.store';
import { ProductCard } from '@/components/products/ProductCard';
import { formatCurrency } from '@/utils/helpers';
// β Avoid (relative paths)
import { useAuthStore } from '../../../store/auth.store';// components/ui/index.ts
export { Button } from './Button';
export { Card } from './Card';
export { Modal } from './Modal';
// Usage
import { Button, Card, Modal } from '@/components/ui';import { useQuery, useMutation } from '@tanstack/react-query';import { create } from 'zustand';
import { persist } from 'zustand/middleware';import { Box, Button } from '@mui/material';
import { motion } from 'framer-motion';import { getAuth } from 'firebase/auth';
import axios from 'axios';β src/features/auth/ or src/store/auth.store.ts
β src/features/products/components/
β src/api/
β src/store/
β src/utils/
β src/types/
| File | Purpose |
|---|---|
README.md |
Complete project documentation |
UPGRADE_SUMMARY.md |
Detailed upgrade report |
QUICK_START.md |
Quick setup guide |
FILE_STRUCTURE.md |
This file - structure guide |
π― Key Principle: Everything has its place, and there's a place for everything!