Skip to content

fairuzazzahra/final-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Final Project (front-end)

tokopedia clone using ReactJS

  • /pages/HomePage.jsx
    list of video thumbnail

  • /pages/VideoDetail.jsx
    detail of video from HomePages.jsx

  • /pages/ProfilePage.jsx
    profil of user

mid-term (back-end)

tokopedia play clone

Database Structure

mid-term drawio

API Structure

List API request and response

#Product

  • Product object
{
  link_product : string,
  title : string,
  price : number
//  video_id : <video_id>
}

GET /product

Return all products in the system.

  • URL Params
    None
  • Data Params
    None
  • Headers
  • Success Response
  • Code: 200
    Content:
{
  products : [
                {<product_object>},
                {<product_object>},
                {<product_object>},
              ]
}
  • Error Response:
    Code: 500
    Content { message : err.message }

GET /product/:id

Return the specified user.

  • URL Params
    Required: id = [integer]
  • Data Params
    None
  • Headers
  • Success Response
  • Code: 200
    Content: {<product_object>}
  • Error Response:
    Code: 500
    Content { message : err.message }

POST /product

Create a new product and return the new object.

  • URL Params
    None
  • Data Params
{
  title : string,
  price : number
}
  • Headers
    Content-Type: ../json
  • Success Response
  • Code: 200
    Content: {<product_object>}
  • Error Response:
    Code: 400
    Content { message : err.message }

PATCH /product/:id

Update field on the specified product and return the updated object.

  • URL Params
    Required: id = [integer]
  • Data Params
{
  linkProduct : string,
  title : string,
  price : number
}
  • Headers
    Content-Type: ../json
  • Success Response
  • Code: 200
    Content: {<product_object>}
  • Error Response:
    Code: 400
    Content { message : err.message }

DELETE /product/:id

Delete the specified product.

  • URL Params
    Required: id = [integer]
  • Data Params
    None
  • Headers
    Content-Type: ../json
  • Success Response
  • Code: 200
    Content: {<product_object>}
  • Error Response:
    Code: 400
    Content { message : err.message }

#Video

  • Video object
{
  url_image : string,
  thumbnail : string
}

GET /video/:id

Return the specified video.

  • URL Params
    Required: id = [integer]
  • Data Params
    None
  • Headers
  • Success Response
  • Code: 200
    Content: {<video_object>}
  • Error Response:
    Code: 500
    Content { message : err.message }

#Comment

  • Comment object
{
  username : string,
  comment : string,
  timestamp,
// video_id : <video_id>
}

GET /comment/:id/comment

Return the specified comment.

  • URL Params
    Required: id = [integer]
  • Data Params
    None
  • Headers
  • Success Response
  • Code: 200
    Content: {<comment_object>}
  • Error Response:
    Code: 500
    Content { message : err.message }

How to run on local device

  1. git clone https://github.com/fairuzazzahra/mid-term
  2. cd mid-term
  3. create .env and adjust the environment value
  4. yarn install
  5. yarn run

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors