https://github.com/hashaneranda/hotel-app
A scalable microservice app built with node, react, single-spa, graphql
https://github.com/hashaneranda/hotel-app
apollo-federation node react single-spa
Last synced: 7 months ago
JSON representation
A scalable microservice app built with node, react, single-spa, graphql
- Host: GitHub
- URL: https://github.com/hashaneranda/hotel-app
- Owner: hashaneranda
- Created: 2021-06-08T06:59:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-11T12:55:43.000Z (over 4 years ago)
- Last Synced: 2023-03-05T06:04:47.386Z (almost 3 years ago)
- Topics: apollo-federation, node, react, single-spa
- Language: JavaScript
- Homepage:
- Size: 1.89 MB
- Stars: 19
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hotel App
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.
## Project Architecture

## Project Sequence Diaghram

## Project Demo
- [Demo here](https://www.loom.com/share/c6d0f18835db4b5c8acf8b8c487489e8)
## Getting Started
### Installation
Clone the repo:
```bash
git clone https://github.com/hashaneranda/hotel-app
cd hotel-app
```
Install the dependencies:
```bash
yarn install
```
and create a new file .env and copy the content of .env.sample for hotel-backend/services/\*
### Commands
Running app locally:
```bash
yarn start
```
the app will run on http://localhost:9000
## Project Structure
```
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
```