Skip to content

feat: Centralized Configuration & Environment Management - #1878

Merged
omroy07 merged 1 commit into
omroy07:mainfrom
Aditya8369:feat/Centralized-Configuration-&-Environment-Management
Sep 18, 2026
Merged

omroy07 merged 1 commit into
omroy07:mainfrom
Aditya8369:feat/Centralized-Configuration-&-Environment-Management

Conversation

@Aditya8369

Copy link
Copy Markdown
Contributor

closes #1370

What was implemented:
Backend Typed Settings (backend/config/settings.py & init.py):

Implemented typed dataclasses (AppConfig, DatabaseConfig, AuthConfig, AIModelConfig, FeatureFlags, ServicesConfig, StorageConfig, FirebaseConfig, MailConfig).
Added @lru_cache singleton get_settings() for type-safe access across the backend.
Added get_public_config() to safely sanitize and mask all secrets before public transmission.
Runtime Public Config Endpoint (backend/api/v1/config.py):

GET /api/v1/config: Returns sanitized runtime config, environment info, and feature flags.
GET /api/v1/config/features: Returns active feature flags.
Frontend Configuration Singleton (js/config.js & js/config.d.ts):

Global window.AgriTechConfig and modular export.
Environment Auto-Detection (development, staging, production, test).
Centralized API Route Registry (AgriTechConfig.getApiUrl(endpointKey)).
Typed Feature Flags (AgriTechConfig.isFeatureEnabled(flagName)).
Unified Storage Keys Registry (AgriTechConfig.storageKeys.token, theme, diseaseHistory, etc.).
Auto-Sync (AgriTechConfig.syncWithBackend()).
TypeScript IntelliSense Support via js/config.d.ts.
Documentation & Templates:

Updated .env.example with 10 structured sections and comments.
Created docs/CONFIGURATION.md detailing configuration architecture and usage.

@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

@Aditya8369 is attempting to deploy a commit to the Om Roy's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

@Aditya8369

Copy link
Copy Markdown
Contributor Author

@omroy07 please check

@omroy07
omroy07 merged commit 5bca79b into omroy07:main Sep 18, 2026
1 of 4 checks passed
@github-actions

Copy link
Copy Markdown

🎉 Congrats @Aditya8369 on getting your PR merged! 🙌
Thanks for the contribution — looking forward to more from you 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Centralized Configuration & Environment Management - 50

2 participants