Your Gadget - Tech Accessories E-commerce-Live
Requirements Followed By - Requirements PDF
- React.js
- Tailwind CSS
- React Router DOM
- SweetAlert2
- React Helmet
- React Rating Stars Component
-
Component Architecture
- Functional Components
- Component Composition
- Component Reusability
- Props Drilling
- Children Props
-
Hooks Implementation
- useState for local state management
- useEffect for data fetching and side effects
- useContext for global state access
- useNavigate and useLocation for routing
- useParams for dynamic routing
-
State Management
- Context API for global state (cart and wishlist)
- Local state for UI interactions
- State lifting when needed
-
Routing
- Dynamic Routes
- Protected Routes
- Route Parameters
- Nested Routes
- Navigation Guards
-
Event Handling
- Click Events
- Form Events
- Custom Event Handlers
- Created a centralized context (ContextAPI.jsx) for managing:
const [cart, setCart] = useState([]) const [wishlist, setWishlist] = useState([])
- Context Provider wraps the entire application
- Global state access in components using useContext hook
- Manages shopping cart and wishlist functionality
- Product data fetched from JSON file
- User interactions update global state
- State changes trigger UI updates
- Cart and wishlist management through context
-
Dynamic Product Filtering
- Category-based filtering
- Real-time updates
- Active category highlighting
- Empty state handling
-
Shopping Cart Management
- Add/Remove items
- Quantity updates
- Total cost calculation
- Purchase confirmation
- Sort by price functionality
-
Wishlist System
- Add/Remove items
- Move items to cart
- Prevent duplicate additions
- Persistent storage
-
Responsive Design
- Mobile-first approach
- Breakpoint-specific layouts
- Hamburger menu for mobile
- Flexible grid system
- Consistent styling across devices
-
Enhanced User Experience
- Interactive product cards
- Smooth transitions and animations
- Toast notifications for user actions
- Modal confirmations
- Dynamic page titles
- Loading and empty states
src/
├── components/
│ ├── Banner/
│ ├── Dashboard/
│ ├── Details/
│ ├── Footer/
│ ├── Navbar/
│ ├── Product/
│ ├── Products/
│ └── Signup/
├── assets/
│ └── images/
├── ContextAPI/
└── ...
- Install dependencies
npm install
- Run the development server
npm run dev
- Color Scheme: Primary color #F3445A for consistent branding
- UI Framework: Tailwind CSS for responsive design
- Component Library: Custom components with consistent styling
- State Management: Context API for global state
- Routing: React Router v6 for navigation
- User Authentication
- Payment Gateway Integration
- Order History
- Product Reviews
- Search Functionality
- Product Recommendations