mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:21:09 +02:00
Implement custom NestJS API Gateway for mana-search, mana-stt, and mana-tts: - API Key management with CRUD operations and key regeneration - Redis-based sliding window rate limiting - Credit-based billing with tier support (free, pro, enterprise) - Usage tracking with daily aggregates - Proxy services to backend microservices - Prometheus metrics endpoint - JWT auth for management API, API key auth for public API Database schema uses separate `api_gateway` schema in shared manacore DB.
34 lines
753 B
Text
34 lines
753 B
Text
# Server
|
|
PORT=3030
|
|
NODE_ENV=development
|
|
|
|
# Database (same as mana-core-auth)
|
|
DATABASE_URL=postgresql://manacore:devpassword@localhost:5432/manacore
|
|
|
|
# Redis
|
|
REDIS_HOST=localhost
|
|
REDIS_PORT=6379
|
|
REDIS_PASSWORD=
|
|
|
|
# Backend Services
|
|
SEARCH_SERVICE_URL=http://localhost:3021
|
|
STT_SERVICE_URL=http://localhost:3020
|
|
TTS_SERVICE_URL=http://localhost:3022
|
|
|
|
# Auth Service (for JWT validation & credits)
|
|
MANA_CORE_AUTH_URL=http://localhost:3001
|
|
|
|
# API Key Generation
|
|
API_KEY_PREFIX_LIVE=sk_live_
|
|
API_KEY_PREFIX_TEST=sk_test_
|
|
|
|
# Rate Limiting Defaults
|
|
DEFAULT_RATE_LIMIT=10
|
|
DEFAULT_MONTHLY_CREDITS=100
|
|
|
|
# CORS
|
|
CORS_ORIGINS=http://localhost:3000,http://localhost:5173
|
|
|
|
# Development Auth Bypass
|
|
DEV_BYPASS_AUTH=true
|
|
DEV_USER_ID=00000000-0000-0000-0000-000000000000
|