Skip to content

Features/waterbody api fix#862

Open
kapildadheech wants to merge 5 commits intostagingfrom
features/waterbody_api_fix
Open

Features/waterbody api fix#862
kapildadheech wants to merge 5 commits intostagingfrom
features/waterbody_api_fix

Conversation

@kapildadheech
Copy link
Copy Markdown
Collaborator

No description provided.

kapil.dadheech@gramvaani.org and others added 5 commits April 7, 2026 22:05
Unify public and waterrejuvenation API outputs to use status/error_message/data, update Swagger/ReDoc examples to match runtime responses, and add optional MongoDB caching with file-cache fallback plus regenerate support for waterbody endpoints

MongoDB setup instructions (for README/PR)
Start MongoDB (Docker)
docker run -d --name corestack-mongo -p 27017:27017 -v mongo_data:/data/db mongo:7
Add env vars
MONGODB_URI=mongodb://localhost:27017
MONGODB_DB_NAME=core_stack
MONGODB_WATERBODIES_COLLECTION=waterbodies_cache
Install Python dependency in app env
pip install pymongo
Restart Django server

Test cache write

Call:
/api/v1/get_waterbodies_data_by_admin/?state=Rajasthan&district=bhilwara&block=mandalgarh
Verify in Mongo:
docker exec corestack-mongo mongosh --quiet --eval "db.getSiblingDB('core_stack').waterbodies_cache.countDocuments({})"
Force refresh endpoint output (optional)
Add query param: regenerate=true
Add SWB5 processing module, introduce API v2 URL surface, standardize Open-Meteo-style response envelopes, add Mongo caching for public v2 MWS data, and enforce two-decimal JSON rendering across API responses.

Made-with: Cursor
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.

1 participant