Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KisaanVerse - Developer Setup Guide

FastAPI backend for agricultural platform with AI-powered features.

Project Setup

Python Version

Use Python 3.11 for this project. The pinned ML dependencies in requirements.txt do not currently install correctly on Python 3.14.

1. Clone Repository

git clone https://github.com/devShaik010/KisaanVerse.git
cd KisaanVerse

2. Create Virtual Environment

py -3.11 -m venv env

3. Activate Environment

.\env\Scripts\Activate.ps1

4. Install Dependencies

pip install -r requirements.txt

5. Run Application

python main.py

Access API Documentation: http://localhost:8000/docs

Project Structure

KisaanVerse/
├── app/
│   ├── __init__.py
│   ├── config.py       # Configuration & API keys
│   ├── models.py       # Pydantic request/response models
│   ├── routes.py       # API endpoints
│   ├── services.py     # Business logic (add your implementations here)
│   └── models/
│       └── croppredict.pkl  # ML model files
├── main.py             # FastAPI application entry point
├── requirements.txt    # Python dependencies
└── README.md

How to Work

Adding New Features

  1. Define Models (app/models.py)

    • Add Pydantic models for request/response
  2. Implement Logic (app/services.py)

    • Write your business logic functions
    • Integrate ML models, APIs, databases
  3. Create Endpoints (app/routes.py)

    • Connect routes to services
    • Handle requests and responses
  4. Configure Settings (app/config.py)

    • Add API keys
    • Set environment variables

Available Endpoints

Method Endpoint Purpose Status
GET /KV/weather Get weather data by location/coordinates ✅ Working
POST /kv/predictCrop Crop recommendation system ⚠️ TODO
POST /kv/yieldPredict Crop yield prediction ⚠️ TODO
GET /kv/govSchemes Government schemes list ⚠️ TODO
POST /kv/kvLLM AI assistant ⚠️ TODO
POST /kv/BotLLM RAG-powered voice bot ⚠️ TODO

Testing Endpoints

  1. Using Swagger UI

  2. Using cURL

    # Weather by location
    curl "http://localhost:8000/KV/weather?location=Bangalore"
    
    # Weather by coordinates
    curl "http://localhost:8000/KV/weather?lat=12.9716&lon=77.5946"

Tech Stack

  • Backend: FastAPI, Pydantic, Uvicorn
  • HTTP Client: httpx (for external APIs)
  • Weather: Open-Meteo (free, no API key required)
  • Geocoding: Nominatim (free, no API key required)

Development Tips

  • Hot reload is enabled - code changes auto-restart server
  • Check /health endpoint to verify server is running
  • All endpoints return JSON responses
  • Use Swagger UI for interactive API testing

Next Steps

  1. Implement crop recommendation ML model in services.py
  2. Add yield prediction logic
  3. Integrate government schemes web scraping
  4. Connect GenAI/LLM for AI assistant
  5. Add database for user data
  6. Implement authentication

License: MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages