Building the frontend of a mini e-commerce using React Router DOM. The application features multiple pages, product listings fetched from Fake Store API, and dynamic product detail pages.
| Repository | Project | Category | Main Focus | Exercise |
|---|---|---|---|---|
| react-router | React Router Store | Exercise | React Router, dynamic routing, API integration | 39/50 |
Create the frontend of a mini e-commerce application, implementing its main pages and navigation system.
Use Fake Store API as a mock backend to retrieve product data.
https://fakestoreapi.com/
Install React Router DOM via npm.
npm i react-router-domBuild at least three main pages.
- Homepage: Display a welcome message or promotional image.
- About Us: Introduce the store.
- Products: Display a list of products fetched from
https://fakestoreapi.com/products.
Implement a navigation bar visible across all pages, allowing users to navigate between them.
Extend the application by adding a dedicated detail page for each product.
- Make each product in the Products page clickable using React Router's
<Link>component. - Create a product detail page displaying information fetched from
https://fakestoreapi.com/products/:id. - Configure dynamic routing to retrieve the product
idfrom the URL.
Try to implement the following additional features.
- Centralize the navigation bar by creating a reusable
Layoutcomponent. - Manage the
activeclass to visually highlight the currently active navigation link. - Implement programmatic navigation to return users to the product listing if they request a product that does not exist.
- Create a dedicated 404 page for routes that do not exist.
- Display a loading indicator while the product detail data is being fetched.
Add buttons to the product detail page to navigate to the previous or next product using useNavigate() programmatically.
- Setting up client-side routing with React Router DOM.
- Creating multiple pages within a React application.
- Building reusable layout components.
- Navigating between pages using
Link. - Highlighting active navigation links.
- Implementing dynamic routes and URL parameters.
- Fetching data from external APIs.
- Managing loading and error states.
- Using programmatic navigation with
useNavigate().
Exercise assigned by Boolean Tech Academy as part of the Web Development course (Class 152, A.Y. 2025-2026).