Welcome to the E-Commerce Backend, an advanced server-side application that provides a robust foundation for building a comprehensive e-commerce platform. This backend system is designed to facilitate seamless online shopping experiences, from product browsing to checkout and order fulfillment.
Our e-commerce backend is a Node.js application that leverages Express.js for creating a structured, scalable, and efficient RESTful API. The system is backed by MongoDB, a NoSQL database, to ensure high performance and flexible data handling for e-commerce operations.
- User Authentication and Authorization: Secure sign-up and sign-in processes with role-based access control, allowing for clear distinction between customer and administrator privileges.
- Product Management: A full suite of CRUD operations for products, enabling administrators to add, update, remove, and retrieve products with ease.
- Order Processing: Robust order management system that allows customers to place orders, and admins to process them through a streamlined workflow.
- Shopping Cart: Persistent shopping cart functionality, complete with add-to-cart, update quantities, and remove items features.
- Payments Integration: Integration with payment gateways like Stripe for handling transactions and supporting various payment methods.
- Discounts and Coupons: Dynamic coupon creation and application system to offer discounts and promotions to customers.
- Reviews and Ratings: Users can leave reviews and rate products, fostering community engagement and providing valuable feedback.
- Wishlist: Customers can create and manage wishlists, bookmarking their favorite items for future purchase.
- Scalable Architecture: Designed with best practices in mind, ensuring that the backend can scale with the growing needs of the business.
- Node.js (v18.12.0 or higher)
- MongoDB (Running on the default port)
- npm (for dependency management)
Clone the repository and install dependencies:
git clone https://github.com/AbdeIkader/eCommerce-Backend.git
cd eCommerce-Backend
npm installSet up your environment variables in a .env file:
MODE=dev
MONGO_URL=mongodb://127.0.0.1:27017/EcommerceC40
BASE_URL=http://localhost:3000/npm start- POST
/signup: Register a new user. - POST
/signin: Login for existing users.
- PATCH
/address: Update an address for a user. - DELETE
/address: Remove an address for a user. - GET
/address: Retrieve all addresses for a user.
- POST
/brand: Add a new brand (admin). - GET
/brand: List all brands. - PUT
/brand/:id: Update a brand (admin). - DELETE
/brand/:id: Delete a brand (admin).
- POST
/cart: Add a product to the cart. - GET
/cart: Get the user's cart. - POST
/cart/apply-coupon: Apply a coupon to the cart. - DELETE
/cart/:id: Remove a product from the cart. - PUT
/cart/:id: Update product quantity in the cart.
- POST
/category: Add a new category (admin). - GET
/category: List all categories. - PUT
/category/:id: Update a category (admin). - DELETE
/category/:id: Delete a category (admin).
- POST
/coupon: Create a new coupon (admin/user). - GET
/coupon: List all coupons. - PUT
/coupon/:id: Update a coupon (admin/user). - DELETE
/coupon/:id: Delete a coupon (admin/user). - GET
/coupon/:id: Retrieve a specific coupon.
- POST
/order/:id: Create a cash order (user). - GET
/order: Get a specific order (user). - POST
/order/checkOut/:id: Create a checkout session (user). - GET
/order/all: List all orders.
- POST
/product: Add a new product (admin/user). - GET
/product: List all products. - PUT
/product/:id: Update a product (admin). - DELETE
/product/:id: Delete a product (admin). - GET
/product/:id: Retrieve a specific product.
- POST
/review: Add a new review (user). - GET
/review: List all reviews. - PUT
/review/:id: Update a review (user). - DELETE
/review/:id: Delete a review (admin/user).
- POST
/subcategory: Add a new subcategory (admin/user). - GET
/subcategory: List all subcategories. - PUT
/subcategory/:id: Update a subcategory (admin/user). - DELETE
/subcategory/:id: Delete a subcategory (admin/user).
- POST
/user: Add a new user. - GET
/user: List all users. - PUT
/user/:id: Update a user. - DELETE
/user/:id: Delete a user. - PATCH
/user/:id: Change a user's password.
- PATCH
/wishlist: Add to wishlist (user). - DELETE
/wishlist: Remove from wishlist (user). - GET
/wishlist: Get all items in a user's wishlist.
Contributions are welcome! Please fork the repository and open a pull request with your features or fixes.
This project is licensed under the ISC License. See the LICENSE file for details.
Questions or feedback? Contact me at [email protected]