A professional, full-featured e-commerce application built with Next.js, TypeScript, and modern web technologies.
- Multi-language Support: Full English and Arabic translations with RTL layout support
- Product Catalog: Browse products with advanced filtering, sorting, and search
- Shopping Cart: Persistent cart with localStorage, quantity management
- Product Details: Image zoom, quantity selector, related products
- Responsive Design: Mobile-first design that works on all devices
- Type-Safe: Full TypeScript implementation with Zod validation
- State Management: Zustand for cart and language state
- Data Fetching: React Query with Axios for efficient API calls
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- State Management: Zustand
- Data Fetching: @tanstack/react-query + Axios
- Form Validation: React Hook Form + Zod
- UI Components: shadcn/ui
- API: FakeStore API (can be replaced with custom backend)
- Node.js 18+
- npm or yarn
-
Clone the repository: ```bash git clone ```
-
Install dependencies: ```bash npm install
yarn ```
- Run the development server: ```bash npm run dev
yarn dev ```
- Open http://localhost:3000 in your browser
The app supports English and Arabic with automatic RTL layout switching:
- Click the globe icon in the navbar to switch languages
- All text is translated using the
useTranslationhook - RTL layout automatically applies for Arabic
- Add products from shop or product detail pages
- Adjust quantities directly in the cart dropdown
- Cart persists across page refreshes
- Real-time subtotal calculation
Combine multiple filters:
- Category selection
- Price range slider
- Minimum rating filter
- Sort by price or rating
- Search functionality
- Mobile-first approach
- Breakpoints: mobile (≤640px), tablet (768px), desktop (1024px+)
- Touch-friendly interactions
- Optimized images with lazy loading
To use your own backend instead of FakeStore API:
-
Update the
baseURLinlib/axios.ts: ```typescript const axiosInstance = axios.create({ baseURL: 'https://your-api.com', // Change this // ... }) ``` -
Adjust the API functions in
lib/api/products.tsto match your backend endpoints -
Update TypeScript types in
types/product.tsif your data structure differs -
Add authentication headers in the Axios interceptor if needed
```bash npm run build npm start ```
This app is optimized for deployment on Vercel:
- Push your code to GitHub
- Import the repository in Vercel
- Deploy with one click
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
Contributions are welcome! Please open an issue or submit a pull request.