Skip to main content

Swift Cart

SwiftCart is a robust e-commerce backend built using NodeJS, ExpressJS, and Mongoose, designed to streamline online retail operations. It offers a comprehensive set of APIs for managing users, products, orders, and more, providing essential functionalities like user authentication, cart management, and order processing. This backend solution ensures scalability and efficiency for modern e-commerce applications.

Tech-stack

  • Node.js
  • Mongoose
  • Express
  • MongoDB
  • Postman

API - Routes

User

Sr. No.DescriptionRequest TypeEndpoint
1User RegistrationPOST/api/user/register
2Forgot Password TokenPOST/api/user/forgot-password-token
3Reset PasswordPUT/api/user/reset-password/:token
4Update PasswordPUT/api/user/password
5User LoginPOST/api/user/login
6Admin LoginPOST/api/user/admin-login
7User CartPOST/api/user/cart
8Apply Coupon to CartPOST/api/user/cart/applycoupon
9Place Cash OrderPOST/api/user/cart/cash-order
10Get All UsersGET/api/user/all-users
11Get User OrdersGET/api/user/get-orders
12Get All OrdersGET/api/user/getallorders
13Get Orders by UserPOST/api/user/getorderbyuser/:id
14Refresh TokenGET/api/user/refresh
15LogoutGET/api/user/logout
16Get WishlistGET/api/user/wishlist
17Get User CartGET/api/user/cart
18Get User by IDGET/api/user/:id
19Empty User CartDELETE/api/user/empty-cart
20Delete UserDELETE/api/user/:id
21Update OrderPUT/api/user/order/update-order/:id
22Edit UserPUT/api/user/edit-user
23Save User AddressPUT/api/user/save-address
24Block UserPUT/api/user/block-user/:id
25Unblock UserPUT/api/user/unblock-user/:id

Blog Category

Sr. No.DescriptionRequest TypeEndpoint
1Create Blog CategoryPOST/api/blogcategory/
2Update Blog CategoryPUT/api/blogcategory/:id
3Delete Blog CategoryDELETE/api/blogcategory/:id
4Get Blog Category by IDGET/api/blogcategory/:id
5Get All Blog CategoriesGET/api/blogcategory/

Blog

Sr. No.DescriptionRequest TypeEndpoint
1Create BlogPOST/api/blog/
2Update Blog ContentPUT/api/blog/upload/:id
3Like BlogPUT/api/blog/likes
4Dislike BlogPUT/api/blog/dislikes
5Update BlogPUT/api/blog/:id
6Get Blog by IDGET/api/blog/:id
7Get All BlogsGET/api/blog/
8Delete BlogDELETE/api/blog/:id

Brand

Sr. No.DescriptionRequest TypeEndpoint
1Create BrandPOST/api/brand/
2Update BrandPUT/api/brand/:id
3Delete BrandDELETE/api/brand/:id
4Get Brand by IDGET/api/brand/:id
5Get All BrandsGET/api/brand/

Category

Sr. No.DescriptionRequest TypeEndpoint
1Create CategoryPOST/api/category/
2Update CategoryPUT/api/category/:id
3Delete CategoryDELETE/api/category/:id
4Get Category by IDGET/api/category/:id
5Get All CategoriesGET/api/category/

Color

Sr. No.DescriptionRequest TypeEndpoint
1Create ColorPOST/api/color/
2Update ColorPUT/api/color/:id
3Delete ColorDELETE/api/color/:id
4Get Color by IDGET/api/color/:id
5Get All ColorsGET/api/color/

Coupon

Sr. No.DescriptionRequest TypeEndpoint
1Create CouponPOST/api/coupon/
2Get All CouponsGET/api/coupon/
3Get Coupon by IDGET/api/coupon/:id
4Update CouponPUT/api/coupon/:id
5Delete CouponDELETE/api/coupon/:id

Enquiry

Sr. No.DescriptionRequest TypeEndpoint
1Create EnquiryPOST/api/enquiry/
2Update EnquiryPUT/api/enquiry/:id
3Delete EnquiryDELETE/api/enquiry/:id
4Get Enquiry by IDGET/api/enquiry/:id
5Get All EnquiriesGET/api/enquiry/

Product

Sr. No.DescriptionRequest TypeEndpoint
1Get All ProductsGET/api/product/
2Get Product by IDGET/api/product/:id
3Add to WishlistPUT/api/product/wishlist
4Rate ProductPUT/api/product/rating
5Create ProductPOST/api/product/
6Update ProductPUT/api/product/:id
7Delete ProductDELETE/api/product/:id

Upload Images

Sr. No.DescriptionRequest TypeEndpoint
1Delete Uploaded ImageDELETE/api/upload/delete-img/:id

List of ENVs

  • MONGODB_URI
  • JWT_SECRET
  • SMTP_HOST
  • SMTP_EMAIL
  • SMTP_PASSWORD

GitHub Repo