Skip to content

AbdulrahmanIsmailMohamed/Nodejs-E-Commerce-API

Repository files navigation


Node.js Ecommerce API

Ecommerce API built using NodeJS & Express & MongoDB

Table of Contents
  1. Demo
  2. File Structure
  3. Key Features
  4. Deployment
  5. Build With
  6. Installation
  7. Known Bugs
  8. Contributing
  9. Contact

file structure

GitHub Logo

Deployed Version

Live demo (Feel free to visit) 👉 : Node.js E-commerce Api

Environment Variables

 

PORT = 3333
NODE_ENV = development
API = /api/v1
MONGO_URL = url
JWT_SEC = 
JWT_EXPIRE = 
MAILER_USER = 
MAILER_PASS = 
MAILER_HOST = smtp.gmail.com
MAILER_PORT = 465
STRIP_SECRET = 
WEBHOOK_SECRET = 
CSRF_SEC = 
SESSION_SEC = 

 

Key Features

  • Authentication
    • Login [Public]
    • SignUp [Public]
    • Tokens [User]
  • Password Management
    • Change Password [User]
    • Forgot Password [Public]
    • Reset Password [Public]
  • Email Management
    • Send the verification code to change the password [Public]
  • User
    • Create New User [Admin]
    • Get All Users [Admin]
    • Get User Data Using It's ID [Admin]
    • Update User Profile Image Using It's ID [User]
    • Inactive my account [user]
  • Cart Services
    • Add Product To Cart [User]
    • Reduce Product Quantity By One [User]
    • Increase Product Quantity By One [User]
    • Get Cart [User]
    • Delete Cart Item [User]
    • Delete Cart [User]
    • Apply Coupon [User]
  • Review Services
    • Create New Review [User]
    • Query All Reviews [Public]
    • Query Review Using It's ID [Public]
    • Update Review Using It's ID [User]
    • Delete Review Using It's ID [User, Admin]
  • Product Services
    • Query products [Public]
    • Query Product Using It's ID [Public]
    • Create new product [Admin]
    • Update Product Details [Admin]
    • Update Product Main Image [Admin]
    • Update Product Images [Admin]
    • Delete Product Using It's ID [Admin]
  • Wishlist Services
    • Get Wishlist Products List [User]
    • Add Product to Wishlist [User]
    • Delete Product From Wishlist List [User]
  • Discount Services
    • Generate Discount Code [Admin]
    • Get Dicount Amount [User]
    • Get All Discount Codes [Admin]
    • Update Discount Code [Admin]
    • Verify Discount Code [User]
    • Delete Discount Code [Admin]
    • Cancel Discount Code [User]
  • Order Services
    • Create New Order [User]
    • Query Orders [User, Admin]
    • Query Order Using It's ID [User, Aadmin]
    • Cancel Order [User]
    • Update Order Status To Paid [Admin]
    • Update Order Status To Delivere [Admin]
    • Create Checkout Session [User]
  • Category Services
    • Create Category [Admin]
    • Create Category Image [Admin]
    • Query Categories [Public]
    • Query Category Using It's ID [Public]
    • Update Category Details [Admin]
    • Update Category Image [Admin]
    • Delete Category [Admin]
    • Get SubCategory By Category Id [Public]
  • Sub-Category
    • Create Sub-Category [Admin]
    • Query Sub-Categories [Public]
    • Query Sub-Category Using It's ID [Public]
    • Update Sub-Category Details [Admin]
    • Delete Sub-Category [Admin]
  • Brand
    • Create Brand [Admin]
    • Upload Image Brand [Admin]
    • Query Brands [Public]
    • Update Brand [Admin]
    • Update Image Brand [Admin]
    • Delete Brand [Admin]
    • Get Brand Using It's Id [Public]
  • Address
    • Create Address [User]
    • Get Logged User Addresses [User]
    • Delete Address [User]

Deployment

The API is deployed with git into Cyclic. Below are the steps taken:

git init
git add -A
git commit -m "Commit message"

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
  • Bcrypt - Encryption & Decryption Algorithm
  • Compression - NodeJS compression middleware
  • Cors - NodeJS package for providing a Connect/Express middleware that can be used to enable CORS with various options
  • HPP - provides middleware for Express.js web applications to protect against HTTP Parameter Pollution attacks
  • SHARP - image processing and manipulation in Node.js. It is a high-performance image processing library that can be used to resize, crop, rotate, and convert images to different formats.
  • UUID - generating universally unique identifiers (UUIDs) in Node.js. UUIDs are 128-bit unique identifiers that can be used to identify objects, entities, or resources in distributed systems.
  • Express Mongo Sanitize - Express 4.x middleware which sanitizes user-supplied data to prevent MongoDB Operator Injection.
  • Espress-Session - managing user sessions in Express.js web applications.
  • CSRF - this package provide middleware that can be protect against CSRF attacks
  • Slugify - Slugifies a string
  • Dotenv - Loads environment variables from a . env file into process. env
  • Rate Limiter - Basic IP rate-limiting middleware for Express
  • Helmet - Secure Express apps by setting various HTTP headers
  • JWT - Compact URL-safe means of representing claims to be transferred between two parties
  • Morgan - HTTP request logger middleware for NodeJS
  • Multer - NodeJS middleware for handling multipart/form-data
  • Nodemailer - Easy as cake e-mail sending from your Node.js applications
  • Express-Validator - A library of string validators and sanitizers.
  • Winston - A logger for just about everything.
  • XSS Clean - Middleware to sanitize user input
  • connect-mongodb-session - provides a MongoDB session store for the popular session middleware express-session. This allows you to store session data in a MongoDB database rather than in memory
  • Stripe - The Stripe Node library provides convenient access to the Stripe API from applications written in server-side JavaScript.
  • Eslint - provides a pluggable linting utility for JavaScript. Linting is the process of checking source code for potential errors, code style issues, and other problems.

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

$ npm install
set your env variables
$ npm run start:dev

Known Bugs

Feel free to email me at abdulrahman.ismail.mohammed@gmail.com if you run into any issues or have questions, ideas or concerns.n 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 - [abdulrahman.ismail.mohammed@gmail.com]

LinkedIN - Abdulrahman Ismail

Project: https://github.com/AbdulrahmanIsmailMohamed/Nodejs-E-Commerce-API

About

Build a Full Nodejs E-Commerce RESTful APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published