Giter Club home page Giter Club logo

e-commerce-backend-api's Introduction

E-Commerce Backend API

  • This is a backend API for an E-Commerce platform built using Node.js. It provides various endpoints for managing products, orders, users, and authentication.

Features

  • Product Management: CRUD operations for managing products.
  • Order Management: Create, read, update, and delete orders.
  • User Management: Register, login, and manage user accounts.
  • Authentication: JWT-based authentication for securing API endpoints.
  • Validation: Input validation and error handling.
  • Authorization: Role-based access control for restricting endpoints based on user roles.
  • Database: Integration with MongoDB for data storage.

Technologies Used

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • JSON Web Tokens (JWT) for authentication
  • bcrypt for password hashing
  • Helmet for security headers

Installation

  1. Clone the repository:
git clone https://github.com/Gichbuoy/E-Commerce-Backend-API.git
  1. Navigate to the project directory:
cd E-Commerce-Backend-API
  1. Install dependencies
npm install
  1. Set up environment variables by creating a .env file and adding the following variables:
PORT=3000
MONGOCOMPASS=<your-mongodb-uri>
JWT_SECRET=<your-jwt-secret>
  1. Start the server
npm start

Usage

Once the server is running, you can access the API endpoints using tools like Postman or Insomnia or directly from the Frontend application.

Screenshots

Connection to mongoDB

Screenshot1

User Login

Screenshot1

Registering new User

Screenshot1

Blocking a User

Screenshot1

Refresh Token for Authentication

Screenshot1

Create new Product

Screenshot1

Declare the data schema for MongoDB Model

Screenshot1

Products fetched from mongoDB Compass

Screenshot1

Get Products by ID

Screenshot1

Get All Products

Screenshot1

API Endpoints

For detailed information about the available endpoints, refer to the API Documentation.

Authentication

Authentication is required for certain endpoints. To authenticate, include a JWT token in the request headers:

To obtain a JWT token, you must first register as a user and then login using your credentials.

License

This project is licensed under the MIT License - see the LICENSE file for details.

e-commerce-backend-api's People

Contributors

gichbuoy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.