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 …