You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## API-GATEWAY Package. Remember to provide redundancy to eliminate the `single point of failure`
4
+
5
+
The API-GATEWAY serves as the front-facing layer of our Microservices Suite, designed to efficiently route client requests to the appropriate internal service. By abstracting the internal services network from the client, it exposes a singular endpoint that consolidates and manages access to your suite of APIs.
6
+
7
+
### Key Features
8
+
9
+
-**Unified Endpoint**: Offers a single endpoint for all client-side applications to interact with, simplifying API consumption and integration.
10
+
-**Request Routing**: Dynamically routes client requests to the appropriate microservice based on the request path, method, and other criteria.
11
+
-**Response Aggregation**: Collects responses from various microservices and consolidates them into a single response for the client, facilitating smoother interaction patterns.
12
+
-**Security and Abstraction**: Enhances security by hiding the internal structure of the microservices network from the clients.
13
+
14
+
## Getting Started
15
+
16
+
### Prerequisites
17
+
18
+
Before setting up the API-GATEWAY, ensure that you have the following:
19
+
- A current version of Node.js installed (preferably version 12.x or newer).
20
+
- Basic knowledge of how microservices architecture operates.
21
+
- Access to the microservices that the gateway will route requests to.
22
+
23
+
### Installation
24
+
25
+
To install the API-GATEWAY, follow these steps:
26
+
27
+
<!-- TODO: document usage here -->
28
+
29
+
### Configuration
30
+
31
+
<!-- TODO: build on this -->
32
+
Configure the gateway by setting up environment variables or editing a `.env` file in the root directory of the API-GATEWAY project. Key configurations include the gateway's port, microservices endpoints, and any security credentials like API keys.
33
+
34
+
### Running the Gateway
35
+
36
+
<!-- TODO: build on this but ideally is supposed to be run just like any other service in our ms-suite -->
37
+
38
+
39
+
<!-- Handling client requests -->
40
+
41
+
<!-- Microfrontend client request -->
42
+
43
+
<!-- Monolithic client request -->
44
+
45
+
### Handling client requests
46
+
47
+
#### Microfrontend client
48
+
- Microservices
49
+
50
+
#### Monolithic client
51
+
- Monolith client apps which are the traditional frontend applications
52
+
- They make requests to the server by making a http request to one `base_url/<endpoint>`
53
+
- In microservices architecture they will make a call to this service(`the gateway`) which sits in front of all her services
54
+
- On getting the request the `API-Gateway` then `decomposes` the request into different `api calls` that are routed internally to different services.
55
+
- On completion the gateway aggregates/consolidates the response into one and returns back to the monolithic application
0 commit comments