If you want to read this readme in Spanish
Welcome to our E-commerce: On our site, you can explore a wide variety of products, from menโs and womenโs clothing to electronic equipment and jewelry.
Looking for something specific? Use our filters by category or minimum price to find what you need.
Enjoy the convenience of online shopping and discover everything we have to offer! ๐ป๐
- Favicon Support: Support for a wide range of favicon sizes has been added, ensuring that the siteโs icon displays correctly on all devices and platforms.
- Open Graph and Twitter Tags: Open Graph and Twitter meta tags have been included, which optimize the preview of the website on social platforms like Facebook and Twitter.
- Cross-Browser Compatibility: The web page uses the
X-UA-Compatible
meta tag, which helps ensure compatibility with multiple browsers, especially older versions of Internet Explorer. - Displaying a Product List from JSON: Created an interface to display a list of products sourced from a JSON file. Users can view available products in the store.
- Responsive Grid Design: Products are displayed in rows and columns, adjusting to look good on both large screens and mobile devices.
- Category Filtering: Implemented a filter that allows users to select a specific category (e.g., โJewelry,โ โElectronics,โ etc.). Applying the filter updates the product list to show only items from that category.
- Price Filtering: Added functionality to filter products by price range. Users can set a minimum, and the product list automatically adjusts to display items within that range.
- Using useContext to Avoid Passing Unnecessary Props: Managed global application state using
useContext
. This eliminates the need to manually pass props between components and improves efficiency. - Shopping Cart:
-
Adding Products to the Cart:
- Implemented the ability to add products to the cart from the product list. Users can click a button to add an item to their selection.
-
Removing Products from the Cart:
- Users can remove products from the cart if they change their minds or no longer wish to purchase a specific item.
-
Modifying Product Quantity in the Cart:
- Functionality allows users to adjust the quantity of a product in the cart. Useful if they want to buy more or fewer units of an item.
-
Synchronizing Cart Changes with the Product List:
- When users add or remove products from the cart, the changes automatically reflect in the product list. Ensures a consistent experience.
-
Saving the Cart in localStorage:
- By saving the cart in local storage, users can retrieve their selection even after page reloads. Improves usability and convenience.
- React - A JavaScript library for building interactive user interfaces.
- Vite - A fast and lightweight development environment for modern web applications.
- ESLint - An open-source tool that helps you find and fix problems in your JavaScript code.
- Fork or clone this repository
git clone [email protected]:joserafael0160/E-commerce.git
- Install the dependencies:
- I used bun to install and manage the dependencies.
# Install bun for MacOS, WSL & Linux:
curl -fsSL https://bun.sh/install | bash
# Install bun for Windows:
powershell -c "iwr bun.sh/install.ps1|iex"
# Install with bun:
bun install
- or you can use pnpm:
# Install pnpm globally if you don't have it:
npm install -g pnpm
# Install dependencies:
pnpm install
- Run the development server:
# Run with bun:
bun run dev
# Run with pnpm:
pnpm run dev
Command | Action | |
---|---|---|
โ๏ธ | dev |
Starts the local development server. |
โ๏ธ | build |
Builds the production version to ./dist/ . |
โ๏ธ | lint |
Runs ESLint to find issues in your JavaScript code. |
โ๏ธ | preview |
Previews the local build. |
โ๏ธ | predeploy |
Generates the production version before deploying. |
โ๏ธ | deploy |
Deploys the site to GitHub Pages from the dist folder. |
Contributions are always welcome! Whether youโre reporting bugs, requesting new features, or improving existing functionalities, your help is greatly appreciated.
If you have any suggestions that could improve the project, please make a fork of the repository and create a pull request. You can also simply open an issue with the โenhancementโ label.
Here is a quick guide:
- Make a fork of the Project
- Clone your fork (
git clone <URL of the fork>
) - Add the original repository as remote (
git remote add upstream <URL of the original repository>
) - Create your Feature Branch (
git switch -c feature/NewFeature
) - Make your Changes (
git commit -m 'Add: some NewFeature'
) - Push to the Branch (
git push origin feature/NewFeature
) - Open a pull request
Don't forget to leave a star โญ๏ธ
โ๏ธ
A project created by @joserafael0160