Plowtion harnesses the power of AI to generate personalized crop schedules tailored to your specific location and crop type. By integrating real-time weather data, we help farmers make informed decisions that optimize growth and maximize yield, adapting to the challenges posed by changing climate conditions.
- π€ AI-Powered Crop Recommendations: Machine learning model provides personalized crop suggestions based on environmental factors
- π Smart Scheduling: Generate optimized planting and harvesting schedules
- π€οΈ Weather Integration: Real-time weather data integration for informed decision-making
- π Marketplace: Robust platform for buying and selling seeds and farming equipment
- π¬ AI Chatbot: NLP-powered assistant providing instant farming tips and guidance
- π€ User Profiles: Personalized farmer profiles and preferences
- π Secure Authentication: OAuth integration with Google authentication
Plowtion/
βββ backend/ # Python Flask API
β βββ app.py # Main Flask application
β βββ dataset/ # ML training datasets
β βββ requirements.txt # Python dependencies
β βββ Dockerfile # Backend container config
βββ frontend/ # Next.js React application
β βββ app/ # Next.js app directory
β βββ components/ # Reusable React components
β βββ lib/ # Utility libraries
β βββ services/ # API service layer
β βββ Dockerfile # Frontend container config
βββ model/ # Machine learning models
β βββ crop_model.joblib # Trained crop recommendation model
βββ docker-compose.yml # Multi-container orchestration
- Docker & Docker Compose (recommended)
- Python 3.8+ (for local development)
- Node.js 18+ (for local development)
- MongoDB (included in Docker setup)
-
Clone the repository
git clone <repository-url> cd Plowtion
-
Configure environment variables
cp .env.example .env # Edit .env with your actual API keys and secrets -
Start the application
docker-compose up -d
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- MongoDB: localhost:27017
-
Navigate to backend directory
cd backend -
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set environment variables
export FLASK_ENV=development export PERPLEXITY_API_KEY=your_api_key_here # ... other environment variables from .env.example
-
Run the Flask application
python app.py
-
Navigate to frontend directory
cd frontend -
Install dependencies
npm install
-
Set environment variables
cp .env.example .env.local # Edit .env.local with your values -
Run the development server
npm run dev
- PERPLEXITY_API_KEY: For AI chatbot functionality
- WEATHER_API_KEY: For weather data integration
- GOOGLE_CLIENT_ID & GOOGLE_CLIENT_SECRET: For OAuth authentication
- NEXTAUTH_SECRET: For NextAuth.js session encryption
- AWS_ACCESS_KEY_ID & AWS_SECRET_ACCESS_KEY: For AWS services
Create a .env file based on .env.example and fill in your actual values:
# API Keys
PERPLEXITY_API_KEY=your_perplexity_api_key
WEATHER_API_KEY=your_weather_api_key
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
# Security
NEXTAUTH_SECRET=your_secure_random_string
NEXTAUTH_URL=http://localhost:3000
# Database
MONGODB_URI=mongodb://localhost:27017/plowtion
# AWS (if using AWS services)
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=us-east-1- Development:
http://localhost:5000 - Production:
https://your-domain.com/api
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Health check |
| POST | /predict |
Get crop recommendations |
| POST | /chat |
Chat with AI assistant |
| GET | /crops |
Get crop information |
| POST | /schedule |
Generate crop schedule |
// Get crop recommendation
const response = await fetch('/api/predict', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
nitrogen: 40,
phosphorus: 50,
potassium: 30,
temperature: 25,
humidity: 80,
ph: 6.5,
rainfall: 200
})
});cd backend
python -m pytest tests/cd frontend
npm test-
Build production images
docker-compose -f docker-compose.prod.yml build
-
Deploy with production configuration
docker-compose -f docker-compose.prod.yml up -d
The application is containerized and can be deployed on:
- AWS ECS/EKS
- Google Cloud Run
- Azure Container Instances
- DigitalOcean App Platform
- Fork the repository
- Create a 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
- Follow PEP 8 for Python code
- Use ESLint and Prettier for JavaScript/TypeScript
- Write tests for new features
- Update documentation for API changes
- Ensure Docker builds pass
- No hardcoded secrets: All sensitive data is managed through environment variables
- Authentication: Secure OAuth integration
- API Security: Rate limiting and input validation
- Data Protection: Encrypted data transmission
- Mobile application (React Native)
- Advanced weather predictions
- IoT sensor integration
- Multi-language support
- Advanced analytics dashboard
- Integration with farming equipment APIs
Docker containers not starting
- Check Docker daemon is running
- Verify environment variables are set
- Check port conflicts (3000, 5000, 27017)
API authentication errors
- Verify Google OAuth credentials
- Check NEXTAUTH_SECRET is set
- Ensure NEXTAUTH_URL matches your domain
Database connection issues
- Verify MongoDB is running
- Check MONGODB_URI format
- Ensure network connectivity between containers
This project is licensed under the MIT License - see the LICENSE file for details.
- Scikit-learn for machine learning capabilities
- Next.js for the robust frontend framework
- Flask for the lightweight backend API
- Perplexity AI for intelligent chatbot functionality
- MongoDB for flexible data storage
For support and questions:
- Create an issue on GitHub
- Join our community discussions
- Check the documentation wiki
Built with β€οΈ for farmers around the world πΎ