A simpl 877D e React application that allows users to view product details and compare multiple products side by side. The application fetches product data from a public API and provides a user-friendly interface for comparison.
- View a list of products with details such as title, description, price, brand, and category.
- Select products to compare them side by side.
- Responsive design for optimal viewing on various devices.
- User-friendly interface with navigation between product details and comparison pages.
- React: A JavaScript library for building user interfaces.
- Ant Design: A UI design language and React-based implementation for building rich, interactive user interfaces.
- React Router: For handling routing and navigation within the application.
- Axios: For making HTTP requests to fetch product data from the API.
To get started with the project, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/product-comparison-app.git
-
Navigate to the project directory:
cd product-comparison-app
-
Install the required dependencies:
npm install
-
Start the development server:
npm start
-
Open your browser and go to
http://localhost:3000
to view the application.
- On the Product Details page, you will see a list of products fetched from the API.
- Click the Compare button next to any product to add it to the comparison list.
- Navigate to the Compare Products page to view the selected products side by side.
- You can remove products from the comparison list as needed.
The application fetches product data from the following API:
- API Endpoint: https://dummyjson.com/products
The API provides a list of products with attributes such as:
id
title
description
price
brand
category
src/
|-- components/ # Reusable components (Navbar, Sidebar, ProductTable, etc.)
|-- pages/ # Page components (ProductDetails, ComparePage)
|-- App.js # Main application component
|-- index.js # Entry point of the application
|-- styles.css # Global styles
Contributions are welcome! If you have suggestions for improvements or new features, please fork the repository and submit a pull request.
- Fork the repository.
- Create your feature branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/YourFeature
- Open a pull request.