Skip to content

itmesneha/PlantPal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

153 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌱 PlantPal - AI-Powered Plant Health Monitoring Platform

An intelligent plant care companion that uses computer vision and AI to identify plant species, detect diseases, and provide personalized care recommendations.

Demo Video:

PLANTPAL DEMO

πŸš€ Features

  • πŸ“± Plant Disease Detection - AI-powered analysis using computer vision models
  • πŸ” Species Identification - Botanical identification through PlantNet API integration
  • πŸ€– Smart Care Recommendations - Personalized advice generated by LLM
  • πŸ“Š Health Tracking - Monitor plant health scores and trends over time
  • πŸ† Plant Management - Add, edit, and organize your plant collection
  • πŸ“ˆ Scan History - Track health changes with detailed scan records
  • πŸ”’ Secure Authentication - AWS Cognito integration for user management
  • πŸ“± Responsive Design - Works seamlessly on desktop and mobile devices

πŸ› οΈ Tech Stack

Frontend

  • React 18 with TypeScript
  • Tailwind CSS for styling
  • AWS Cognito for authentication
  • Responsive PWA design

Backend

  • FastAPI (Python) with async/await
  • PostgreSQL database
  • SQLAlchemy ORM with Alembic migrations
  • JWT authentication middleware

AI/ML Services

  • Hugging Face - Plant disease detection models
  • PlantNet API - Botanical species identification
  • OpenRouter + Gemma-3 - LLM for care recommendations

Cloud Infrastructure

  • AWS ECS - Containerized backend deployment
  • AWS RDS - Managed PostgreSQL database
  • AWS S3 - Static website hosting
  • AWS ECR - Docker image registry
  • GitHub Actions - CI/CD pipeline

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   React App     │────│   FastAPI API    │────│   PostgreSQL   β”‚
β”‚   (S3 Static)   β”‚    β”‚   (ECS Docker)   β”‚    β”‚   (RDS)        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                        β”‚
         β”‚                        β”‚
         β–Ό                        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  AWS Cognito    β”‚    β”‚   AI Services    β”‚
β”‚  Authentication β”‚    β”‚  β€’ HuggingFace   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚  β€’ PlantNet      β”‚
                       β”‚  β€’ OpenRouter    β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Getting Started

Prerequisites

  • Node.js (v18+)
  • Python (v3.9+)
  • Docker
  • AWS Account
  • API Keys for HuggingFace, PlantNet, and OpenRouter

Environment Setup

  1. Clone the repository
git clone https://github.com/itmesneha/PlantPal.git
cd PlantPal
  1. Backend Setup
cd backend
cp .env.example .env
# Configure your environment variables in .env

# Install dependencies
pip install -r requirements.txt

# Run database migrations
python -m alembic upgrade head

# Start the server
python -m app.main
  1. Frontend Setup
cd frontend
cp .env.example .env.local
# Configure your environment variables

# Install dependencies
npm install

# Start development server
npm start

Environment Variables

Backend (.env)

DATABASE_URL=postgresql://user:password@localhost:5432/plantpal
HF_TOKEN=your_huggingface_token
PLANTNET_API_KEY=your_plantnet_key
OPENROUTER_API_KEY=your_openrouter_key
<<<<<<< HEAD
CORS_ORIGINS=http://localhost:5000
=======
CORS_ORIGINS=http://localhost:6000
>>>>>>> ee985433741ae041d5f227ff7161889809705284

Frontend (.env.local)

REACT_APP_API_URL=http://localhost:8000
REACT_APP_AWS_REGION=your_aws_region
REACT_APP_USER_POOL_ID=your_cognito_user_pool_id
REACT_APP_USER_POOL_CLIENT_ID=your_cognito_client_id

🐳 Docker Deployment

Build and Run with Docker

# Backend
cd backend
docker build -t plantpal-backend .
docker run -p 8000:8000 --env-file .env plantpal-backend

# Frontend (for production build)
cd frontend
npm run build
# Deploy build/ folder to S3 or static hosting service

πŸ“± API Documentation

Once the backend is running, visit:

Key Endpoints

  • POST /api/v1/scan - Scan plant for disease detection
  • GET /api/v1/plants - Get user's plant collection
  • PUT /api/v1/plants/{id} - Update plant information
  • GET /api/v1/scan/history/{plant_id} - Get scan history

πŸ—οΈ Database Schema

Users
β”œβ”€β”€ id (UUID, Primary Key)
β”œβ”€β”€ cognito_user_id (String, Unique)
β”œβ”€β”€ email (String)
└── name (String)

Plants
β”œβ”€β”€ id (UUID, Primary Key)
β”œβ”€β”€ user_id (Foreign Key)
β”œβ”€β”€ name (String)
β”œβ”€β”€ species (String)
β”œβ”€β”€ current_health_score (Float)
β”œβ”€β”€ plant_icon (String)
└── timestamps

PlantScans
β”œβ”€β”€ id (UUID, Primary Key)
β”œβ”€β”€ user_id (Foreign Key)
β”œβ”€β”€ plant_id (Foreign Key, Nullable)
β”œβ”€β”€ health_score (Float)
β”œβ”€β”€ disease_detected (String, Nullable)
β”œβ”€β”€ care_notes (Text, Nullable)
β”œβ”€β”€ is_healthy (Boolean)
└── scan_date (DateTime)

πŸš€ Deployment

AWS Deployment (Production)

  1. Backend: Deployed automatically via GitHub Actions to ECS
  2. Frontend: Build and deploy to S3 static hosting
  3. Database: Managed PostgreSQL on RDS

The CI/CD pipeline automatically:

  • Builds Docker images
  • Pushes to ECR
  • Updates ECS services
  • Runs database migrations

πŸ”§ Development

Project Structure

PlantPal/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ routers/      # API endpoints
β”‚   β”‚   β”œβ”€β”€ models.py     # Database models
β”‚   β”‚   β”œβ”€β”€ schemas.py    # Pydantic schemas
β”‚   β”‚   └── main.py       # FastAPI application
β”‚   β”œβ”€β”€ alembic/          # Database migrations
β”‚   └── Dockerfile
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/   # React components
β”‚   β”‚   β”œβ”€β”€ services/     # API services
β”‚   β”‚   └── assets/       # Static assets
β”‚   └── package.json
└── .github/workflows/    # CI/CD pipelines

Running Tests

# Backend tests
cd backend
python -m pytest

# Frontend tests
cd frontend
npm test

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Hugging Face for providing plant disease detection models
  • PlantNet for botanical species identification API
  • OpenRouter for LLM integration
  • AWS for cloud infrastructure services

πŸ“ž Contact

Sneha - GitHub

Project Link: https://github.com/itmesneha/PlantPal


Made with πŸ’š for plant lovers everywhere

About

An intelligent plant care companion that uses computer vision and AI to identify plant species, detect diseases, and provide personalized care recommendations. Helping you be a better pal to your plants :)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors