pahrurozidev / Car-Management-Dashboard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Car Management Dashboard

Entity Relationship Diagram

Get All Cars

[ENDPOINT] /api/v1/cars

[GET] http://localhost:5000/api/v1/cars

Sample Response

{
  "status": true,
  "data": [
    {
      "id": 1,
      "name": "Avanza",
      "image": "avanza-pic.png",
      "price": 1,
      "size": "small",
      "createdAt": "2022-10-05T00:34:58.950Z",
      "updatedAt": "2022-10-05T00:34:58.950Z"
    },
    ...
  ]
}

Get One Car

[ENDPOINT] /api/v1/cars/{id}

[GET] http://localhost:5000/api/v1/cars/1

Sample Response

 {
    "id": 1,
    "name": "Avanza",
    "image": "avanza-pic.png",
    "price": 1,
    "size": "small",
    "createdAt": "2022-10-05T00:34:58.950Z",
    "updatedAt": "2022-10-05T00:34:58.950Z"
}

Create Car

[ENDPOINT] /api/v1/cars

[POST] http://localhost:5000/api/v1/cars

Sample Request

{
  "name": String,
  "image": String,
  "price": Integer,
  "size": String,
}

Sample Response

{
  "status": true,
  "data": {
      "id": 2,
      "name": "Avanza X",
      "image": "avanza-pic-x.png",
      "price": 1,
      "size": "small",
      "createdAt": "2022-10-05T00:34:58.950Z",
      "updatedAt": "2022-10-05T00:34:58.950Z"
  }
}

Update Car

[ENDPOINT] /api/v1/cars/{id}

[PUT] http://localhost:5000/api/v1/cars/1

Sample Request

{
  "name": String,
  "image": String,
  "price": Integer,
  "size": String,
}

Sample Response

{
  "status": true,
  "message": "Car has been successfully updated"
}

Delete Car

[ENDPOINT] /api/v1/cars/{id}

[DELETE] http://localhost:5000/api/v1/cars/1

Sample Response

{
  "message": "Car has been successfully deleted"
}

Created by @pahrurozi

Lombok - Indonesia

About

License:MIT License


Languages

Language:EJS 65.0%Language:JavaScript 35.0%