- Hosted Link Explore
- https://trendbazaar-ecommerce.vercel.app - Explore this base url then use all endpoints.
Below Provided step-by-step instructions on how to install and set up your project locally. Include any prerequisites, such as Node.js and MongoDB versions. For example:
- Clone the repository:
git clone https://github.com/Abhithakur7080/ecommerce.git - Navigate to the project directory:
cd ecommerce - Install dependencies:
npm installornpm i
- visit:
https://account.mongodb.com/account/login - After logged in create new project
- set up by connect with the database url
- visit:
https://cloudinary.com/users/login - After logged in set up API key and many info to connect.
PORT= your running port
CORS_ORIGIN= cross origin port
# for mongo database
MONGODB_URL= your mongo url
# for password secret
JWT_SECRET = your jwt secret
# for node mailer
MAIL_ID = your_mail_id
MAIL_PASSWORD = your_mail_password
# for cloudinary database
CLOUD_NAME=your_cloud_name
API_KEY=your_key
API_SECRET=your_secretOn using this server command it:
# run the server
npm run devHere are listed all available API endpoints along with a brief description of each.
-
POST /api/user/register: creating new user -
POST /api/user/user/login: user logged in -
POST /api/user/admin/login: admin logged in -
POST /api/user/forgot-password: forgot user password -
POST /api/user/cart: product add to cart -
POST /api/user/coupon: apply a coupon on purchase -
POST /api/user/cart/cash-order: on cash on delivery order -
GET /api/user/all-users: View all user details -
GET /api/user/wishlist: get user added products in wishlist -
GET /api/user/cart: get user cart -
GET /api/user/order: get user orders -
PUT /api/user/reset-password/:token: for reset user password -
PUT /api/user/password: for change user password -
PUT /api/user/edit: for update user profile -
PUT /api/user/block-user/:id: admin can block a user -
PUT /api/user/unblock-user/:id: admin can unblock a user -
PUT /api/user/wishlist: product added to wishlist -
PUT /api/user/address: update user address for checkout -
PUT /api/user/update/order-status/:id: update user order status -
DELETE /api/user/:id: user can delete her account -
DELETE /api/user/empty/cart: cart will be empty after purchased
POST /api/product/create: create new productGET /api/product/:id: get a product detail with product idGET /api/product/page=1&limit=3: get all product detail with page, limit, sort and fields queries.PUT /api/product/:id: update a product detail with product idPUT /api/product/upload/:id: upload a product images with product idDELETE /api/product/delete/:id: delete a product detail with product idDELETE /api/product/image: delete a product image
POST /api/category: create new categoryGET /api/category/:id: get a catagory detail with category idGET /api/category: get all categories detail.PUT /api/category/:id: update a category detail with category idDELETE /api/category/:id: delete a category detail with category id
POST /api/blog: create new blogGET /api/blog/:id: get a blog detail with blog idGET /api/blog: get all blogs detail.PUT /api/blog/update/:id: update a blog detail with blog idPUT /api/blog/like: toggle like of a blogPUT /api/blog/dislike: toogle dislike of a blogPUT /api/blog/upload/:id: upload images of a blog with blog idDELETE /api/blog/delete/:id: delete a blog detail with blog idDELETE /api/blog/image: delete a image of the blog
POST /api/blog-category: create new blog categoryGET /api/blog-category/:id: get a blog category detail with blog category idGET /api/blog-category: get all blog categories detail.PUT /api/blog-category/:id: update a blog category detail with blog category idDELETE /api/blog-category/:id: delete a blog category detail with blog category id
POST /api/brand: create new brandGET /api/brand/:id: get a brand detail with brand idGET /api/brand: get all brands detail.PUT /api/brand/:id: update a brand detail with brand idDELETE /api/brand/:id: delete a brand detail with brand id
POST /api/enquiry: create new enquiryGET /api/enquiry/:id: get a enquiry detail with enquiry idGET /api/enquiry: get all enquiries detail.PUT /api/enquiry/:id: update a enquiry detail with enquiry idDELETE /api/enquiry/:id: delete a enquiry detail with enquiry id
POST /api/color: create new colorGET /api/color/:id: get a color detail with color idGET /api/color: get all colors detail.PUT /api/color/:id: update a color detail with color idDELETE /api/color/:id: delete a color detail with color id
POST /api/coupon: create new couponGET /api/coupon/:id: get a coupon detail with coupon idGET /api/coupon: get all coupons detail.PUT /api/coupon/:id: update a coupon detail with coupon idDELETE /api/coupon/:id: delete a coupon detail with coupon id
Join us in building! Fork our repository, make changes, and submit pull requests. We value community contributions and appreciate your help in improving our project.
If you have any questions or suggestions regarding this project, feel free to contact us at abhijeetthakur7080@gmail.com.