Skip to content

ysfxix/parking-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parking API

[NodeJS | Express | MongoDB]


Instructions

  1. Install project dependencies

    npm install

  2. Provide MongoDB connection string in .env.sample file in project root

    (rename .env.sample to .env)

  3. Start the API server

    npm start


Online Deployment

https://parking-api-test.herokuapp.com/api/v1/


API Endpoints

HTTP Method Endpoint Description Body
POST /register User Registration - email string
- firstName string
- lastName string
- registrationNumber string
-userCategory number [0 (General) or 1 (Reserved)]
password string
POST /book Book a parking slot - email string
- password string
GET /users Total registered users (count)
GET /users/list Full list of registered users
GET /parking Status/Count of Parking slots
GET /parking/availableslots List of all available parking slots
GET /parking/occupiedslots List of all occupied parking slots

Examples

POST /register

{
  "email": "john@gmail.com",
  "firstName": "John",
  "lastName": "Doe",
  "registrationNumber": "MH-1234-5678",
  "userCategory": "1",
  "password": "yourpassword"
}

POST /book

{
  "email": "john@gmail.com",
  "password": "yourpassword"
}

About

Parking Booking Management API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published