SmartFarmAI is an innovative, data-driven agricultural platform designed to revolutionize modern farming practices by leveraging cutting-edge technologies. This comprehensive system integrates a web application, mobile app built with React Native, a robust MERN stack backend, and a sophisticated machine learning model for precise crop recommendations based on real-time soil and environmental data.
- AI-Powered Crop Recommendations: Utilizes advanced machine learning algorithms to deliver customized crop suggestions based on soil health, environmental conditions, and other critical factors.
- Unified RESTful APIs: Provides seamless communication between the web and mobile applications through a single, optimized API structure.
- Enhanced Security: Implements industry-standard security protocols, including Bcrypt for password encryption and JWT (JSON Web Tokens) for secure user authentication.
- Collaborative Community Forum: Facilitates knowledge-sharing, discussion, and peer-to-peer learning through an integrated forum designed specifically for farmers.
- Robust User Authentication: Features a secure and intuitive authentication flow, allowing users to register, log in, and manage sessions with ease.
- MongoDB: NoSQL database for scalable data storage, supporting flexible schema design and high availability.
- Express.js: Lightweight and extensible framework for building scalable APIs and handling HTTP requests.
- React.js: JavaScript library for building responsive, dynamic, and interactive user interfaces on the web.
- Node.js: Server-side JavaScript runtime used to build fast and scalable backend services.
- Mongoose: Object Data Modeling (ODM) library for MongoDB and Node.js, streamlining data management.
- React Native: Framework for building native mobile applications for iOS and Android using JavaScript and React.
- JWT (JSON Web Tokens): Secure, stateless authentication mechanism used to handle user sessions and authorization.
- Bcrypt: Cryptographic library for hashing passwords and ensuring secure user authentication.
- Flask: Lightweight Python web framework used to host the machine learning model and provide API endpoints for real-time predictions.
The project is structured into the following primary modules:
- Mobile Application (App): Developed with React Native and Expo, providing cross-platform support for iOS and Android users.
- Backend (Server): Built with the MERN stack (MongoDB, Express.js, React.js, Node.js), handling API endpoints, business logic, and database interactions.
- Frontend (Client): A responsive web interface built with React.js, offering users a seamless experience across devices.
- Machine Learning (ML): A Python-based module integrating machine learning models that analyze agricultural data and generate crop recommendations.
To run SmartFarmAI on your local machine, follow the steps below:
-
Clone the Repository:
git clone https://github.com/your-username/SmartFarmAI.git cd SmartFarmAI -
Install Dependencies:
-
Server:
cd server npm install -
Client:
cd client npm install -
Mobile App:
cd app npm install -
Machine Learning (ML):
pip install numpy pandas scikit-learn requests pickle
-
-
Set Up MongoDB: Ensure that MongoDB is installed and running. Update the connection string in the server configuration to match your local MongoDB setup.
-
Start the Servers:
-
Backend (Server):
cd server npm start -
Frontend (Client):
cd client npm run dev -
Mobile Application (App):
cd app npx expo start -
Machine Learning Model (ML):
cd ml python app.py
-
-
Access the Application:
- Web App: Open a web browser and visit
http://localhost:3000. - Mobile App: Use the Expo app to scan the QR code generated by the Expo server to launch the mobile application.
- Web App: Open a web browser and visit