Core#1
Merged
Jenish-1235 merged 21 commits intodevfrom Dec 17, 2025
Merged
Conversation
- Split core/models.py into domain modules - Enhance user/auth models with production-grade features - Update dependencies: pydantic[email] for EmailStr validation - Update tests to match new model structure - All imports remain backward compatible - All 48 tests passing
…ling and OAuth provider requirements - Changed IP address fields in models to use IPvAnyAddress for better validation. - Made oauth_provider a required field in User and UserContext models. - Removed deprecated OAuthTokens model and updated related tests. - Enhanced tests to validate new model behaviors and requirements.
- Add docker-compose.infra.yml with PostgreSQL, Redis, Jaeger - Add scripts/init-db.sql with complete database schema - Add scripts/generate-keys.sh for JWT key generation - Add scripts/setup-keyvault.sh for Azure Key Vault setup
- Add PostgreSQL, Redis, JWT, OpenTelemetry settings - Add startup timeout and retry configuration - Add pool size configuration for future use - Create .env.example template - Update .gitignore for secrets
- Create core/config_loader.py with retry logic - Add environment validation (strict for prod/staging) - Add exponential backoff retry for Azure connections - Add azure-appconfiguration dependency
- Create core/app_state.py with AppState container - Define DatabasePool and RedisClient protocols - Create core/database.py with pool factory stub - Create core/redis.py with client factory stub - Add startup metadata tracking
- Add 7-phase startup sequence with logging - Add configuration loading from Azure - Add connection initialization and verification - Add graceful shutdown with cleanup - Add AppState dependency injection
- Add /health with detailed dependency checks - Add /ready for Kubernetes readiness probe - Add /live for Kubernetes liveness probe - Update Docker health check to use /ready - Add uptime and metadata to health response
- Add tests for environment validation - Add tests for AppState lifecycle - Add tests for health endpoints - Update README with infrastructure setup
- Move all core module tests to tests/core/ directory - Create tests/core/__init__.py - Keep API tests (test_health_endpoints.py) in tests/ root - Maintains test organization by module structure
…uirements - Introduce azure-appconfiguration version 1.7.2 with its dependencies - Update project dependencies to include azure-appconfiguration - Ensure compatibility with existing azure-core and other related packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to configuration management, infrastructure documentation, and application health monitoring for the NeroSpatial Backend. It adds a robust
.env.exampletemplate, expands configuration loading logic, introduces a centralized application state container, and implements comprehensive health check endpoints for production readiness. Additionally, it refactors and organizes shared utilities and improves the project documentation for local development and deployment.Configuration and Environment Management
.env.exampletemplate with all necessary configuration variables for local development and production bootstrap, including Azure, PostgreSQL, Redis, JWT, and telemetry settings.Settingsclass inconfig.pyto support hierarchical configuration loading from Azure App Configuration, Azure Key Vault, and.envfiles, with new fields and validation logic for environment and connection URLs. [1] [2]Infrastructure and Development Documentation
README.mdto include comprehensive instructions for local infrastructure setup using Docker Compose, database initialization, JWT key generation, Azure Key Vault setup, and a clear explanation of configuration hierarchy and validation.Application State and Dependency Management
AppStatedataclass (core/app_state.py) that centralizes application-wide resources (settings, database pool, Redis client, JWT auth, telemetry, Key Vault) and manages startup state and cleanup.Health Monitoring Endpoints
/health,/ready,/live) inapi/health.pyfor use with Kubernetes and load balancers, providing detailed dependency status and metadata.Core Utilities and API Structure
core/__init__.pyto re-export key classes, functions, and exceptions for easier imports and better modularity. [1] [2]api/__init__.pyfor clarity.