RezaEskandarii / multi-tenant-hotel-reservation-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multi Tenant reservation-api

Description: A simple RESTful API for booking and reservation hotel rooms.
A Golang web-based restful api hotel reservation system, that acts a broker between hotels and customers.

Application architecture:
The architecture used in this program is multitenancy, for each new hotel(tenant), a new separate database is created, all of its tables are separate, and the information of each hotel(tenant) is stored separately in its own database.
This pattern uses a multi-tenant application with many databases, all being single-tenant databases. A new database is provisioned for each new tenant.

used technologies

  • PostgreSql
  • Rabbitmq
  • Redis
  • Minio
  • Docker
  • DockerCompose

How to run(with docker):

To run this program, you can easily use DockerCompose, all required dependencies such as Postgres, Redis, etc. are listed in the
docker-compose file.
First of all, install Docker and Docker Compose on your machine and after run the docer-compose up -d command, the program is executed, the default database It is made and also all the seeds are done.

How to run(without docker):

If for any reason you don't want to run the program with Docker and just want to run and compile the code, follow the steps below:

  • install postgresql on your machine
  • install rabbitmq on your machine
  • install redis on your machine
  • install minio on your machine
  • go to resorecess directory and override the config.yml with following steps:
    1. add your postgres port and ip address
    2. add your redis client port and ip address
    3. add your rabbitmq address
    4. add your minio conenction
    5. in the last step, go to the cmd directory and run the make build command to compile, you can also run the go run ./cmd/main.go command to execute application in application's root directory.

About

License:MIT License


Languages

Language:Go 99.7%Language:Makefile 0.2%Language:Dockerfile 0.1%