Skip to content

amir-ammar/E-Commerce-API

Repository files navigation


Ecommerce API

E-commerce API built using NodeJS & MongoDB

Table of Contents
  1. Demo
  2. Key Features
  3. API Usage
  4. Deployment
  5. Build With
  6. To Do

Description

It's a simple api for e-commerce websites

Project structure

.
├── app.js
├── controllers
│   ├── authController.js
│   ├── orderController.js
│   ├── productController.js
│   ├── reviewController.js
│   └── userController.js
├── db
│   └── connect.js
├── errors
│   ├── bad-request.js
│   ├── custom-api.js
│   ├── index.js
│   ├── not-found.js
│   ├── unauthenticated.js
│   └── unauthorized.js
├── middleware
│   ├── authentication.js
│   ├── error-handler.js
│   ├── full-auth.js
│   └── not-found.js
├── mockData
│   ├── orders.json
│   └── products.json
├── models
│   ├── Order.js
│   ├── Product.js
│   ├── Review.js
│   ├── temp.js
│   └── User.js
├── package.json
├── package-lock.json
├── Procfile
├── public
│   └── uploads
│       └── computer-1.jpeg
├── README.MD
├── routes
│   ├── authRoutes.js
│   ├── orderRoutes.js
│   ├── productRoutes.js
│   ├── reviewRoutes.js
│   └── userRoutes.js
├── swagger.yaml
└── utils
    ├── checkPermission.js
    ├── createTokenUser.js
    ├── index.js
    └── jwt.js

Deployed Version

Live demo (Feel free to visit) 👉 : E-commerce API

Key Features

  • Authentication
    • Login [Public]
    • SignUp [Public]
    • Logout [User]
    • Tokens [User]
  • Password Management
    • Change Password [User]
    • Forgot Password [Public]
    • Reset Password [Public]
  • Email Management
    • Send Email Verification [User]
  • User
    • Create New User [Admin]
    • Get All Users [Public]
    • Get User Data Using It's ID [Public]
    • Update User Details Using It's ID [User]
    • Update User Profile Image Using It's ID [User]
    • Delete My Account [User]
    • Delete User Using It's ID [Admin]
  • 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]
  • 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]
  • Product Services
    • Query products [Public]
    • Query Product Using It's ID [Public]
    • Create new product [Seller]
    • Update Product Details [Seller]
    • Update Product Main Image [Seller]
    • Update Product Images [Seller]
    • Delete Product Using It's ID [User]
    • Get Products Statics [Admin]
    • Top 5 Cheapeast Products [Public]
    • Add Product Color [Seller]
    • Add Product Size [Seller]
    • Delete Product Color [Seller]
    • Delete Product Size [Seller]
  • Favorite Services
    • Get Favorite Products List [User]
    • Add Product to Favorite List [User]
    • Delete Product From Favorite List [User]
    • Check If Product In Favorite List [User]
  • Discount Services
    • Generate Discount Code [Admin]
    • Get Dicount Amount [User]
    • Get All Discount Codes [Admin]
    • Verify Discount Code [User]
    • Delete Discount Code [Admin]
    • Cancel Discount Code [User]
  • Order Services
    • Create New Order [User]
    • Query Orders [User]
    • Query Order Using It's ID [User]
    • Cancel Order [User]
    • Update Order Status [Admin]
  • Category Services
    • Create New Category [User]
    • Query Categories [Public]
    • Query Category Using It's ID [Public]
    • Update Category Details [Admin]
    • Update Category Image [Admin]
    • Delete Category [Admin]
  • Multi-Language Support

API Usage

Check Ecommerce API Documentation for more info.

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
  • Argon2 - Encryption & Decryption Algorithm
  • Cloudinary - Cloud-based service
  • Compression - NodeJS compression middleware
  • Cors - NodeJS package for providing a Connect/Express middleware that can be used to enable CORS with various options
  • Express Mongo Sanitize - Express 4.x middleware which sanitizes user-supplied data to prevent MongoDB Operator Injection.
  • Slugify - Slugifies a string
  • Datauri - Create DataURI scheme easily
  • 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
  • Method Override - Use HTTP verbs such as PUT or DELETE in places where the client doesn't support it.
  • Moment - JavaScript library which helps is parsing, validating, manipulating and displaying date/time in JavaScript in a very easy way
  • 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
  • Validator - A library of string validators and sanitizers.
  • Winston - A logger for just about everything.
  • XSS Clean - Middleware to sanitize user input
  • Stripe - The Stripe Node library provides convenient access to the Stripe API from applications written in server-side JavaScript.
  • Express Locale - Express middleware to determine the locale identifier of the incomming request.
  • Node Polyglot - It provides a simple solution for interpolation and pluralization, based off of Airbnb’s experience adding I18n functionality to its Backbone.js and Node apps.

To-do

  • Using MicroServices with Event-Driven.

  • Using TypeScript.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published