Know your land before you plant a single seed.
Farm.ai is a precision agriculture platform that analyzes soil composition, climate history, vegetation health, and crop compatibility for any property using USDA data, satellite imagery, and AI-powered recommendations.
- Soil Intelligence — USDA SSURGO soil classification, pH levels, organic matter, drainage
- Climate Profiling — 30-year historical normals, growing season length, hardiness zones, frost dates
- Vegetation Health — Sentinel-2 NDVI (Normalized Difference Vegetation Index) analysis
- Crop Compatibility Matrix — Suitability scores for 15+ crops with yield projections
- Economic Projections — 3 revenue scenarios (Max Yield, Low Maintenance, Pest Resistant)
✨ All NEW in this release:
- Inline glowing citation pills
[1][2] [3] next to every data point - Expandable "Sources & Factuality" footer revealing all 7 government/scientific databases
- Transparency: See exactly which agencies powered each analysis
- MapLibre integration showing 3-4 nearby parcels with similar soil/yield profiles
- AI-recommended parcels displayed as warm orange polygons with yield match %, soil match %
- Click popup for quick comparison, "Run Full Analysis" button for deep dives
- Auto-fetches recommendations when map loads
- Floating glassmorphism chat button (bottom-right, always accessible)
- Context-aware AI responses powered by Gemini 2.5 Flash
- Full property analysis bundled into every query for hyper-personalized answers
- Typing indicator, suggestion chips, message history persistence
- Framer Motion animations: spring drawer, slide-up messages, smooth transitions
- Real-time sky dome with sun position tracking (SunCalc integration)
- Volumetric cloud systems (clear: 3 clouds, rain/snow: 8 clouds)
- Dynamic particle systems: rain (3000 instances), snow (800 sparkles)
- Procedurally-generated grass-blade normal maps & roughness textures
- Weather-responsive materials (clear→wet→snowy)
- Cinematic post-processing: Depth of Field, Bloom, Vignette, Hue-Saturation boost
- Interactive OrbitControls with responsive terrain
| Layer | Technology |
|---|---|
| Frontend | Next.js 16.1 (Turbopack), React 18, TypeScript, Tailwind CSS |
| 3D Rendering | React Three Fiber, Three.js, @react-three/drei, @react-three/postprocessing |
| State Management | Zustand (lightweight, performant) |
| UI Animations | Framer Motion (spring, AnimatePresence) |
| Map | MapLibre GL (open-source, privacy-first) |
| Backend | FastAPI (Python), Google Gemini API |
| Data Sources | USDA SSURGO, Open-Meteo, Copernicus Sentinel-2, NWS, NOAA |
farm-ai/
├── plantai/ # Next.js frontend
│ ├── src/
│ │ ├── app/
│ │ │ ├── layout.tsx # Root layout
│ │ │ ├── page.tsx # Landing page
│ │ │ ├── map/page.tsx # Drawing interface
│ │ │ ├── analysis/[id]/ # Main dashboard (7 tabs)
│ │ │ └── farm/[id]/ # 3D visualization
│ │ ├── components/
│ │ │ ├── chat/
│ │ │ │ └── AgronomistChat.tsx # AI chat drawer
│ │ │ ├── farm/
│ │ │ │ ├── Atmosphere.tsx # Sky, sun, fog
│ │ │ │ ├── WeatherSystem.tsx # Rain/snow
│ │ │ │ ├── PostProcessing.tsx # Effects
│ │ │ │ ├── TerrainMesh.tsx # Textures
│ │ │ │ └── FarmScene.tsx # 3D orchestrator
│ │ │ ├── map/
│ │ │ │ └── MapCanvas.tsx # MapLibre + recommendations
│ │ │ └── ui/
│ │ │ ├── CitationPill.tsx # Citation pills
│ │ │ └── SourcesFooter.tsx # Sources footer
│ │ └── lib/
│ │ ├── store.ts # Zustand state
│ │ └── apiClient.ts # API calls
│ └── package.json
│
└── plantai-backend/ # FastAPI backend
├── main.py # API endpoints
├── services.py # Data fetching
└── requirements.txt # Dependencies
- Node.js 18+
- Python 3.9+
- Git
# Clone
git clone https://github.com/YOUR_USERNAME/farm-ai.git
cd farm-ai
# Frontend
cd plantai
npm install
# Backend
cd ../plantai-backend
pip install -r requirements.txtFrontend (.env.local in plantai/)
NEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_MAPTILER_KEY=YOUR_MAPTILER_KEY # OptionalBackend (.env in plantai-backend/)
GOOGLE_API_KEY=YOUR_GEMINI_API_KEYTerminal 1:
cd plantai
npm run dev
# http://localhost:3000Terminal 2:
cd plantai-backend
python main.py
# http://localhost:8000/docs- Enter Address — Search bar with Nominatim geocoding
- Draw Property — Click points on map to outline field
- Analyze — Backend fetches USDA, Open-Meteo, Sentinel-2 data in parallel
- Explore Dashboard — 7 tabs: Overview, Soil, Climate, Crops, Economics, Agents, Plan
- View Citations — Click pill
[1]to see sources in expandable footer - Chat with AI — Click green button, ask context-aware questions
- 3D Visualization — Click "3D View" for interactive farm scene
POST /api/chat
{
"message": "Why tomatoes?",
"history": [...],
"context": { "soilData": {...}, "cropMatrix": [...] }
}
→ {"reply": "Your Cecil sandy loam with 6.2 pH..."}
POST /api/recommendations
{ "lat": 40.79, "lng": -77.86 }
→ GeoJSON FeatureCollection with 4 nearby parcels
- Glassmorphism — Blur, semi-transparency, subtle borders
- Dark Mode —
#0a0d0abackground,#4ade80accent green - Responsive — Mobile-first Tailwind CSS
- Smooth Animations — Framer Motion spring easing
- Accessibility — ARIA labels, semantic HTML
Frontend:
@react-three/fiber— R3F for 3D@react-three/postprocessing— Post-process effectsmaplibre-gl— Interactive mapsframer-motion— Smooth animationszustand— Lightweight state
Backend:
fastapi— Modern Python APIgoogle-genai— Gemini AI integrationpydantic— Data validationshapely— Geospatial math
# Build verification
cd plantai && npm run build
# API test
curl -X POST http://localhost:8000/api/chat \
-H "Content-Type: application/json" \
-d '{"message":"Crops?","history":[],"context":{"soilData":{"name":"Loam","ph":6.5}}}'Pre-deployment:
- Rotate all API keys
- Enable HTTPS
- Add authentication (OAuth2)
- Configure CORS origins
- Enable rate limiting
- Audit Gemini prompts
- Phase 2: IoT soil sensors, subscription tiers, mobile app
- Phase 3: Drone imagery, real-time alerts, insurance optimization
MIT License — See LICENSE file
- Fork the repo
- Create feature branch (
git checkout -b feature/amazing) - Commit (
git commit -m 'Add feature') - Push (
git push origin feature/amazing) - Open PR
- Issues: GitHub Issues
- Email: contact@farm.ai
Made with 🌾 for farmers who think ahead.