A modern web application for gardeners to track and manage seeds, plantings, and growing progress.
- Seed Catalog Management: Store information about seed varieties, brands, and growing requirements
- Image Recognition: Upload seed packet images with automatic information extraction via Google Gemini AI
- OCR Technology: Extract text and structured data from seed packets automatically
- Planting Tracker: Record and track plantings from seed to harvest
- Transplant Timeline: Document transplant events with locations and dates
- Photo Gallery: Attach and view multiple images for both seeds and plantings
- Responsive Design: Mobile-friendly interface works on phones, tablets, and desktop computers
- Backend: FastAPI (Python)
- Database: PostgreSQL with SQLAlchemy ORM
- Frontend: Bootstrap 5, Jinja2 templates
- Deployment: Docker and docker-compose
- Image Processing: OCR and structured data extraction via Google Gemini API
- Asynchronous: Built with async/await patterns for responsive performance
- Docker and Docker Compose
- Git
- For OCR functionality: Google Gemini API key (get one from https://makersuite.google.com/)
-
Clone this repository:
git clone https://github.com/MattUebel/plant-tracker.git cd plant-tracker -
Create a
.envfile in the project root with your configuration:# Database configuration POSTGRES_PASSWORD=your_password_here POSTGRES_USER=postgres POSTGRES_DB=plant_tracker DB_PORT=5433 # Application settings SECRET_KEY=your_secret_key_here APP_PORT=8000 DEBUG=false ENVIRONMENT=development # API keys for vision processing GEMINI_API_KEY=your_api_key_here GEMINI_MODEL=gemini-2.5-pro # Optional: Alternative OCR provider # ANTHROPIC_API_KEY=your_api_key_here # CLAUDE_MODEL=claude-3-7-sonnet-20250219 # Default OCR provider VISION_API_PROVIDER=gemini
-
Start the application:
docker compose up -d
-
Access the application in your web browser:
http://localhost:8000
You can run Plant Tracker as a systemd service on a Raspberry Pi, which allows it to start automatically on boot and be managed as a system service.
Prerequisites:
- Raspberry Pi running Raspbian OS
- Git
- Internet connection
- Google Gemini API key for OCR functionality (get one from https://makersuite.google.com/)
To install:
-
Clone the repository:
git clone https://github.com/MattUebel/plant-tracker.git
-
Run the installation script:
cd plant-tracker sudo ./scripts/install_service.sh -
Follow the prompts to configure your installation, including adding your Gemini API key.
-
Once installed, you can manage the service with the following commands:
plant-tracker start # Start the service plant-tracker stop # Stop the service plant-tracker restart # Restart the service plant-tracker status # Check service status plant-tracker logs # View service logs plant-tracker update # Update to latest version plant-tracker config # Edit configuration file plant-tracker backup # Create a database backup plant-tracker restore # Restore from a backup
-
Access the application in your web browser at http://[raspberry-pi-ip]:8000
The application uses Google's Gemini API to extract information from seed packet images:
- Upload a seed packet image
- The system automatically extracts text using OCR
- AI processes the extracted text to identify key information like plant name, variety, planting depth, spacing, etc.
- You can review and edit the extracted information before saving
Track your plants from seed to harvest:
- Create plantings from your seed catalog
- Record sowing dates, locations, and conditions
- Document transplant events when seedlings are moved
- Add multiple photos to track growth over time
- Record notes and observations throughout the growing season
Coming soon
βββ app/ # Main application code
β βββ models/ # SQLAlchemy database models
β βββ routers/ # FastAPI route handlers
β βββ templates/ # Jinja2 HTML templates
β βββ utils/ # Utility functions and classes
βββ docs/ # Documentation files
βββ scripts/ # Utility scripts
β βββ install_service.sh # Raspberry Pi systemd installation
β βββ migrate.sh # Database migration helper
β βββ psql.sh # PostgreSQL management helper
βββ uploads/ # Storage for uploaded images
βββ compose.yml # Docker Compose configuration
βββ Dockerfile # Container definition
To run the application in development mode:
docker compose upFor live log viewing:
docker compose logs -fTo create a new database migration after model changes:
./scripts/migrate.sh migrate "Description of changes"
./scripts/migrate.sh upgradeOr using Docker Compose directly:
docker compose exec app alembic revision --autogenerate -m "Description of changes"
docker compose exec app alembic upgrade headThe psql.sh script provides convenient shortcuts for database operations:
./scripts/psql.sh shell # Open a PostgreSQL shell
./scripts/psql.sh exec # Execute SQL commands
./scripts/psql.sh dump # Create a database backup
./scripts/psql.sh restore # Restore from a backup- Database Connection Errors: Ensure the database container is running with
docker compose ps - Image Upload Issues: Check that the uploads directory has proper permissions
- OCR Not Working: Verify your API key is correctly set in the .env file
View application logs for more detailed error information:
docker compose logs appThis project is licensed under the MIT License - see the LICENSE file for details.
- FastAPI for the amazing web framework
- SQLAlchemy for the ORM system
- Bootstrap for the frontend components
- Google Gemini API for image recognition capabilities