$ git clone [email protected]:KevinH2810/car-listing.git
# clone the repository to your computer
$ yarn install or npm install
# install dependencies using yarn or npm
$ yarn start or npm start
# start the app using yarn or npm
After clonning the repository, open the folder and rename .env.example
to .env
and setting the value to your desired settings
{host}:{port}/
{host}:{port}/brand
{host}:{port}/color
{host}:{port}/fuel
{host}:{port}/model
{host}:{port}/brand
{host}:{port}/listing
Login via Facebook oAuth. will generate JWTToken from data supplied by facebook. the token are available for 24 hour.
After you got the JWT token, you can use the token as the bearer token in Postman to test the routes.
Used to get Brand Names from Database you dont have to supply parameters.
used to add Brand name to the database you can supply brand name, JWT token are not needed in the header
Params
(Body - x-www-form-urlencoded):
brandName
Used to get color Names from Database you dont have to supply parameters.
used to add color name to the database you can supply color name, JWT token are not needed in the header
Params
(Body - x-www-form-urlencoded):
colorName
Used to get fuel Names from Database you dont have to supply parameters.
used to add fuel name to the database you can supply fuel name, JWT token are not needed in the header
Params
(Body - x-www-form-urlencoded):
fuelName
Used to get all car models from Database. you dont have to supply parameters.
Used to get car model from user that logged in from database. you have to supply token Bearer to get the userId.
Used to get car model using id that logged in from database. you have to supply token id on the url.
used to add car Model for specific user. you can supply fuel name, JWT token are needed in the header to supply the userId
Params
(Body - x-www-form-urlencoded):
model
brandId
year
colorId
fuelId
engine
update the information of car Model. require JWT token in header to validate userId
Params
(Body - x-www-form-urlencoded):
modelid [must](_id: of the data, can be acquired when search the car model)
modelName
brandId
year
colorId
fuelId
engine
Delete a car model by id. require JWT Token header for authorization.
Params
(Body - x-www-form-urlencoded):
modelId [must](_id: of the data, can be acquired when search the car model)
Used to get all car availability from Database. you can supply parameter, if empty it will default takes today date and availability true
params date & status
(1 for available, 0 for unavailable/booked)
(Date Format YYYY-MM-DD)
used to add car availability dates and status. JWT token are needed in the header to supply the userId and validate
Params
(Body - x-www-form-urlencoded):
date
price
modelId
Date Format in YYYY-MM-DD
update the information of car availability. require JWT token in header to validate user.
Date Format in YYYY-MM-DD status 1 for available, 0 for unavailable/booked
Params
(Body - x-www-form-urlencoded):
availId [must](_id: of the data, can be acquired when search the car availability)
date
status
price
modelId
Delete a car availability require JWT Token header for authorization.
Params:
availId [must](_id: of the data, can be acquired when search the car availability )