This project implements a microservices-based fitness application with an API Gateway pattern. The system consists of three main services and a Nginx-based API Gateway for routing and load balancing.
-
User Management Service
- Port: 3000
- Endpoint:
/api/users/
- Handles user authentication, registration, and profile management
- Rate limit: 10 requests/second with burst of 20
-
Training Session Management Service
- Port: 3001
- Endpoint:
/api/sessions/
- Manages training sessions and schedules
- Rate limit: 10 requests/second with burst of 20
-
Workout Recommendation Service
- Port: 8000
- Endpoint:
/api/recommendations/
- Provides workout recommendations and calorie calculations
- Rate limit: 10 requests/second with burst of 20
- Handles routing to microservices
- Implements rate limiting
- Provides error handling
- Enables GZIP compression
- Manages request body size limits (100MB max)
- Health check endpoint available
GET/POST /api/users/
- User operations- Common endpoints include login, register, profile management
GET/POST /api/sessions/
- Session operations- Manages training schedules and session data
GET/POST /api/recommendations/
- Recommendation operationsPOST /api/recommendations/get-calories
- Calorie calculation endpoint
GET /health
- Health check endpoint- Returns
{"status":"UP"}
when system is operational
- Rate limiting implemented for all services
- GZIP compression for text and JSON responses
- Request size limits configured
- Proxy headers for proper client IP forwarding
- Upgrade-capable WebSocket connections supported
- Custom JSON responses for common HTTP errors
- 404 Not Found - Returns JSON error message
- 500 Server Error - Returns JSON error message
- Docker and Docker Compose
- Nginx
- Node.js (for user and training services)
- Python (for workout recommendation service)
- Clone the repository
- Navigate to the project directory
- Start the services:
docker-compose up
- Access the services through:
http://localhost/api/{service-endpoint}
Verify the system is running by accessing:
This project implements a microservices-based fitness application with an API Gateway pattern. The system consists of three main services and a Nginx-based API Gateway for routing and load balancing.
-
User Management Service
- Port: 3000
- Endpoint:
/api/users/
- Handles user authentication, registration, and profile management
- Rate limit: 10 requests/second with burst of 20
-
Training Session Management Service
- Port: 3001
- Endpoint:
/api/sessions/
- Manages training sessions and schedules
- Rate limit: 10 requests/second with burst of 20
-
Workout Recommendation Service
- Port: 8000
- Endpoint:
/api/recommendations/
- Provides workout recommendations and calorie calculations
- Rate limit: 10 requests/second with burst of 20
- Handles routing to microservices
- Implements rate limiting
- Provides error handling
- Enables GZIP compression
- Manages request body size limits (100MB max)
- Health check endpoint available
GET/POST /api/users/
- User operations- Common endpoints include login, register, profile management
GET/POST /api/sessions/
- Session operations- Manages training schedules and session data
GET/POST /api/recommendations/
- Recommendation operationsPOST /api/recommendations/get-calories
- Calorie calculation endpoint
GET /health
- Health check endpoint- Returns
{"status":"UP"}
when system is operational
- Rate limiting implemented for all services
- GZIP compression for text and JSON responses
- Request size limits configured
- Proxy headers for proper client IP forwarding
- Upgrade-capable WebSocket connections supported
- Custom JSON responses for common HTTP errors
- 404 Not Found - Returns JSON error message
- 500 Server Error - Returns JSON error message
- Docker and Docker Compose
- Nginx
- Node.js (for user and training services)
- Python (for workout recommendation service)
- Clone the repository
- Navigate to the project directory
- Start the services:
docker-compose up
- Access the services through:
http://localhost/api/{service-endpoint}
Verify the system is running by accessing: