https://github.com/holms/fb-analyzer-api-gateway
API Gateway service for FB Analyzer
https://github.com/holms/fb-analyzer-api-gateway
docker fastapi fb-analyzer microservices python
Last synced: 2 months ago
JSON representation
API Gateway service for FB Analyzer
- Host: GitHub
- URL: https://github.com/holms/fb-analyzer-api-gateway
- Owner: holms
- License: mit
- Created: 2025-03-14T01:00:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-14T03:48:09.000Z (over 1 year ago)
- Last Synced: 2025-03-14T04:28:54.760Z (over 1 year ago)
- Topics: docker, fastapi, fb-analyzer, microservices, python
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FB Analyzer API Gateway
API Gateway service for the FB Analyzer project. This service acts as a central entry point for all API requests, routing them to the appropriate backend services.
## Features
- Proxies requests to appropriate backend services
- Handles CORS and security headers
- Provides centralized error handling
- Includes health check endpoint
- Configurable via environment variables
## Architecture
The API Gateway serves as the entry point for all client requests and routes them to the appropriate backend services:
- `/api/events/*` - Routes to the Event Fetcher service
- `/api/auth/*` - Routes to the Authentication service
## Setup
### Prerequisites
- Node.js 18+
- npm or yarn
### Installation
```bash
# Install dependencies
npm install
# Copy example environment file
cp .env.example .env
# Start the service
npm start
```
### Environment Variables
Copy the `.env.example` file to `.env` and adjust the values as needed:
```
# API Gateway Configuration
PORT=8000
NODE_ENV=development
# Service URLs
EVENT_FETCHER_URL=http://fb-analyzer-post-fetcher:8000
AUTH_SERVICE_URL=http://fb-analyzer-auth-service:8000
# CORS Configuration
CORS_ORIGIN=*
```
## Docker
The service can be built and run using Docker:
```bash
# Build the image
docker build -t fb-analyzer-api-gateway .
# Run the container
docker run -p 8000:8000 fb-analyzer-api-gateway
```
## Development
```bash
# Run in development mode with auto-reload
npm run dev
```
## Testing
```bash
# Run tests
npm test
```