Skip to content

mnmajd/Room_Reservation_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Room reservation API.

Based Node.js room reservation API.

Prerequisites!

  • [node.js] - Javascript runtime runtime environment
  • [MongoDB] - NoSql database , i used a cloud solution which is Atlas
  • [Express] - Markdown parser done right. Fast and easy to extend.
  • [Maildev] - local server to test mailing trafic on localhost
  • [Express] - sweet node.js framework to create Rest API
  • [npm] - node package manager
  • [Mocha & Chai] - for unit test
  • [nyc] - for code coverage
  • [git] - used for version control

Usage

Clone the project

$ git clone https://github.com/mnmajd/majd-test-CN.git

Go to project directory

$ cd majd-test-CN

Install project dependencies

$ npm install

Install maildev globaly

$ npm install -g maildev

Start project

$ npm run dev 

Start maildev server

$ maildev

Access maildev web UI

$ go to http://0.0.0.0:1080

Endpoints

1- Apartment endpoints
2- Room endpoints
3- Client endpoints
- Request bodies

Client

{
        "firstName": "",
        "lastName": "",
        "email": "",
        "phone": "",
        "birthDate": "",
        "nationality": "",
        "password" : ""
        
}

Apartment

{
    "name" : "",
    "street" : "",
    "zipCode": "",
    "city" : ""
        
}

Room

 {
"number" : ,
"area" : ,
"price" : ,
"Apartment" : ""
}
        

What i saw useful to add

1- Authentification for clients ( register / login ).
2- Email confirmation after register / booking a room.
3- Grant access for booking API so that only users who are logged in can access to the endpoint thats why you should add a Token to the header of the request.

Unit testing

$ npm run test 

Code coverage

$ npm run cov

Perspectives

  • Deploy on Heroku
  • More unit tests to gain more code coverage
  • Create Docker Image and deploy it on a docker repository

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published