Fedai is an intelligent assistant designed to help you understand and improve your plant's health. By leveraging advanced image analysis and contextual data (like your location, local weather, and soil characteristics), Fedai provides insightful analysis and actionable solutions.
- π€ AI-Powered Diagnosis - Multi-provider support (Gemini, OpenRouter, Local AI)
- πΈ Image Analysis - Advanced plant disease detection from photos
- π Environmental Context - Location, weather, soil, and elevation data
- π Multi-Language - Support for multiple languages
- π Real-Time Monitoring - Service health status dashboard
- π¨ Modern UI - Responsive design with smooth animations
- π§ͺ Well-Tested - Comprehensive test suite with 22 passing tests
- π³ Docker Ready - Easy deployment with Docker Compose
- β‘ Performance Optimized - Web Worker image compression, race condition-free async operations
- π‘οΈ Error Recovery - Retry buttons on error states, error boundaries prevent crashes
- β¨οΈ Keyboard Shortcuts - Ctrl+Enter to analyze, Escape to close modals
This project uses an intentional monorepo structure:
fedai/
βββ π Frontend (Root Directory)
β βββ components/ # React components
β βββ contexts/ # React contexts (AI Settings, etc.)
β βββ hooks/ # Custom React hooks
β βββ pages/ # Page components
β βββ providers/ # AI provider implementations
β βββ services/ # API service clients
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions
β β βββ workers/ # Web Workers (image compression)
β β βββ imageCompression.ts # Image compression utilities
β βββ App.tsx # Main app component
β βββ index.tsx # React entry point
β βββ index.html # HTML entry with import maps
β βββ types.ts # Centralized types
β βββ constants.ts # App constants
β βββ localization.ts # Multi-language support
β βββ theme.css # Global styles
β βββ package.json # Frontend dependencies
β
βββ π fedai-backend-proxy/ # Backend API Server
β βββ src/
β β βββ api/ # Controllers, routes, middleware
β β βββ services/ # AI provider services
β β βββ utils/ # Backend utilities
β βββ server.js # Server entry point
β βββ package.json # Backend dependencies
β
βββ π docs/ # Comprehensive documentation
β βββ QUICKSTART.md # 3-step setup guide
β βββ DEPLOYMENT.md # Production deployment
β βββ AI_PROVIDER_SETUP.md
β βββ ...
β
βββ π Configuration Files
βββ docker-compose.yml # Production Docker setup
βββ docker-compose.dev.yml # Development Docker setup
βββ render.yaml # Render deployment config
βββ vite.config.ts # Vite bundler config
βββ tsconfig.json # TypeScript config
Why frontend in root? This structure supports our unique dev approach using esm.sh/tsx for browser-based TypeScript compilation during development, while using Vite for optimized production builds.
Imagine you have a plant that looks sick, but you're not sure what's wrong or how to help it. Fedai is like having a knowledgeable gardening assistant in your pocket!
- Snap a Photo: Take a picture of your plant.
- Get Insights: Fedai analyzes the photo and, if you allow it, uses your location to consider local environmental factors.
- Understand the Problem: It identifies potential diseases or issues.
- Find Solutions: Fedai suggests ways to treat your plant, including different approaches and estimated costs.
It's designed to be easy to use, even if you don't know much about plant diseases or technology.
Fedai is a full-stack web application with clear separation of concerns:
- Tech Stack: React 19, TypeScript, Vite, Tailwind CSS
- Features: Image upload, AI settings, multi-language support, real-time analysis
- Location: All source files in root directory (see structure above)
- Unique Approach: Uses
esm.sh/tsxfor dev + Vite for production builds - π Frontend Documentation
- Tech Stack: Node.js, Express, multi-provider AI integration
- Purpose: Secure API key management, external service orchestration
- Services:
- AI Providers (Gemini, OpenRouter, Local AI)
- Weather data (Open-Meteo)
- Soil data (SoilGrids)
- Plant database (OpenPlantBook)
- π Backend Documentation
β Security: API keys never exposed to browser β Modularity: Clear backend/frontend separation β Flexibility: Support for multiple AI providers β Developer Experience: Simplified dev workflow with hot reload
Access the deployed application at [your-deployment-url] (coming soon)
Get started in 3 steps - see QUICKSTART.md
# 1. Clone and setup backend
cd fedai-backend-proxy
npm install
# Add API keys to .env file
# 2. Setup frontend (in separate terminal)
cd ..
npm install
# 3. Run both services
npm run dev # Frontend (http://localhost:5173)
cd fedai-backend-proxy && npm start # Backend (http://localhost:3001)docker-compose -f docker-compose.dev.yml up
# Frontend: http://localhost:5173
# Backend: http://localhost:3001π Full Documentation:
- Quick Start Guide - 3-step setup
- AI Provider Setup - Configure Gemini/OpenRouter/Local AI
- Deployment Guide - Deploy to Render
- Troubleshooting - Common issues
- Changelog - Version history
- Testing Guide - Test suite documentation
- AI-Powered Image Analysis: Identifies plant health issues from images.
- Contextual Data Integration: Uses location, weather, and soil data for more accurate diagnoses.
- Actionable Solutions: Provides cultural, biological, and chemical treatment options.
- User-Friendly Interface: Designed for ease of use.
- Multi-language Support.
We hope Fedai helps you keep your plants healthy and thriving!
Fedai has been optimized for performance and reliability with several key improvements:
- Non-Blocking Image Compression: Uses Web Workers with OffscreenCanvas to compress images without freezing the UI (eliminates 2-3 second freeze on large uploads)
- API Preconnect: DNS prefetch and preconnect for all external APIs (~200ms faster API calls)
- Race Condition Free: Uses native AbortController for proper async operation cancellation
- Loading Skeletons: Smooth loading states for better perceived performance
- Error Boundaries: Component crashes don't bring down the entire app
- Retry Buttons: Easy recovery from transient network errors
- Automatic Cleanup: Proper resource cleanup on component unmount
- User-Friendly Errors: Clear, actionable error messages in multiple languages
- Keyboard Shortcuts:
Ctrl+Enter- Trigger plant analysisEscape- Close modals
- Responsive Design: Works seamlessly on desktop, tablet, and mobile
- Multi-Language Support: Full localization in multiple languages
- Explicit CORS: No wildcard origins, explicit whitelist only
- Rate Limiting: Endpoint-specific rate limits (20 AI analyses/hour, 60 data requests/15min)
- Secure API Key Management: All API keys stored server-side only
See IMPROVEMENTS_COMPLETED.md for detailed technical information.