Skip to content

Swipecart is a MERN stack E-commerce project with Tailwind CSS and MUI Toolkit. It features secure user authentication, easy product search and pagination, detailed product pages, and a seamless cart experience. With StripeJS integration, payments are secure. Swipecart simplifies online shopping, offering a smooth, user-friendly interface.

Notifications You must be signed in to change notification settings

Sumitkevlani/SwipeCart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SwipeCart

SwipeCart is a full-stack E-commerce platform built using MERN stack with TailwindCSS and MUI as UI-toolkit.

Features

  • Secure user authentication and session storage using jwt-tokens.

  • Product catalogs with search, filter and pagination functionalities.

  • Detailed product description with add to cart functionality.

  • Secure product checkout and payment gateway with Stripejs.

Demo

Watch the video demonstration of the same:

https://youtu.be/icyQ7u3b87c?si=SHoRcXrXUfAIUSLG

Installation

Follow the steps below to install and run the project.

Prerequisites

Make sure you have the following installed on your machine:

Clone the Repository

First, clone the repository to your local machine using git.

git clone https://github.com/Sumitkevlani/SwipeCart.git
cd SwipeCart

For frontend

  cd frontend
  npm install
  npm run dev

For backend

  cd backend
  npm install
  npm run dev

API Reference

Register user

  POST /api/user/register
Parameter Type Description
name string Required
email string Required
password string Required
avatar file Not Required

Login user

  POST /api/user/login
Parameter Type Description
email string Required
password string Required

Logout user

  GET /api/user/logout

Forgot password

  GET /api/user/forgot-password
Parameter Type Description
email string Required

Reset password

  PUT /api/user/password/reset/:token
Parameter Type Description
password string Required
confirmPassword string Required

Get all products

  GET /api/product/get-all-products

Create a new product(Admin only)

  POST /api/product/admin/create-product/new
Parameter Type Description
name string Required
description string Required
price number Required
ratings number Not Required
images array Not Required
category string Required
Stock number Required
numOfReviews number Required
reviews array Not Required

Update product details(Admin only)

  PUT /api/product/admin/update-product/:product-id
Parameter Type Description
name string Required
description string Required
price number Required
ratings number Not Required
images array Not Required
category string Required
Stock number Required
numOfReviews number Required
reviews array Not Required

Delete a product(Admin only)

  DELETE /api/product/admin/delete-product/:product-id

Get a specific product

  GET /api/product/get-product-details/:product-id

Search a product

  GET /api/product/get-product-details?keyword={keyword}

Filter a product

  GET /api/product/get-all-products?ratings[gte]={rating}

Pagination

  GET /api/product/get-all-products?page={page}

Get a user(Admin only)

  GET /api/user/admin/get-user/:user-id

Delete a user(Admin only)

  DELETE /api/user/admin/delete-user/:user-id

Update user role(Admin only)

  PUT /api/user/admin/update-role/user-id
Parameter Type Description
name string Required
email string Required
role string Required

Get all users(Admin only)

  GET /api/user/admin/get-all-users

Upate Profile

  PUT /api/user/update-profile
Parameter Type Description
name string Required
email string Required
avatar file Required

Upate password

  PUT /api/user/update-password
Parameter Type Description
oldPassword string Required
newPassword string Required
confirmPassword string Required

Get profile

  GET /api/user/profile

Create or update reviews

  PUT /api/product/reviews
Parameter Type Description
rating number Required
comment string Required
productId objectId Required
name string Required

Get all reviews

  GET /api/product/reviews?id={reviewId}

Delete a review

  DELETE /api/product/reviews?id={reviewId}&productId={productId}

Create a new order

  POST /api/product/admin/create-product/new
Parameter Type Description
shippingInfo object Required
orderItems array Required
paymentInfo object Required
itemsPrice number Required
taxPrice number Required
shippingPrice number Required
totalPrice number Required

Get single order(Admin only)

  GET /api/product/admin/get-single-order/:orderId

Get user specific order details

  GET /api/order/get-my-orders

Get all orders(Admin only)

  GET /api/order/admin/get-all-orders

Update order status(Admin only)

  PUT /api/order/admin/update-order/:orderId
Parameter Type Description
status string Required

Delete order(Admin only)

  DELETE /api/order/admin/delete-order/:orderId

Process a payment

  POST /api/payment/process-payment
Parameter Type Description
amount number Required

Get Stripe API Key

  GET /api/payment/stripeapikey

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

PORT

MONGO_URI

SECRET_KEY

EXPIRE_TIME

COOKIE_EXPIRE

SMTP_HOST

SMTP_PORT

SMTP_USER

SMTP_PASSWORD

CLOUDINARY_NAME

CLOUDINARY_APIKEY

CLOUDINARY_APISECRET

STRIPE_PUBLISHABLE_KEY

STRIPE_SECRET_KEY

πŸ”— Links

linkedin

twitter

About

Swipecart is a MERN stack E-commerce project with Tailwind CSS and MUI Toolkit. It features secure user authentication, easy product search and pagination, detailed product pages, and a seamless cart experience. With StripeJS integration, payments are secure. Swipecart simplifies online shopping, offering a smooth, user-friendly interface.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published