A fully modular, production-ready Flask MVC backend backed by MongoDB Atlas. This project implements role-based access control, JWT session management, and a clean API surface for multiple dashboard types (Farmer, Insurance Officer, Admin).
# πΎ nexHarvest
> **Farmer-Centric Dual-Hazard Crop Intelligence System**
> Built for the **ClimateX 2026 + NABARD National Climate Stack Innovation Challenge**
> Institution: JSPM Rajarshi Shahu College of Engineering, Pune
---
## π Overview
**ClimateForeSight** is a full-stack climate intelligence platform that combines real-time satellite data, machine learning, and automated insurance triggering to protect Indian farmers against drought and flood. The system provides a personalised Farmer Vulnerability Index (FVI), 15-year crop risk projections (2025β2040), and autonomous PMFBY insurance activation β all without manual paperwork.
The platform serves **four distinct user roles** β Farmer, Loan Officer (NABARD), Insurance Officer, and Admin β each with their own dashboard view and access scope.
---
## ποΈ Project Structure
```
nexHarvest/
βββ backend/ # Python Flask MVC Backend (REST API)
β βββ app.py # App factory, blueprint registration, JWT config
β βββ config.py # Environment variables (MongoDB URIs, JWT secret)
β βββ extensions.py # Flask-JWT-Extended + Flask-CORS globals
β βββ utils.py # @role_required RBAC decorator
β βββ requirements.txt # Python dependencies
β βββ db_seed.py # Database seeding utility
β βββ test_db.py # MongoDB connection test script
β β
β βββ models/ # Data Access Objects (MongoDB Atlas)
β β βββ db.py # Atlas connection + auto-index provisioning
β β βββ user_model.py # Auth DB: User credentials & role mapping
β β βββ session_model.py # Auth DB: JWT session tracking + TTL expiry
β β βββ farmer_model.py # App DB: Farmer profile schema
β β βββ claim_model.py # App DB: Insurance claim tracking
β β
β βββ controllers/ # Business Logic Layer
β β βββ auth_controller.py β¦