Giter Club home page Giter Club logo

e-commerce-api's Introduction

E-commerce Api

A REST and GraphQl ecommerce Api using NodeJs , TypeScript , express.js and MySql database with sequelize ORM with Stripe Api for payment method

Main Features

  • User Authentication
  • Adding ,deleting and updating category and product
  • Shopping Cart
  • Order placement with card or cash on delivery payment options

Getting Started

Installation

  1. npm install
  2. Modify the .env file with your configurations

Endpoints

  • REST API

    Endpoint HTTP Method Usage Returns Require Authentication
    /auth/signup PUT accept email, name, password,address and phone number of the user user Id NO
    /auth/login POST accept email and password the JWT token NO
    /admin/create-category POST accept name ,description and image for a category the created product information YES
    /admin/update-category/{categoryId} PUT accept categoryId as parameter and the field which will updated in the body the updated category YES
    /admin/delete-category/{categoryId} DELETE categoryId as parameter success or fail deletion YES
    /admin/create-product POST accept name ,description , image,price and quantity for a product the creted product YES
    /admin/update-product/{productId} PUT accept productId as parameter and the field which will updated in the body the updated product YES
    /admin/delete-product/{productId} DELETE productId as parameter success or fail deletion YES
  • GraphQL The Schema

  1. Mutations
Function Usage
add product to cart addToCart(product: Float!): Cart_item!
delete from cart deleteFromCart(prodId: Float!): Boolean!
place order using cash on delivery option addOrder(address: String = "", cart: Float!, payType: String!, phoneNumber: String = ""): Order!
place order using bank card addOrderUsingCard(address: String = "", cardInfo: CardInput!, cart: Float!, phoneNumber: String = ""): Order!
  1. Queries
Function Usage
get all products using pagination getAllProducts(page: Float = 1): [Product!]!
get all categories using pagination getAllProductCategories(page: Float = 1): [Product_Category!]!
get one product by id getProduct(prodId: Float!): Product!
get one category by id getProductCategory(prodId: Float!): Product_Category!
get cart items getCartItems: CartData!
get order items getOrderItems(orderId: Float!): OrderData!
get orders history getOrdersHistory: [OrderData!]!

e-commerce-api's People

Contributors

ahmedkhames avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.