A modern e-commerce web app built with Next.js + TypeScript.
Designed with a clean UI, smooth user experience, and powerful functionality.
- Browse products and categories with dynamic filtering and search.
- Add, remove, and update items in the shopping cart seamlessly.
- Register and Login functionality with protected routes for authenticated users.
- View user orders and order history in a clean interface.
- Fully responsive for desktop, tablet, and mobile devices.
- Efficient state handling using Context API or Redux Toolkit.
- Smooth UI animations using Framer Motion for better user experience.
- Toast messages for success, warnings, and error feedback.
- Robust API error handling to prevent crashes and improve reliability.
- Code splitting and optimized loading for faster performance.
- Next.js (with App Router)
- TypeScript
- React Hooks & Context API or Redux Toolkit
- Tailwind CSS for styling
- Framer Motion for animations
- React Hot Toast for notifications
- Fetch API for API calls
- ESLint + Prettier for code quality
- Config files:
next.config.ts,tsconfig.json, etc.
- Node.js (v18 or higher)
- npm, yarn, or pnpm package manager
# Clone the repository
git clone https://github.com/maryammagdy123/fresh_cart.git
cd fresh_cart
# Install dependencies
npm install
# or
yarn install
# or
pnpm install
# Run the development server
npm run dev
# or
yarn dev
# or
pnpm devThen open http://localhost:3000 in your browser to view the app.
fresh_cart/
├── public/ # Static assets (images, favicon, etc.)
├── src/
│ ├── app/ # App router pages (Next.js)
│ ├── components/ # Reusable components
│ ├── context/ # Global state management
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Page routes (if using Pages Router)
│ ├── services/ # API calls (Axios / Fetch)
│ ├── types/ # TypeScript interfaces & types
│ ├── utils/ # Helper functions
│ ├── styles/ # CSS / Tailwind files
│ └── ... # Other configs / constants
├── package.json
├── tsconfig.json
├── next.config.ts
└── README.md
- Register new users
- Login existing users
- Protect private routes
- Redirect unauthenticated users
- JWT or API-based authentication (stored securely in cookies or local storage)
- Add/remove items from the cart
- Update item quantities
- Checkout process connected to API
- Display user orders history
- Dynamic price calculation and totals
- Code linting with ESLint and formatting with Prettier
- Handle all edge cases (loading, empty states, error responses)
- Use
try…catchfor all async operations - Handle server-side errors (e.g.,
error.response.data.message) - Network error detection
- Show friendly Toast messages for all issues
- Provide fallback UI for critical failures
-
Easy deployment via Vercel (recommended for Next.js)
-
Set environment variables (API URLs, keys, etc.)
-
Build and start commands:
npm run build npm run start
-
Add SEO meta tags and Open Graph images for better discoverability
- Advanced search & filtering (by price, category, rating)
- Admin dashboard for managing products
- Multi-language support (i18n)
- Product image uploads
- Performance optimization (lazy loading, caching)
MIT License
Copyright (c) 2025 Maryam Magdy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...