- Complete FastAPI proxy server with all Rentcast API endpoints - Intelligent caching with SQLite backend and Redis support - Rate limiting and usage tracking per API key - CLI administration tools for key and cache management - Comprehensive models with SQLAlchemy for persistence - Health checks and metrics endpoints - Production-ready configuration management - Extensive test coverage with pytest and fixtures - Rich CLI interface with click and rich libraries - Soft delete caching strategy for analytics - TTL-based cache expiration with endpoint-specific durations - CORS, compression, and security middleware - Structured logging with JSON format - Cost tracking and estimation for API usage - Background task support architecture - Docker deployment ready - Comprehensive documentation and setup instructions
49 lines
902 B
Plaintext
49 lines
902 B
Plaintext
# RentCache Configuration Example
|
|
# Copy this to .env and modify as needed
|
|
|
|
# Application
|
|
DEBUG=true
|
|
LOG_LEVEL=INFO
|
|
APP_NAME="RentCache API"
|
|
|
|
# Server
|
|
HOST=0.0.0.0
|
|
PORT=8000
|
|
|
|
# Database
|
|
DATABASE_URL=sqlite+aiosqlite:///./rentcache.db
|
|
DATABASE_ECHO=false
|
|
|
|
# Redis (optional - uncomment to enable)
|
|
# REDIS_URL=redis://localhost:6379
|
|
# REDIS_ENABLED=true
|
|
|
|
# Rentcast API
|
|
RENTCAST_BASE_URL=https://api.rentcast.io
|
|
RENTCAST_TIMEOUT=30
|
|
RENTCAST_MAX_RETRIES=3
|
|
|
|
# Cache Settings
|
|
DEFAULT_CACHE_TTL=3600
|
|
EXPENSIVE_ENDPOINTS_TTL=86400
|
|
ENABLE_STALE_WHILE_REVALIDATE=true
|
|
|
|
# Rate Limiting
|
|
ENABLE_RATE_LIMITING=true
|
|
GLOBAL_RATE_LIMIT=1000/hour
|
|
PER_ENDPOINT_RATE_LIMIT=100/minute
|
|
|
|
# Security
|
|
ALLOWED_HOSTS=*
|
|
CORS_ORIGINS=*
|
|
CORS_METHODS=*
|
|
CORS_HEADERS=*
|
|
|
|
# Monitoring
|
|
ENABLE_METRICS=true
|
|
METRICS_ENDPOINT=/metrics
|
|
HEALTH_ENDPOINT=/health
|
|
|
|
# Background Tasks
|
|
CLEANUP_INTERVAL_HOURS=24
|
|
STATS_AGGREGATION_INTERVAL_HOURS=1 |