Skip to content

About

farmers subsidy helper

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

59 Commits

Folders and files

Repository files navigation

Kisan Yojana Scheme Portal

Kisan Yojana is a Flask + MySQL web application for discovering farmer subsidy schemes, browsing scheme categories, searching agricultural schemes, and viewing scheme details with eligibility, benefits, documents, and application steps.

Features

  • Farmer registration and login
  • Google login support
  • Reset password flow
  • Category-wise scheme browsing
  • Global scheme search
  • Detailed scheme information page
  • Scraper + ETL pipeline for importing scheme data into MySQL

Tech Stack

  • Python
  • Flask
  • MySQL
  • Authlib
  • Selenium
  • HTML/CSS

Project Structure

checksubsidy/
|-- app.py
|-- requirements.txt
|-- README.md
|-- static/
|-- templates/
`-- database/
    |-- python_to_mysql.py
    |-- fetch&final.py
    |-- scrappertry1.py
    `-- my_test.json

Installation

  1. Create and activate a virtual environment.
python -m venv .venv
.venv\Scripts\activate
  1. Install dependencies.
pip install -r requirements.txt
  1. Set environment variables if your MySQL credentials differ from the defaults.
$env:DB_HOST="localhost"
$env:DB_USER="root"
$env:DB_PASSWORD="Patel_2101"
$env:DB_NAME="kisan_yojana"
$env:FLASK_SECRET_KEY="replace-this-for-production"

Database Setup

Run the database setup script:

python database\python_to_mysql.py

This creates:

  • farmers
  • categories
  • schemes

It also ensures the documents_required column exists and inserts default categories/sample data.

Load Scraped Scheme Data

If database\my_test.json is already present, load it into MySQL with:

python "database\fetch&final.py"

Notes:

  • This script truncates the schemes table before inserting fresh data.
  • It automatically categorizes schemes into the main agriculture categories.

Run the App

python app.py

Open:

http://127.0.0.1:5000/

Presentation Flow Suggestion

  1. Register a farmer account.
  2. Login with the created account or Google login.
  3. Show the dashboard with real category and scheme counts.
  4. Open All Schemes and demonstrate live search.
  5. Open a category and then a scheme detail page.
  6. Show the reset password flow if needed.

Important Notes

  • Google auth was intentionally left unchanged.
  • Existing old plain-text passwords are supported during login and automatically upgraded to hashed passwords after successful login.
  • The app now uses environment variables for database connection and Flask secret configuration.

Troubleshooting

  • If MySQL connection fails, verify the DB_* environment variables.
  • If the scheme list is empty, run python database\python_to_mysql.py and then python "database\fetch&final.py".
  • If the scraper is used, make sure Chrome and ChromeDriver/Selenium setup works on your system.

Demo Checklist

  • MySQL server running
  • Dependencies installed
  • Database initialized
  • Scheme data loaded
  • Test account created
  • Internet available for Google login and location autocomplete

About

farmers subsidy helper

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages