Git Product home page Git Product logo

freebie-backend's Introduction

Backend For FreeBie Ecommerce Site

npm install

configure your environment variables

CLOUD_NAME="<cloudinary_cloud_name>"
API_KEY="<cloudinary_api_key>"
API_SECRET="<cloudinary _secret_key>"
ENVIRONMENT=DEVELOPEMENT
JWT_SECRET_KEY="<jwt_secret>"

Endpoints

Products

  • all products GET: api/products
  • pagination GET: api/products?page=1
  • single product GET: api/products/:id
  • create product POST: /api/products authenticated route
  • update product PUT: api/products/id authenticated route
  • delete image PUT: api/products/id/image_index authenticated route
  • delete products DELETE: api/products/:id authenticated route
{
  "data": [
    {
      "id": "5ed007e74c2e14358da8769c",
      "name": "Night Warmer",
      "cost": 125.29,
      "shortDescription": "Best fit for children",
      "images": [
        {
          "id": "5ed007e74c2e14358da8769d",
          "img": "http://url",
          "public_id": "zn51zaymevilamrhsldn"
        }
      ],
      "createdBy": "5ecfd651cc958c255f2412c8",
      "createdAt": "2020-05-28T18:50:15.886Z",
      "updatedAt": "2020-05-28T18:50:15.886Z"
    }
  ],
  "page": 0
}

Orders

  • create Order POST api/orders
  • get all Order GET api/orders authenticated route
  • get single Order GET api/orders/id
  • delete Order DELETE api/orders/id authenticated route
{
  "products": [{ "product": "5ea9a67b92b43d55feebbdd5", "qty": 5 }],
  "shippingDetails": {
    "fullName": "jathan",
    "location": "Lagos",
    "email": "[email protected]",
    "phoneNumber": "+3430903455366",
    "city": "Ikeja"
  },
  "shippingLocation": "Abuja"
}

Admin

  • signup POST: signup
  • login POST: login
  • get users GET api/users authenticated route
//signup
{
	"email":"[email protected]",
	"password":"******",
	"name":"Jonathan"
}
//login
{
	"email":"[email protected]",
	"password":"******"
}
//response
{
  "data": "jwt_token"
}

Dashboard Routes

freebie-backend's People

Contributors

bemijonathan avatar

Stargazers

 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.