How vigneshsiva05/agritech-ai-platform works
AgriTech AI Platform combines crop and terrace analysis with a farmer-facing dashboard and an agricultural marketplace. The analysis workflow accepts a crop or terrace image, routes requests through analysis APIs to Gemini (and weather data for crop analysis), and presents results through analysis views. Marketplace users browse listings, manage carts and wishlists, and place orders; sellers manage profiles and products, while administrators review listings. Firebase provides authentication and Firestore-backed data. Connections reflect the sampled excerpts and SOURCE INDEX references; several routes and components were not sampled, so their internal wiring is omitted or marked unverified.
Main entry points: firebase.ts Firebase client · orderService.ts Order service · MarketplaceContext.tsx Cart and wishlist state · marketplaceService.ts Listings and seller service
Components 32
AI analysis
- Crop analysis API
src/app/api/analyze/route.ts - Gemini integration
src/lib/gemini.ts - Weather service
src/services/weatherService.ts - Crop analysis page
src/app/dashboard/crop-analysis/page.tsx - Crop uploader
src/components/crop/CropUploader.tsx - Crop result view
src/components/crop/CropAnalysisCard.tsx - Terrace analysis API
src/app/api/terrace-analysis/route.ts - Terrace planner
src/app/dashboard/terrace-planner/page.tsx - Terrace uploader
src/components/terrace/TerraceUploader.tsx - Terrace service
src/services/terraceService.ts - Terrace result view
src/components/terrace/TerraceAnalysisCard.tsx
Farmer workspace
- Dashboard overview
src/app/dashboard/page.tsx - Analysis history
src/components/history/AnalysisHistory.tsx - Hydroponics page
src/app/dashboard/hydroponics/page.tsx
Marketplace
- Marketplace workspace
src/app/dashboard/marketplace/page.tsx - Customer workspace
src/app/customer/page.tsx - Product storefront
src/components/marketplace/MarketStorefront.tsx - Cart and wishlist state
src/components/marketplace/MarketplaceContext.tsx - Listings and seller service
src/services/marketplaceService.ts - Cart persistence
src/services/cartService.ts - Wishlist persistence
src/services/wishlistService.ts - Checkout
src/components/marketplace/CheckoutModal.tsx - Order service
src/services/orderService.ts - Inventory service
src/services/inventoryService.ts - Order notifications
src/services/notificationService.ts - Marketplace administration
src/app/admin/page.tsx
Platform services
- Authentication guard
src/components/auth/ProtectedRoute.tsx - Language preferences
src/components/common/LanguageContext.tsx - Firebase client
src/lib/firebase.ts - Cloud Firestore
- Public landing page
src/app/page.tsx
Other components
- Farmer / buyer
Connections 34
- Farmer / buyer → Crop analysis page: opens
- Crop analysis page → Crop uploader: renders
- Crop uploader → Crop analysis API: submits image
- Crop analysis API → Gemini integration: requests analysis
src/app/api/analyze/route.ts - Crop analysis API → Weather service: gets weather
src/app/api/analyze/route.ts - Crop analysis page → Crop result view: renders
- Farmer / buyer → Terrace planner: opens
- Terrace planner → Terrace uploader: renders
- Terrace uploader → Terrace service: requests analysis
src/components/terrace/TerraceUploader.tsx - Terrace analysis API → Gemini integration: requests analysis
src/app/api/terrace-analysis/route.ts - Terrace uploader → Terrace result view: renders
src/components/terrace/TerraceUploader.tsx - Farmer / buyer → Dashboard overview: opens
- Farmer / buyer → Marketplace workspace: opens
- Marketplace workspace → Product storefront: renders
src/app/dashboard/marketplace/page.tsx - Marketplace workspace → Order service: loads orders
src/app/dashboard/marketplace/page.tsx - Customer workspace → Listings and seller service: loads products
src/app/customer/page.tsx - Customer workspace → Product storefront: renders
src/app/customer/page.tsx - Product storefront → Cart and wishlist state: uses state
src/components/marketplace/MarketStorefront.tsx - Cart and wishlist state → Listings and seller service: loads listings
src/components/marketplace/MarketplaceContext.tsx - Cart and wishlist state → Cart persistence: persists cart
src/components/marketplace/MarketplaceContext.tsx - Cart and wishlist state → Wishlist persistence: persists wishlist
src/components/marketplace/MarketplaceContext.tsx - Customer workspace → Checkout: renders
src/app/customer/page.tsx - Checkout → Order service: places order
src/components/marketplace/CheckoutModal.tsx - Order service → Inventory service: deducts stock
src/services/orderService.ts - Order service → Order notifications: sends updates
src/services/orderService.ts - Marketplace administration → Listings and seller service: moderates listings
src/app/admin/page.tsx - Authentication guard → Firebase client: checks identity
src/components/auth/ProtectedRoute.tsx - Language preferences → Firebase client: stores preference
src/components/common/LanguageContext.tsx - Listings and seller service → Firebase client: uses Firestore
src/services/marketplaceService.ts - Order service → Firebase client: uses Firestore
src/services/orderService.ts - Cart persistence → Firebase client: uses Firestore
src/services/cartService.ts - Wishlist persistence → Firebase client: uses Firestore
src/services/wishlistService.ts - Terrace service → Firebase client: uses Firestore
src/services/terraceService.ts - Farmer / buyer → Public landing page: visits