Skip to content

imsdolta/zoomcarAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Car Rental System API

what's inside 🚗


1. Sign UP                                   ✅
2. Login                                     ✅
3. Book a car                                ✅
4. Find car based on id (non booked)         ✅
5. for a user show cars he has booked        ✅
4. Find non booked car based on id           ✅
5. show cars user has booked                 ✅

Installation

npm install 

REST API


The REST API to the example app is described below.

Register

POST /register

Request body


{
	"username":"john doe",
	"email":"[email protected]",
	"password":"*********",
	"password2":"*********"
}


Login

POST /login

Request body

{
	"username":"john doe",
	"email":"[email protected]"
}


Show all cars

GET /admin/showall

Response

[
  {
    "isRented": true,
    "_id": "5fa43f11515cbe0e2800e31f",
    "model": "mini cooper xv15",
    "price": 1650000,
    "year": 2011,
    "creationDate": 1604599569298,
    "__v": 0
  }
]

Book car by ID


## Book car by ID 

### POST /cars/booking 
Request body

{ "carId" : "mini cooper xv15", "rentalDate": "{% now 'iso-8601', 'dd mm yy' %}", "rentalDays":11 }



## Get booking for current User
### GET /booking 
Request body

{ id : 'user id' }


## Add cars 
## POST /AddCar
Request body 

{ "model": "xuv500 AT509", "price": 2450000, "year": 2012, "creationDate": 5604599569232, }

POST /cars/booking

Request body

{
	"carId" : "mini cooper xv15",
	"rentalDate": "{% now 'iso-8601', 'dd mm yy' %}",
	"rentalDays":11
}

Get booking for current User

GET /booking

Request body

{
  id : 'user id'
}

Add cars

POST /AddCar

Request body

{
    "model": "xuv500 AT509",
    "price": 2450000,
    "year": 2012,
    "creationDate": 5604599569232,
}

About

A 🚗 rental service API built with nodejs and mongoDB

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors