https://github.com/sagarmaheshwary/microservices-api-gateway
https://github.com/sagarmaheshwary/microservices-api-gateway
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sagarmaheshwary/microservices-api-gateway
- Owner: SagarMaheshwary
- License: mit
- Created: 2024-04-10T13:42:41.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-13T15:38:09.000Z (over 1 year ago)
- Last Synced: 2024-04-14T05:45:12.476Z (over 1 year ago)
- Language: Go
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# MICROSERVICES - API GATEWAY
API Gateway for the [Microservices](https://github.com/SagarMaheshwary/microservices) project.
### OVERVIEW
- Golang
- ZeroLog
- Gin framework - REST API
- gRPC – Client implementations for Authentication, Upload, and Video Catalog services
- Prometheus Client – Exports default and custom metrics for Prometheus server monitoring### SETUP
Follow the instructions in the [README](https://github.com/SagarMaheshwary/microservices?tab=readme-ov-file#setup) of the main microservices repository to run this service along with others using Docker Compose.
### APIs
Check out the Postman collection and environment files in the **api/postman** directory for example requests.
| API | METHOD | BODY | Headers | Description |
| ---------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| /auth/register | POST | {"name": "string", "email": "string", "password", "string"} | - | User registration - [authentication service](https://github.com/SagarMaheshwary/microservices-authentication-service) |
| /auth/login | POST | { "email": "string", "password", "string"} | - | User login - authentication service |
| /auth/logout | POST | - | Bearer token in "authorization" header | User logout - authentication service |
| /auth/profile | GET | - | Bearer token in "authorization" header | Get currently logged in user - authentication service |
| /videos | GET | - | - | List videos - [video catalog service](https://github.com/SagarMaheshwary/microservices-video-catalog-service) |
| /videos/:id | GET | - | - | Get specified video details as well as DASH manifest url from cloudfront for streaming that video - video catalog service |
| /videos/upload/presigned-url | POST | - | Bearer token in "authorization" header | Get S3 presigned url for uploading a video from frontend/postman - [upload service](https://github.com/SagarMaheshwary/microservices-upload-service) |
| /videos/upload/webhook | POST | {"video_id": "string - s3 upload id from presigned-url process", "thumbnail_id": "string - s3 upload id from presigned-url process", "title": "string - video title", "description": "string - video description"} | Bearer token in "authorization" header | Create a video - upload service |
| /health | GET | - | - | Service healthcheck endpoint |
| /metrics | GET | - | - | Prometheus metrics endpoint |