Skip to content

Dat10496/Final-project-BE

Repository files navigation

Sneaker Store

Sneaker Store is a place where you can find and buy for your ambition sneakers that you need

You can go to page via https://sneaker-store-dat.netlify.app/

Description

In this app, you can search, get information and make a payment for this sneaker if you love it

User can login faster by google account, and make a payment online via paypal. After user make a payment successfully user will receive a information mail about this purchase

As a owner shop, i use adminjs dashboard which owner easily manage the products, user and the payment with CRUD

Admin page: https://sneaker-app-api.onrender.com/admin/login

User Story

  • As a user, you can get and select items

  • As a admin page, you can edit, upload, get , delete your items

Authentication

  • As a user, i can register and login with name, email, password
  • As a admin shop, i can register and login with name, email, password

Users

  • As a user, i can see list of items
  • As a user, i can update my profile

Admin

  • As a admin shop, i can edit item
  • As a admin shop, i can create new item
  • As a admin shop, i can delete the item
  • As a admin shop, i can get list of items

Items

  • As a user and admin, i can get list of items
  • As a user and admin, i can get detail of item

Endpoint APIs

Auth APIs

/**
 * @route POST /users/login
 * @description Login with username and password
 * @body {email, password}
 * @access Public
 * /

Auth Google APIs

/**
 * @route POST /auth/google/login/success
 * @description Get user's information after login by google
 * /
/**
 * @route GET /auth/google/login/failed
 * @description Response if login error
 * /
/**
 * @route GET /auth/google
 * @description Direct to login google page
 * /
/**
 * @route GET /auth/google/callback
 * @description Receive google'response after login via google account
 * /

Users APIs

/**
 * @route POST /users
 * @description Register new user
 * @body {name, email, password}
 * @access Public
 * /
/**
 * @route GET /users/me
 * @description Get current user Info
 * @access Login required
 * /
/**
 * @route PUT /users
 * @description Update user's profile
 * @body {name, phoneNumber, address}
 * @access Login required
 * /
/**
 * @route PUT /users/addcart
 * @description Add product to user's cart
 * @access Login required
 * /
/**
 * @route GET /users/history
 * @description Get payment'history
 * @access Login required
 * /

Payment APIs

/**
 * @route GET /payment
 * @description Get payment's detail
 * @access Login
 * /
/**
 * @route POST /payment
 * @description Post info of user's payment
 * @access Login
 * /

Items

/**
* @route GET /items?page=1&limit=20
* @description Get item with pagination
* @access Public
* /
/**
* @route GET /items/:id
* @description Get the item's detail
* @access Public
* /

Diagram Relation

diagram image