Comprehensive documentation for the Ether Data spatio-temporal data workspace
A unified API gateway that combines all microservices into a single entry point.
The API Gateway serves as the single point of entry for all client requests, routing them to the appropriate microservices. It provides:
The API Gateway serves as a unified entry point that routes client requests to specialized microservices, each connected to their respective data sources and featuring unique capabilities.
π Census API (/census)
πΊοΈ Overture API (/overture)
π¦ TomTom Flow API (/tomtom-flow)
/docs# Run the gateway locally (from workspace root)
./proj/apis/gateway/run-local.sh
# This will:
# - Navigate to workspace root automatically
# - Use uv to manage dependencies and virtual environment
# - Run the gateway server with proper workspace setup
# Deploy to Google Cloud Run
./proj/apis/gateway/deployment/deploy.sh your-project-id us-central1
Local Development:
Production (after deployment):
GET /api/services - List all available servicesGET /api/services/{service_name} - Get service detailsGET /api/endpoints - List all endpoints across servicesGET /api/endpoints/by-tag/{tag} - Filter endpoints by tagGET /health - Overall system healthGET /health/gateway - Gateway-only healthGET / - Gateway information and service overviewThe gateway can be configured via environment variables:
# Gateway settings
GATEWAY_HOST # Production host
GATEWAY_PORT=8000 # Port to run on
ENVIRONMENT=development # Environment (development/staging/production)
# Service discovery
ENABLE_SERVICE_DISCOVERY=true # Enable service discovery
# Health checks
HEALTH_CHECK_INTERVAL=30 # Health check interval (seconds)
# CORS
CORS_ORIGINS=["*"] # Allowed origins
# Rate limiting (future)
RATE_LIMIT_REQUESTS=100 # Requests per minute
To add a new microservice to the gateway:
pyproject.toml:
dependencies = [
# ... existing deps
"your-new-api",
]
[tool.uv.sources]
your-new-api = { workspace = true }
main.py:
from your_new_api.main import app as new_api_app
# Mount the new API
app.mount("/new-api", new_api_app)
routes/discovery.py:
services = {
# ... existing services
"new-api": ServiceInfo(
name="new-api",
version="1.0.0",
description="Description of new API",
base_path="/new-api",
docs_url="/new-api/docs",
health_url="/health/new-api",
endpoints=[
# Define endpoints...
]
)
}
routes/health.py:
services_to_check = {
# ... existing services
"new-api": "/new-api/health"
}
The gateway includes several middleware components:
# Using the local run script (recommended)
./proj/apis/gateway/run-local.sh
# Alternative - direct execution with hot reload
ENVIRONMENT=development uv run --directory proj/apis/gateway python -m gateway.server
# Run tests
cd proj/apis/gateway
uv run pytest
Environment variables set for production deployment:
ENVIRONMENT=productionGATEWAY_PORT=8000CORS_ORIGINS=*View logs and metrics:
# View recent logs
gcloud logging read 'resource.type="cloud_run_revision" AND resource.labels.service_name="ether-gateway"' --limit=50
# Get service status
gcloud run services describe ether-gateway --region=us-central1
The gateway provides unified OpenAPI documentation at /docs.