This is a solution to the E-commerce product page challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the site depending on their device's screen size
- See hover states for all interactive elements on the page
- Open a lightbox gallery by clicking on the large product image
- Switch the large product image by clicking on the small thumbnail images
- Add items to the cart
- View the cart and remove items from it
- Products are rendered dynamically, NOT hard-coded. The data lives in
./src/constants/index.ts - By simply adding other Product objects to the array, you'll have multiple products rendered with individual states.
- Users can add, and manage multiple products in their cart.
- This project features many reusable components. Therefore, future expansion/completion is made easy.
- Node.js (v20 or higher)
- pnpm (v10 or higher) or npm (v10 or higher)
- Git
- This project was created with pnpm, but you can use any package manager:
-
Clone the repository:
git clone https://github.com/corneliusweb/sneakers.git cd sneakers -
Install dependencies:
pnpm install # or npm install -
Start the development server:
pnpm dev # or npm run dev
The application will be available at http://localhost:5173
In the project directory, you can run:
-
pnpm devornpm run dev- Runs the app in development mode
- Open http://localhost:5173 to view it in the browser
- The page will reload when you make changes
-
pnpm buildornpm run build- Builds the app for production to the
distfolder - It correctly bundles React in production mode and optimizes the build for the best performance
- The build is minified and the filenames include the hashes
- Builds the app for production to the
-
pnpm previewornpm run preview- Locally preview the production build
- Serves the built files from the
distfolder
-
pnpm lintornpm run lint- Runs ESLint to check for code quality issues
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- React - JS library
- TypeScript v5.8.3 - A JavaScript subset
- Tailwindcss v4.1 - CSS framework
- Semantic HTML5 markup
- Mobile-first workflow
I learned how to leverage on useContext to provide, and access values across the entire product.
This project also thought me the importance of building a product from the visionary point of view. What this means is that, I built this project by have in mind, the possibility of wanting to expand this project later on in my learning journey, which made me to build it in that respect.
This project also helped me to build my TypeScript muscle memory and practice type safety as much as possible.
I am 100% positive that I want to extend this project in the nearest future. I want to build the page for all of the links in the top navigation.
Due to the structuring of the project, building the remaining pages will be very easy and a cool experience. I just can't wait to work on this as soon as I can.
- Total TypeScript - This helped me to browse the types to use and in which scenario to do so.
- Website - corneliusweb
- Twitter(X) - @corneliusweb



