Skip to content

ufyy01/Byc-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce Backend Project

This project is a Node.js and Express.js-based backend for an e-commerce platform. It utilizes MongoDB as the database and provides CRUD RESTful APIs for managing products, users, cart, wishlist, blogs, and orders.

Technologies Used

  • Node.js
  • Express.js
  • MongoDB

Installation

Clone the repository:

git clone

Navigate to the project directory:

cd e-commerce-backend

Install dependencies:

npm install

Set up environment variables:

Create a .env file in the root directory and define the following variables:

PORT=3000
MONGODB_URI= 'your-mongodb-uri'

Run the server:

npm run dev

Usage

Once the server is up and running, you can make HTTP requests to the provided APIs to manage products, users, cart, wishlist, blogs, and orders.

Endpoints

Products:

GET /api/products - Retrieve all products
GET /api/products/:id - Retrieve a specific product by ID
POST /api/products - Create a new product
PUT /api/products/:id - Update a product
DELETE /api/products/:id - Delete a product

Users:

GET /api/users/:id - Retrieve a specific user by ID
POST /api/users - Create a new user
PUT /api/users/:id - Update a user
DELETE /api/users/:id - Delete a user

Cart:

GET /api/cart/:userId - Retrieve the cart for a specific user
POST /api/cart/:userId - Add an item to the cart for a specific user
PUT /api/cart/:userId/:productId - Update the quantity of an item in the cart for a specific user
DELETE /api/cart/:userId/:productId - Remove an item from the cart for a specific user

Wishlist:

GET /api/wishlist/:userId - Retrieve the wishlist for a specific user
POST /api/wishlist/:userId - Add a product to the wishlist for a specific user
DELETE /api/wishlist/:userId/:productId - Remove a product from the wishlist for a specific user

Blogs:

GET /api/blogs - Retrieve all blogs
GET /api/blogs/:id - Retrieve a specific blog by ID
POST /api/blogs - Create a new blog
PUT /api/blogs/:id - Update a blog
DELETE /api/blogs/:id - Delete a blog

Orders:

GET /api/orders/:userId - Retrieve all orders for a specific user
POST /api/orders/:userId - Create a new order for a specific user
GET /api/orders/:userId/:orderId - Retrieve a specific order for a specific user
PUT /api/orders/:userId/:orderId - Update an order for a specific user
DELETE /api/orders/:userId/:orderId - Cancel an order for a specific user

Contributing

Contributions are welcome. Please submit a pull request explaining the changes you've made.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published