First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
python version: 3.10
Go to backend. create a virtual environment.\
python -m venv venvActivate the environment (For Windows).
venv/Scripts/activateInstall fastapi:
pip install fastapi[standard]Install all the python packages.
pip install -r requirements.txtRun the backend:
fastapi dev main.pyDownload the ZIP file and extract it to backend/weights folder.
Here's a comprehensive API documentation for your agricultural service Agronova based on the provided Insomnia export:
Base URL: http://localhost:8000 (Backend) / http://localhost:3000 (Frontend)
Endpoint: POST /predict-disease
Content-Type: multipart/form-data
Request:
{
"file": "<leaf_image.jpg>"
}Response:
{
"disease": "Common Rust",
"confidence": 0.92
}Endpoint: POST /recommend-fertilizer
Content-Type: application/json
Request:
{
"crop": "watermelon",
"N": 60,
"P": 4.5,
"K": 10,
"moisture": 610,
"temperature": 125,
"humidity": 185,
"soilType": "Loamy"
}Response:
{
"fertilizer": "10-10-10 NPK"
}Endpoint: POST /api/fertilizer-info (Frontend)
Content-Type: application/json
Request:
{
"fertilizer": "Urea",
"N": 45,
"P": 29,
"K": 38
}Response:
{
"fertilizer": "Urea",
"response": "Apply during early growth stage."
}Endpoint: POST /predict-crop
Content-Type: application/json
Request:
{
"soilDepth": "medium (50-150 cm)",
"soilTexture": "light",
"soilPH": 7.5,
"temperature": 28,
"rainfall": 91
}Response:
{
"crop": "Soybean",
"suitability_score": 0.87
}Endpoint: POST /predict-suitability
Content-Type: application/json
Request:
{
"lon": 89.51464,
"lat": 23.435397
}Response:
{
"suitable_crops": ["Rice", "Jute"],
"unsuitable_crops": ["Wheat"]
}Endpoint: POST /api/chatbot
Content-Type: application/json
Request:
{
"question": "সুপারি ও নাড়কেলের ছোট ছোট ফল পড়ে যাচ্ছে। সমাধান জানতে চাই?"
}Response:
{
"question": "সুপারি ও নাড়কেলের ছোট ছোট ফল পড়ে যাচ্ছে। সমাধান জানতে চাই?",
"response": "**উত্তর:**\n\n**সুপারির ক্ষেত্রে:**\n\n* **পুষ্টির অভাব:** নিয়মিত সার প্রয়োগ করুন, বিশেষ করে নাইট্রোজেন, ফসফরাস ও পটাশিয়াম।\n* **জল জমে যাওয়া:** জমিতে যথেষ্ট নিষ্কাশনের ব্যবস্থা করুন।\n* **রোগ ও পোকামাকড়:** রোগ ও পোকামাকড়ের আক্রমণ नियন্ত্রণ করুন।\n\n**নাড়িকেলের ক্ষেত্রে:**\n\n* **পানির ঘাটতি:** বিশেষ করে শুষ্ক মৌসুমে নিয়মিত পানি দিন।\n* **পুষ্টির ঘাটতি:** ভারসাম্যপূর্ণ সার প্রয়োগ করুন, বিশেষ করে বোরন, জিঙ্ক ও ম্যাগনেশিয়াম।\n* **ফলের দামা ঘাটতি:** ফলের দামা হওয়ার সময় পর্যাপ্ত পানি দিন।\n* **পোকামাকড় ও রোগ:** পোকামাকড় ও রোগের আক্রমণ नियন্ত্রণ করুন।"
}Endpoint: POST /api/crop-details-generate
Content-Type: application/json
Request:
{
"crop": "Atriplex confertifolia"
}Response:
{
"crop": "Atriplex confertifolia",
"result": {
"name": "ডানা গাছ",
"description": "হালকা কালচে সবুজ রঙের ডালপালা বিশিষ্ট আট্রিপ্লেক্স কনফারটিফোলিয়া একটি খাড়া বৃক্ষ যা প্রায় 9 ফুট পর্যন্ত লম্বা হয়।"
}
}Need Swagger/OpenAPI spec? I can generate a YAML file for you! Let me know 🚀.