Skip to content

defdf/USocks_Backend

Repository files navigation

API for a E-commerce store USocks.

Application is implemeted with Express, main functionalities of this application including:
  • User APIs, including client and admin, with authenticationa and authorization middleware.
  • Product and search APIs.
  • Order APIs.

User APIs

  • Get all users
    /user

  • Get one user
    /user/:username

  • Login user
    /user/login
    Takes JSON body of:
    usernameOrEmail: string
    password: string

      Returns token: string
    
  • Create User
    /user
    Takes JSON body of minimun:
    username: string,
    email: string,
    password: string,
    firstName: string(optional),
    lastName: string(optional),

      Returns user: JSON object    
    
  • Update user
    /user/:username
    REQUIRES Authorization header with bearer token
    Takes JSON body of:
    updateField:
    options = email: string,
    firstName: string,
    lastName: string
    newValue: string

      Returns User JSON object     
    
  • Delete a User
    /user/:username
    REQUIRES Authorization header with bearer token

Order APIs

  • Get all orders
    /order

  • Get one order
    /order/:id

  • Delete an order
    /order/:id

  • Get all orders of an user
    /user/:username/order

  • Get one order of an user
    /user/:username/order/:orderId

  • Create an order for an user
    /user/:username/order
    Takes JSON body:
    dateTime: DateTime,
    totalPrice: int,
    items:[{id: int, size: string, qty: int, unitPrice: int}]

      Returns Order JSON object  
    

Sock APIs

  • Get all socks
    /sock

  • Get single sock
    /sock/:id

  • Get three top sold socks
    /sock/top/picks

  • Upload a sock
    /sock
    Takes JSON body of minimum:
    name: string,
    price: int,
    imageUrl: string
    OPtions:
    description: string,
    category: string,
    size_qty: JSON

      Returns Sock JSON object    
    
  • Delete a sock

Search API

  • Search socks
    /sock/search/:keywords

Category APIS

  • Get all socks of men
    sock/category/men
  • Get all socks of women
    sock/category/women
  • Get all socks of kids
    sock/category/kids
  • Get all socks of gifts
    sock/category/gifts

About

Nodejs Express API Backend for USocks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages