A scalable application made for Travel Lodge with microservices
As per the requirement and to improve the scalability of the application I have used microservices architecture when building the project
For the backend development I have used Apollo Federation with nodejs as Apollo plays a leading role when comes to graphql. And Apollo Federation provides tons of scalability along with simplicity. We can share data between our services without any hustle.
As per Databases I have used a noSQL database as they provides horizontal scaling and tons of flexibility. For this purpose I have took mongoDB cloud.
For the frontend, I have choose micro frontend architecture as well because it gives scalabilty and sharing components, data and easy to collaborate with multiple teams. For Microfrontend I have choosen Single-SPA. It allows to work with multiple frameworks for different services without worring much on intergration. Single-SPA uses runtime Intergration via script so it is super flexible.
For this project I have used only react for all services and Apollo client for communication with our graphql backend, styled-components for themeing and styles.
Clone the repo:
git clone https://github.com/hashaneranda/hotel-app
cd hotel-app
Install the dependencies:
yarn install
and create a new file .env and copy the content of .env.sample for hotel-backend/services/*
Running app locally:
yarn start
the app will run on http://localhost:9000
hotel-backend\
|--services\ # Apollo Federation services and gateway
|--foods\ # Foods service
|--gateway\ # Graphql gateway
|--users\ # users service
hotel-backend\
|--services\ # Single SPA microfrontend
|--api\ # Graphql apollo client service
|--auth\ # Authentication app
|--food\ # Food order app
|--root-config\ # root config for single spa
|--styleguide\ # Common components and styles