Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simple reservation system app built with nodejs and microservices architecture to reserve hotels

NotificationsYou must be signed in to change notification settings

abdelrahmanahmed/simple-reservation-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This app if for reservation services. I used the followig components for:

  • Authentication microservice to authentcation incoming reuqests and check authorization.
  • User Database which is mariaDB and it is used for storing user data
  • Reservation microservice is used to reserve rooms based on user bonus
  • Rooms Database which is mariaDB and it is used for storing room data and reservation status
  • Nginx as an API Gatway
  • rabbitMQ as a messging system to send notification from reservation microservice toreservationStatus queue.
  • npm5.6.0
  • node8.10.0
  • docker18.06.1-ce
  • docker-compose1.22.0

How To run This Project

  • For the first time :
    • This will create microservices database and will install all the packages for all microservices and then it will run all the containers usingdocker-compose up command
    sh build.sh
    • If this not your first time to run the project usedocker-compose up command

Assumptions

  • This project will run on linux environment

How It Works

First of all you need to add to your headersapiSecret with its value5V3TRE9-W3K4P99-HYCTGX9-VRBFVAL . The following examples are how to use reservation API endpoints.

  • GEThttp://localhost/reservation/api/available-rooms is returning all available-rooms
  • POSThttp://localhost/reservation/api/reserve-room will reserve room there is any available rooms. You must add this payload in your body request:
{"room_id":1,"user_id":2}

This will reserveroom_id (1) foruser_id (2)

If he/she has enough bonus points, the status of this room <-> user relationchanges to "RESERVED" and bonus points are subtracted.If he/she does not have enough bonus points, the status changes to“PENDING_APPROVAL”

Testing

  • Every microserice has it owns unit tests
  • to run unit tests forreservation, go toreservation folder and run
npm test
  • to run unit tests forauthentication, go toauthentication folder and run
npm test

Container Integration

  • I used Jenkins to setup CI

Enhancements

  • error Handling
  • more eslint rules
  • Add environment variables

About

Simple reservation system app built with nodejs and microservices architecture to reserve hotels

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp