This project is an application for predicting crop types based on input environmental factors. The backend is implemented in Flask (Python), and the frontend is built using React.
The Crop Prediction App uses a machine learning model to predict the most suitable crop based on environmental factors such as nitrogen, phosphorus, potassium, temperature, humidity, pH, and rainfall.
- Predict crop type based on environmental factors.
- User-friendly frontend for input and result display.
- Node.js
- Express.js
- Python
- Flask
- Vite + React + Tailwind CSS
- Clone the repository:
git clone https://github.com/your-username/crop-prediction-app.git
- Install backend dependencies:
cd crop-prediction-backend
npm i
pip install -r requirements.txt
- Install frontend dependencies:
cd crop-prediction-frontend
npm install
crop-prediction-backend: Backend implementation using Node, express and Flask .
crop-prediction-frontend: Frontend implementation using Vite + React + Tailwind CSS .
The backend uses a RandomForestClassifier machine learning model trained on crop data.
cd crop-prediction-backend
npm run dev
cd crop-prediction-backend
python model_api.py
The frontend is a React application providing a user interface for entering input values and displaying predictions.
cd crop-prediction-frontend
npm run dev
/api/predict : Endpoint for predicting the crop type based on input environmental factors.
- Start the backend server.
- Start the frontend application.
- Visit http://localhost:5173 in your web browser.
- Enter the required input values.
- Click the "Predict" button to get the crop prediction.
Contributions are welcome! Please fork the repository and create a pull request.