Skip to content

An API for e-commerce works, built using NodeJS & MongoDB for personal shop

Notifications You must be signed in to change notification settings

vc8bp/shop-api-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


shop API

built with NodeJS & MongoDB

Contents
  1. Demo

  2. Key Features

  3. Build With
  4. To Do

  5. Installation

  6. Known Bugs

  7. Contact

Deployed Version

Live demo (Feel free to visit) 👉 : Shop API

Key Features

  • Authentication

    • Login [Public]
    • SignUp [Public]
    • Tokens [User]
  • Password Management

    • Change Password [User]
    • Forgot Password [Public]
    • Reset Password [Public]
  • Email Management

    • Send Email for forgot password [User]
  • User

    • Create New User [Admin]
    • Get All Users [Admin]
    • Get User Data Using It's ID [Public]
    • Update User Details Using It's ID [User]
    • Delete User Using It's ID [Admin]
  • Cart Services

    • Add Product To Cart [User]
    • Get Cart [User]
    • Delete Cart Item [User]
    • Delete Cart [User]
  • Product Services

    • Search products using Keywords [Public]
    • Query products using Category [Public]
    • filter product Products by price, date, popularity[Public]
    • Query Product Using It's ID [Public]
    • Create new product [Seller]
    • Update Product Details [Seller]
    • Delete Product Using It's ID [User]
  • Order Services

    • Create New Order [User]
    • Query Orders [User]
    • Query Order Using It's ID [User]
    • Update Order Status [Admin]
    • get all Orders [Admin]
  • Category Services

    • Create New Category [User]
    • Query Categories [Public]
    • Query Category Using It's ID [Public]
    • Update Category Details [Admin]
    • Delete Category [Admin]
  • Address

    • create Addres[user]
    • update address[user]
    • get address[user]
  • payment

    • verify Payment

Built With

List of any major frameworks used to build the project.

  • NodeJS - JS runtime environment

  • ExpressJS - The NodeJS framework used

  • MongoDB - NoSQL Database uses JSON-like documents with optional schemas

  • Mongoose - Object Data Modeling (ODM) library for MongoDB and NodeJS

  • Cors - NodeJS package for providing a Connect/Express middleware that can be used to enable CORS with various options

  • Dotenv - Loads environment variables from a . env file into process. env

  • jsonwebtoken - Compact URL-safe means of representing claims to be transferred between two parties

  • Nodemailer - Easy as cake e-mail sending from your Node.js applications

  • Razorpay - The razorpay Node library provides convenient access to the razorpay API from applications written in server-side JavaScript.

  • crypto-js - crypto-js which deals with an algorithm that performs data encryption and decryption. This is used for security purpose like user authentication where storing the password in Database in the encrypted form

  • nanoid - Nano ID is nano-sized unique string ID generator for JavaScript. It's truly small (130 bytes minified), URL-friendly

To-do

  • manage Product Quanti

  • Add Product Color

  • Add Product Size

  • Delete Product Color

  • Delete Product Size

  • Add pagination

  • add favorites

  • add analytics for products

Installation

You can fork the app or you can git-clone the app into your local machine. Once done that, please install all the

dependencies by running

install al the dependencies

$ npm install

setup .env

This file contains the configuration for the environment variables used in this project. You will need to set the values for these variables in order to start the application.

#server  
PORT: The port on which the server will run.
BASE_FRONTEND_URL: The base URL for the frontend server.
BASE_BACKEND_URL: The base URL for the backend server.

#database
MONGODB_URL: The URL for the MongoDB database. This is used to connect to the

#authentication
JWT_SECRET_EXPIRE: The number of seconds after which JWTs will expire.
JWT_SECRET_KEY: The secret key used for signing and verifying JSON Web Tokens
CRYPTOJS_SECRET_KEY: The secret key used for encrypting and decrypting

#payment 
RAZORPAY_KEY_SECRET: The Key Secret for the Razorpay payment gateway.
RAZORPAY_KEY_ID: The Key ID for the razorpay payment gateway.

email
EMAIL_PASSWORD: The password for the email account being used to send emails.
EMAIL_USERNAME: The username for the email account being used to send emails.
EMAIL_FROM: The email address that the emails will be sent from.
MAIL_SERVICE: The mail service used for sending emails ex. gmail.

Start server

$ npm run start

Docker Installation

You can fork the app or you can git-clone the app into your local machine.

Note:Set the environment variables up to date and setup the database environment and also you need install docker on your local machine


$ docker build -t shopapi .

$ docker run --publish 4000:4000 shopapi

Known Bugs

Feel free to email me at [email protected] if you run into any issues or have questions, ideas or concerns.

Please enjoy and feel free to share your opinion, constructive criticism, or comments about my work. Thank you! 🙂

Contact

Email - [email protected]

Project: https://github.com/vc8bp/shop-api-backend