SwipeCart is a full-stack E-commerce platform built using MERN stack with TailwindCSS and MUI as UI-toolkit.
-
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.
Watch the video demonstration of the same:
https://youtu.be/icyQ7u3b87c?si=SHoRcXrXUfAIUSLG
Follow the steps below to install and run the project.
Make sure you have the following installed on your machine:
- Node.js (which includes npm)
First, clone the repository to your local machine using git
.
git clone https://github.com/Sumitkevlani/SwipeCart.git
cd SwipeCart
cd frontend
npm install
npm run dev
cd backend
npm install
npm run dev
POST /api/user/register
Parameter | Type | Description |
---|---|---|
name |
string |
Required |
email |
string |
Required |
password |
string |
Required |
avatar |
file |
Not Required |
POST /api/user/login
Parameter | Type | Description |
---|---|---|
email |
string |
Required |
password |
string |
Required |
GET /api/user/logout
GET /api/user/forgot-password
Parameter | Type | Description |
---|---|---|
email |
string |
Required |
PUT /api/user/password/reset/:token
Parameter | Type | Description |
---|---|---|
password |
string |
Required |
confirmPassword |
string |
Required |
GET /api/product/get-all-products
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 |
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 /api/product/admin/delete-product/:product-id
GET /api/product/get-product-details/:product-id
GET /api/product/get-product-details?keyword={keyword}
GET /api/product/get-all-products?ratings[gte]={rating}
GET /api/product/get-all-products?page={page}
GET /api/user/admin/get-user/:user-id
DELETE /api/user/admin/delete-user/:user-id
PUT /api/user/admin/update-role/user-id
Parameter | Type | Description |
---|---|---|
name |
string |
Required |
email |
string |
Required |
role |
string |
Required |
GET /api/user/admin/get-all-users
PUT /api/user/update-profile
Parameter | Type | Description |
---|---|---|
name |
string |
Required |
email |
string |
Required |
avatar |
file |
Required |
PUT /api/user/update-password
Parameter | Type | Description |
---|---|---|
oldPassword |
string |
Required |
newPassword |
string |
Required |
confirmPassword |
string |
Required |
GET /api/user/profile
PUT /api/product/reviews
Parameter | Type | Description |
---|---|---|
rating |
number |
Required |
comment |
string |
Required |
productId |
objectId |
Required |
name |
string |
Required |
GET /api/product/reviews?id={reviewId}
DELETE /api/product/reviews?id={reviewId}&productId={productId}
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 /api/product/admin/get-single-order/:orderId
GET /api/order/get-my-orders
GET /api/order/admin/get-all-orders
PUT /api/order/admin/update-order/:orderId
Parameter | Type | Description |
---|---|---|
status |
string |
Required |
DELETE /api/order/admin/delete-order/:orderId
POST /api/payment/process-payment
Parameter | Type | Description |
---|---|---|
amount |
number |
Required |
GET /api/payment/stripeapikey
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