Croptivize is a comprehensive, full-stack web application designed to assist farmers and agriculture enthusiasts. It leverages AI to detect plant diseases, provides a marketplace for agricultural products, and includes a fertilizer calculator to help optimize crop yields.
Live Demo: https://growcroptivize.vercel.app/
- 🤖 AI-Powered Disease Detection: Upload an image of a plant leaf and get instant diagnosis of potential diseases using a trained PyTorch model.
- 🛒 E-commerce Marketplace: A fully functional online shop for buying and selling agricultural products.
- User-friendly product listings with search and filtering.
- Secure checkout and order management system.
- Admin panel for managing products, orders, and users.
- 🌾 Fertilizer Calculator: Recommends the optimal amount of fertilizer based on crop type and soil data.
- 👤 User Authentication: Secure user registration and login system with JWT, including Google OAuth for social login.
- 📞 Contact & Messaging System: Allows users to send messages and inquiries to the admin.
- Responsive Design: Fully responsive interface built with React and Shadcn/UI, ensuring a seamless experience on all devices.
This project is a monorepo containing three main parts: a React frontend, a Node.js backend, and a Flask API for the machine learning model.
| Component | Technology |
|---|---|
| Frontend | React, Vite, Redux Toolkit, React Router, Axios, Shadcn/UI, Tailwind CSS |
| Backend | Node.js, Express.js, MongoDB, Mongoose, JWT, Passport.js, Cloudinary, Multer |
| ML API | Python, Flask, PyTorch, Pillow |
.
├── Frontend/ # React Frontend Application
├── backend/ # Node.js/Express.js Backend API
├── flaskapi/ # Flask API for the ML Model
└── README.md
To get a local copy up and running, follow these simple steps.
Make sure you have the following installed on your system:
- Node.js (v18.x or higher)
- npm / yarn
- Python (v3.8 or higher)
- pip
- MongoDB (local instance or a cloud-based service like MongoDB Atlas)
-
Clone the repository:
git clone https://github.com/RayyanRS6/Croptivize-Complete.git cd Croptivize-Complete -
Setup the Backend:
cd backend npm installCreate a
.envfile in thebackenddirectory and add the following environment variables:PORT=8000 MONGODB_URI=your_mongodb_connection_string CORS_ORIGIN=* ACCESS_TOKEN_SECRET=your_access_token_secret ACCESS_TOKEN_EXPIRY=1d REFRESH_TOKEN_SECRET=your_refresh_token_secret REFRESH_TOKEN_EXPIRY=10d CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
-
Setup the Frontend:
cd ../Frontend npm installCreate a
.envfile in theFrontenddirectory and add the following variable, pointing to your backend server:VITE_API_BASE_URL=http://localhost:8000
The home page's disease library is served by
Frontend/api/plant-diseases.js, a Vercel function. SetPERENUAL_API_KEYin the Vercel project's environment variables (runvercel devto use it locally). The key never reaches the browser. -
Setup the Flask ML API:
cd ../flaskapi pip install -r requirements.txt
-
Start the Backend Server:
cd backend npm run dev -
Start the Frontend Development Server:
cd ../Frontend npm run dev -
Start the Flask API Server:
cd ../flaskapi python app.py
Your application should now be running!
- Frontend:
http://localhost:5173(or another port specified by Vite) - Backend:
http://localhost:8000 - Flask API:
http://localhost:5000
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Muhammad Rayyan Bin Salman - mrayyansalman69@gmail.com
Project Link: https://github.com/RayyanRS6/Croptivize
