|
1 | 1 | # 🌐 API Gateway |
2 | 2 |
|
| 3 | +## 🚦 Build Status |
| 4 | + |
| 5 | +**main** |
| 6 | + |
3 | 7 | [](https://github.com/TechTorque-2025/API_Gateway/actions/workflows/buildtest.yaml) |
4 | 8 |
|
| 9 | +**dev** |
| 10 | + |
| 11 | +[](https://github.com/TechTorque-2025/API_Gateway/actions/workflows/buildtest.yaml) |
| 12 | + |
5 | 13 | This service is the single entry point for all client requests in the TechTorque 2025 system. It is responsible for routing, authentication, rate limiting, and enriching requests. |
6 | 14 |
|
7 | 15 | ### 🎯 Key Responsibilities |
8 | 16 |
|
9 | | -- **Request Routing:** Maps incoming URL paths (e.g., `/api/v1/vehicles`) to the correct internal microservice (e.g., `vehicle-service`). |
10 | | -- **Authentication:** Validates JWTs for all protected endpoints. |
11 | | -- **Header Enrichment:** Injects `X-User-Subject` and `X-User-Roles` headers into requests after successful authentication. |
12 | | -- **CORS:** Manages all Cross-Origin Resource Sharing policies for the frontend application. |
| 17 | +- **Request Routing:** Maps incoming URL paths (e.g., `/api/v1/vehicles`) to the correct internal microservice (e.g., `vehicle-service`). |
| 18 | +- **Authentication:** Validates JWTs for all protected endpoints. |
| 19 | +- **Header Enrichment:** Injects `X-User-Subject` and `X-User-Roles` headers into requests after successful authentication. |
| 20 | +- **CORS:** Manages all Cross-Origin Resource Sharing policies for the frontend application. |
13 | 21 |
|
14 | 22 | ### ⚙️ Tech Stack |
15 | 23 |
|
16 | | -- **Language:** Go |
17 | | -- **Router:** `chi/v5` |
18 | | -- **JWT Library:** `golang-jwt/jwt/v5` |
| 24 | +  |
| 25 | + |
| 26 | +- **Language:** Go |
| 27 | +- **Router:** `chi/v5` |
| 28 | +- **JWT Library:** `golang-jwt/jwt/v5` |
19 | 29 |
|
20 | 30 | ### 🚀 Running Locally |
21 | 31 |
|
22 | 32 | This service is designed to be run as part of the main `docker-compose` setup from the project's root directory. |
23 | 33 |
|
24 | 34 | ```bash |
25 | 35 | # From the root of the TechTorque-2025 project |
26 | | -docker-compose up --build api-gateway |
| 36 | +docker-compose up --build api-gateway |
| 37 | +``` |
0 commit comments