Skip to content

Dannynsikak/e-Commerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 

Repository files navigation

eCommerce Project Documentation

Table of Contents Project Overview Technologies Used Key Features User Roles API Endpoints Usage Testing Contributing License

Project Overview

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.

Technologies Used

Frontend:

React (with TypeScript) Redux Toolkit for state management React Router for navigation React Bootstrap for styling React Toastify for notifications Axios for API requests

Backend:

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)

Key Features

User Authentication:

Users can register and log in using email/password and third-party providers (e.g., Google). Password reset functionality.

Product Management:

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.

Shopping Cart:

Users can add, remove, and update the quantity of products in their cart. Cart persistence across sessions.

Order Processing:

Users can place orders, which includes shipping and payment processing. Order history and tracking available for users.

Responsive Design:

The application is designed to be mobile-friendly using responsive design principles.

Notifications:

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.

User Roles

The eCommerce application supports three user roles:

Admin:

Full access to manage products, users, and orders. Can view analytics and reports on sales and user activity.

Seller:

Can list products for sale, add products edit products approve pending payments. Access to order history and can track their orders.

Guest:

Can browse products but needs to create an account to place orders. Limited functionality compared to registered users.

API Endpoints

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

Products:

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)

Cart:

GET /api/cart - Get current user's cart POST /api/cart - Add item to cart DELETE /api/cart/:id - Remove item from cart

Orders:

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.

Testing

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.

Contributing

Contributions are welcome! To contribute to this project:

Fork the repository.

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.

License

This project is licensed under the MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages