Table of Contents Project Overview Technologies Used Key Features User Roles API Endpoints Usage Testing Contributing License
This eCommerce project is designed to provide users with a seamless online shopping experience. It includes features for product browsing, shopping cart management, user authentication, and order processing. The project is built using modern web technologies to ensure scalability, performance, and maintainability.
React (with TypeScript) Redux Toolkit for state management React Router for navigation React Bootstrap for styling React Toastify for notifications Axios for API requests
Node.js Express MongoDB (or another database of choice) JWT for authentication Others:
Redux Persist for state persistence Redux Query (if used for data fetching)
Users can register and log in using email/password and third-party providers (e.g., Google). Password reset functionality.
Admin users can add and delete users and also add product and delete products. Sellers can add products for sale, view pending payments or approve payments Users can browse products, filter by categories, and view product details.
Users can add, remove, and update the quantity of products in their cart. Cart persistence across sessions.
Users can place orders, which includes shipping and payment processing. Order history and tracking available for users.
The application is designed to be mobile-friendly using responsive design principles.
Real-time notifications for user actions such as successful registration, order placement, and errors. Protected Routes:
Specific routes are protected based on user roles, ensuring security and proper access control.
The eCommerce application supports three user roles:
Full access to manage products, users, and orders. Can view analytics and reports on sales and user activity.
Can list products for sale, add products edit products approve pending payments. Access to order history and can track their orders.
Can browse products but needs to create an account to place orders. Limited functionality compared to registered users.
User Authentication:
POST /api/users/register - Register a new user POST /api/users/login - Log in an existing user POST /api/users/logout - Log out the user
GET /api/products - Get all products POST /api/products - Add a new product (Admin only) PUT /api/products/:id - Update a product (Admin only) DELETE /api/products/:id - Delete a product (Admin only)
GET /api/cart - Get current user's cart POST /api/cart - Add item to cart DELETE /api/cart/:id - Remove item from cart
POST /api/orders - Create a new order GET /api/orders/:id - Get order details GET /api/orders/history - Get order history for the user Usage Visit the homepage to view featured products. Users can browse products, view details, and add items to their cart. Customers can log in or register to access their account and order history. Admin users can manage products and view analytics.
To run tests, you can use a testing library like Jest or Mocha. Here’s a basic command to run tests: npm test Make sure to include unit tests for your components, reducers, and API calls.
Contributions are welcome! To contribute to this project:
Create a new branch (git checkout -b feature/YourFeature). Make your changes and commit them (git commit -m 'Add some feature'). Push to the branch (git push origin feature/YourFeature). Create a new Pull Request.
This project is licensed under the MIT License