Welcome to Vinesight
Relevant source files
The following files were used as context for generating this wiki page:
Vinesight is a progressive web and mobile application designed as a digital companion for grape farming in India. Its core purpose is to digitize and optimize farming operations by replacing manual notebooks with reliable digital tools. The platform is built on deep scientific research and practical experience from real-world vineyards, offering features for calculating, recording, and optimizing irrigation, nutrition, spraying, and harvesting.
The application targets Indian grape farmers, agricultural consultants, and farm supervisors. It provides a multi-language user experience, supporting English, Hindi, and Marathi. The project is developed in distinct phases, starting with core record-keeping and calculators, and progressively integrating sophisticated AI-powered features for disease detection, predictive analytics, and personalized crop advisories.
Sources: context/PRD.md:10-17, 22-25, public/manifest.json:2-3
Technical Architecture
Vinesight is built as a modern web application using a robust and scalable technology stack. The architecture is designed to support real-time data synchronization, client-side AI processing, and a seamless multi-language user experience.
Sources: AGENTS.md:12-18, context/PRD.md:210-227
Core Technologies
The following diagram illustrates the main components of the Vinesight architecture.
This diagram shows the high-level architecture of the Vinesight application, detailing the frontend, backend, and AI service components.
Sources: AGENTS.md:12-18, context/PRD.md:210-227, package.json, src/app/layout.tsx:13, 15
Key Dependencies
The project relies on several key libraries to enable its functionality.
| Library | Purpose | Source |
|---|---|---|
next | React framework for building the PWA. | package.json:44 |
@supabase/ssr | Server-side rendering utilities for Supabase. | package.json:38 |
@tensorflow/tfjs | Client-side machine learning for computer vision. | package.json:40 |
ai | Vercel AI SDK for integrating language models. | package.json:42 |
i18next | Framework for internationalization (multi-language support). | package.json:48 |
shadcn/ui | UI components built with Radix UI and Tailwind CSS. | AGENTS.md:14 |
dexie | IndexedDB wrapper for PWA offline support. | package.json:46 |
openai | SDK for interacting with OpenAI's conversational AI. | package.json:45 |
Sources: package.json, AGENTS.md:12-18
Product Features & Development Phases
Vinesight's development is structured into multiple phases, progressively adding more advanced capabilities.
Sources: context/PRD.md:29-208, CLAUDE.md:13-37
Development Roadmap
The project follows a clear, phased roadmap from a basic record-keeping tool to a proactive AI advisor.
This flowchart outlines the four main development phases of the Vinesight project and the key features introduced in each phase.
Sources: context/PRD.md:29-208, CLAUDE.md:13-37
Feature Breakdown
| Feature Group | Description | Phase | Status | Source |
|---|---|---|---|---|
| Farm Management | Add, edit, and manage multiple farms with details like area, grape variety, and planting date. | 1 | ✅ Completed | context/PRD.md:33-35 |
| Scientific Calculators | Includes calculators for Evapotranspiration (ETc), MAD, Nutrients, and Leaf Area Index (LAI). | 1 | ✅ Completed | context/PRD.md:38-60 |
| Operations Journal | Digital log for daily operations like irrigation, spraying, fertigation, harvesting, and expenses. | 1 | ✅ Completed | context/PRD.md:63-79 |
| AI Disease Detection | TensorFlow.js-powered computer vision to identify grape diseases from images. | 2 | ✅ Completed | context/PRD.md:86-92 |
| AI Chatbot Assistant | OpenAI-powered conversational assistant for farming guidance in multiple languages. | 2 | ✅ Completed | context/PRD.md:94-100 |
| Personalized Crop Advisory | Proactive AI agronomist that provides smart recommendations based on farm history, weather, and soil. | 3 | 🧠 In Development | context/PRD.md:130-137 |
| Smart Task Generator | AI-generated daily and weekly task lists based on weather, growth stage, and priorities. | 3 | 🧠 In Development | context/PRD.md:139-145 |
| Predictive Pest & Disease Alerts | Early warning system that provides alerts 24-72 hours before optimal treatment windows. | 3 | 🧠 In Development | context/PRD.md:147-153 |
Sources: context/PRD.md, CLAUDE.md
Advanced AI & Data Model (Phase 3)
Phase 3 introduces a proactive AI system with a more sophisticated data model to enable personalized recommendations and predictive insights. The backend schema is extended to store AI-specific profiles, predictions, and analytics.
Sources: CLAUDE.md:41-118
Database Schema for AI
The following ER diagram shows the new tables and relationships being added in Phase 3 to support advanced AI features.
This ER diagram illustrates the key database tables for the Phase 3 AI system, including farmer profiles, task recommendations, and pest predictions.
Sources: CLAUDE.md:42-118
Key AI Algorithms
Phase 3 implements several advanced algorithms to power its features:
- Personalized Advisory Algorithm:
Recommendation Score = w1*Historical_Success + w2*Weather_Fit + ... - Smart Task Generation:
Task_Priority = Urgency_Score * Impact_Factor * ... - Pest Prediction Models:
Pest_Risk = f(temperature_avg, humidity_max, rainfall_7day, ...) - Profitability Optimization:
ROI_Score = (Expected_Revenue - Total_Costs) / Total_Investment
Sources: context/PRD.md:258-279
Internationalization (i18n)
A core requirement of Vinesight is to be accessible to a diverse user base in India. The application uses the i18next and react-i18next libraries to provide full UI translations in English, Hindi (hi), and Marathi (mr).
The translation resources are structured in a single file, making it easy to manage and update text across the application.
Sources: src/lib/i18n.ts, AGENTS.md:17
Translation Resource Structure
Translations are managed within src/lib/i18n.ts using a nested JSON object. This allows for a logical grouping of translations by feature or component.
// File: src/lib/i18n.ts:5-23
const resources = {
en: {
translation: {
// Navigation
navigation: {
dashboard: 'Dashboard',
farmManagement: 'Farm Management',
calculators: 'Calculators',
// ...
},
// Homepage
home: {
title: 'VineSight',
subtitle: 'Your Digital Companion for Scientific Grape Farming',
// ...
},
},
},
hi: {
// ... Hindi translations
},
mr: {
// ... Marathi translations
}
}
This code snippet from src/lib/i18n.ts shows the structure for storing English, Hindi, and Marathi translations.
Sources: src/lib/i18n.ts:5-523
User Interface and Pages
The application is a Progressive Web App (PWA) built with Next.js and React, ensuring a responsive experience on mobile and desktop. The UI is constructed using shadcn/ui components.
Sources: AGENTS.md:13-14, public/manifest.json
Main Landing Page
The primary entry point is the landing page, which showcases the application's core value propositions: monitoring crop health, predicting yields, and managing operations. It uses a tab-like interface to cycle through images representing these features.
Sources: src/app/page.tsx:191-270
Content & SEO Pages
In addition to the core application, Vinesight includes several static content pages designed to provide value to users and improve search engine optimization (SEO). These pages act as comprehensive guides on relevant topics.
- /grape-farming-guide: A complete guide to modern vineyard management, covering topics from variety selection to disease management.
- /precision-agriculture: An overview of technologies like GPS, IoT sensors, and data analytics in modern farming.
Sources: src/app/grape-farming-guide/page.tsx, src/app/precision-agriculture/page.tsx
Conclusion
Vinesight is a comprehensive, multi-phase project aimed at revolutionizing grape farming in India. It combines a user-friendly interface, scientific agricultural calculations, and a powerful, progressively enhanced AI engine. The architecture is modern and scalable, designed to evolve from a simple digital record-keeper into a proactive, intelligent farming advisor. Its multi-language support and focus on the specific needs of Indian farmers position it as a critical tool for the region's agricultural technology landscape.
Sources: context/PRD.md:10-17, CLAUDE.md:323-341