This project is an e-commerce platform designed to provide a seamless online shopping experience. It includes features like product browsing, a dynamic search bar, add-to-cart functionality, and user-friendly navigation. The project is built using Next.js for the frontend, Sanity CMS for backend data management, and Tailwind CSS for responsive design.
- Dynamic Product Listing:
Products are fetched from Sanity CMS and displayed with relevant details, including name, category, price, and availability. - Add to Cart:
Users can add products to the cart, which updates dynamically and displays selected items in real-time. - Search Functionality:
A search bar allows users to filter products by name or category. - Responsive Design:
Fully optimized for all devices using Tailwind CSS. - Navigation:
Includes easy navigation with categories like Men, Women, Kids, and Sale. - Lighthouse Performance Scores:
- Accessibility: 94
- Best Practices: 100
- SEO: 83
- Performance: 35
The project follows a well-organized folder structure for scalability and maintainability:
.
├── public/
│ ├── images/ # Static images for the website
│ ├── favicon.ico # Website favicon
│ └── ... # Other public assets
├── src/
│ ├── app/
│ │ ├── layout.tsx # Root layout component
│ │ ├── page.tsx # Homepage component
│ │ ├── products/ # Products page components
│ │ ├── product/ # Individual product details page
│ │ ├── cart/ # Cart page components
│ │ └── ... # Other pages
│ ├── components/
│ │ ├── Header.tsx # Header component with navigation and search bar
│ │ ├── Footer.tsx # Footer component
│ │ └── Products.tsx # Products listing component
│ ├
│ ├── sanity/ # Sanity CMS configurations and queries
│ │ ├── schema/ # Sanity schema definitions
│ │ ├── fetchProducts.ts # API function to fetch all products
│ │ └── ... # Other Sanity configurations
│ ├── styles/ # Tailwind CSS styles and global CSS
│ └── utils/ # Utility functions
├── .env # Environment variables
├── README.md # Project documentation
├── package.json # Project dependencies
└── ... # Other configuration files
- Technology Used:
Built using Next.js and styled with Tailwind CSS for responsiveness. - Pages Implemented:
Homepage: Features a hero section and product highlights.Products Page: Displays products dynamically fetched from Sanity CMS.Product Details Page: Shows detailed information for a single product.Cart Page: Allows users to review selected items.
- Created and managed the product schema using Sanity CMS.
- Added fields such as product name, category, price, inventory, colors, status, description, and slug.
- Products fetched dynamically using API functions.
- Real-time product filtering based on search input.
- Dynamic cart functionality with product details displayed.
- Authentication:
Integrate Sign In/Join Us functionality with user authentication systems like OAuth or JWT. - Performance Optimization:
Improve Lighthouse performance score by optimizing images, reducing unused JavaScript, and enabling lazy loading. - Error Handling:
Add robust error handling for API failures and network issues. - Payment Gateway:
Plan to integrate payment methods like Stripe, Easypaisa, and JazzCash.
This project serves as a user-friendly, scalable e-commerce platform. Despite some challenges during development, it successfully meets its core objectives. The experience has been both educational and inspiring, motivating further exploration of more complex projects in the future.