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":"johndoe@gmail.com",
	"password":"*********",
	"password2":"*********"
}


Login

POST /login

Request body

{
	"username":"john doe",
	"email":"johndoe@gmail.com"
}


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

Watchers

Forks

Releases

No releases published

Packages

No packages published