AnnaData is a full-stack smart agriculture management platform that gives farmers real-time data, AI-powered insights, and actionable tools to optimise crop yields, monitor field conditions, and manage day-to-day farm operations.
- Overview
- Features
- Tech Stack
- Project Structure
- Getting Started
- Environment Variables
- API Reference
- Pages & Routes
- Internationalisation
- Contributing
AnnaData (repository name: AITD) is designed to be your intelligent farming companion for data-driven agriculture management and crop optimisation. It brings together weather forecasting, soil monitoring, pest detection, commodity market prices, inventory tracking, financial analysis, and WhatsApp alert notifications into a single, easy-to-use web application.
A comprehensive at-a-glance overview of your farm:
- Welcome Section β Quick platform introduction.
- Technology Section β Overview of the three core pillars: Weather Monitoring, Soil Analysis, and Crop Management.
- Soil Monitoring β Real-time metrics for soil moisture, temperature, and nitrogen levels with progress indicators and actionable recommendations.
- Commodity Market Prices β Live price tracking (Wheat, Corn, Soybeans, Cotton) with trend indicators.
- Crop Alerts β Colour-coded alert cards highlighting fields that need attention.
- Farm Weather Widget β Current temperature, humidity, wind speed, and a 3-day forecast.
- Agricultural Pest Monitor β Field scan results with pest-risk indicators (Aphid Activity, Corn Borer Risk) and a "Run field scan" action button.
- Agriculture News β Latest news headlines relevant to farming.
- Farm Management Quick Links β Shortcuts to Crop Reports, Yield Analytics, and Farm Settings.
- Scrolling critical-update ticker banner.
- Weekly Forecast Carousel β Interactive card carousel sourced from the OpenWeatherMap API, defaulting to the user's geolocation or Mapusa (Goa, India) as a fallback.
- Weather Details Grid β Detailed breakdown for the selected forecast day.
- Informational text section explaining the data sources and methodology.
A full suite of farm-operations tools:
| Module | Description |
|---|---|
| Crop Management | Track crop varieties, planting dates, growth stages, and growth-progress bars with pest-risk alerts. |
| Yield Predictions | AI-powered yield predictions (bu/acre) compared against current yields with percentage-change indicators. |
| Inventory Management | Four-category inventory (Seeds, Fertilizers, Equipment, Harvested Crops) with a recent-transactions table. |
| Financial Overview | Annual revenue, expenses, and predicted profit with an expense-breakdown chart (Seeds, Equipment, Labour, Fuel). |
| Resource Consumption | Usage tracking for Diesel Fuel, Water, and Electricity with an AI-generated optimisation suggestion. |
| Product Shelf Life | Tracks harvested produce expiry dates and raises alerts when stock is nearing end-of-shelf-life. |
| Market Operations | Buy/sell transaction log with selling, buying, and net revenue summaries. |
| Task Scheduler | Prioritised farm-task list (High / Medium / Low) with date and time scheduling and completion tracking. |
The backend exposes a /notify-farmer endpoint that sends WhatsApp messages via the Twilio Sandbox to a farmer's phone number. Three alert types are supported:
weatherβ Rain forecast notification.droughtβ Prolonged dry-period warning.fertilizerβ Fertiliser application reminder.
The UI supports English and Hindi via i18next with automatic browser-language detection.
| Technology | Version | Purpose |
|---|---|---|
| React | 19 | UI library |
| Vite | 6 | Dev server and build tool |
| Tailwind CSS | 4 | Utility-first CSS |
| React Router | 7 | Client-side routing |
| Lucide React | 0.487 | Icon library |
| i18next | 24 | Internationalisation |
| Radix UI | latest | Accessible UI primitives |
| class-variance-authority | 0.7 | Component variant management |
| Technology | Version | Purpose |
|---|---|---|
| Node.js | 18+ | Runtime |
| Express | 5 | HTTP server |
| node-fetch | 3 | Server-side HTTP requests |
| Twilio | 5 | WhatsApp alert messaging |
| dotenv | 16 | Environment variable management |
| cors | 2 | Cross-origin resource sharing |
- OpenWeatherMap β Current weather and 5-day forecast data.
- Twilio WhatsApp Sandbox β WhatsApp message delivery.
AITD/
βββ Backend/
β βββ package.json
β βββ src/
β βββ server.js # Express server, Weather API proxy, Twilio alerts
β βββ test.rest # Manual API test file
βββ Frontend/
βββ index.html
βββ vite.config.js
βββ package.json
βββ src/
βββ main.jsx # React entry point
βββ App.jsx # Root layout (Navbar + Outlet + Footer)
βββ i18.js # i18next configuration
βββ routers/
β βββ router.jsx # Application routes
βββ pages/
β βββ Home.jsx # Home dashboard
β βββ Weather.jsx # Weather dashboard
β βββ FarmManagement.jsx # /resources page
β βββ Detect.jsx # Detect page (in development)
β βββ Manage.jsx # Manage page (in development)
β βββ Login.jsx # Login page
βββ components/
β βββ Navbar.jsx
β βββ Footer.jsx
β βββ WelcomeSection.jsx
β βββ TechnologySection.jsx
β βββ FeatureCards.jsx
β βββ SoilMonitoring.jsx
β βββ CommodityPrices.jsx
β βββ CropAlerts.jsx
β βββ FarmWeather.jsx
β βββ PestMonitor.jsx
β βββ AgricultureNews.jsx
β βββ FarmManagement.jsx
β βββ CardCarousel.jsx
β βββ GridSection.jsx
β βββ ScrollingText.jsx
β βββ Separator.jsx
β βββ TextSection.jsx
β βββ PageHeader.jsx
β βββ farm-management/
β βββ CropManagement.jsx
β βββ YieldPredictions.jsx
β βββ InventoryManagement.jsx
β βββ FinancialOverview.jsx
β βββ ResourceConsumption.jsx
β βββ ProductShelfLife.jsx
β βββ MarketOperations.jsx
β βββ TaskScheduler.jsx
βββ locales/
β βββ en/translation.json # English strings
β βββ hn/translation.json # Hindi strings
βββ lib/
βββ utils.js
- Node.js β₯ 18 (includes npm)
- A free OpenWeatherMap API key
- A Twilio account with WhatsApp Sandbox enabled (for alert notifications)
# 1. Navigate to the backend directory
cd AITD/Backend
# 2. Install dependencies
npm install
# 3. Create the environment file
cp .env.example .env # or create .env manually (see Environment Variables below)
# 4. Start the development server (auto-restarts on file changes)
npm run devThe backend server starts at http://localhost:3000.
# 1. Navigate to the frontend directory
cd AITD/Frontend
# 2. Install dependencies
npm install
# 3. Start the Vite dev server
npm run devThe frontend dev server starts at http://localhost:5173.
Note: The frontend proxies weather data through the backend at
http://localhost:3000/api/weather. Make sure the backend is running before using the Weather Dashboard.
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Production build (outputs to dist/) |
npm run preview |
Preview the production build locally |
npm run lint |
Run ESLint |
Create a .env file inside the Backend/ directory with the following keys:
# OpenWeatherMap API key
WEATHER_API_KEY=your_openweathermap_api_key
# Twilio credentials (for WhatsApp alerts)
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token| Variable | Required | Description |
|---|---|---|
WEATHER_API_KEY |
β Yes | API key from openweathermap.org |
TWILIO_ACCOUNT_SID |
β Yes (for alerts) | Found in your Twilio Console Dashboard |
TWILIO_AUTH_TOKEN |
β Yes (for alerts) | Found in your Twilio Console Dashboard |
All backend endpoints are served from http://localhost:3000.
Fetches current weather conditions and a 5-day / 3-hour forecast from OpenWeatherMap.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
lat |
number |
No | Latitude (defaults to Mapusa, Goa) |
lon |
number |
No | Longitude (defaults to Mapusa, Goa) |
Example Request
GET /api/weather?lat=15.5957&lon=73.8091
Example Response
{
"current": { /* OpenWeatherMap current weather object */ },
"forecast": { /* OpenWeatherMap forecast object with list[] */ }
}Sends a WhatsApp alert message to a farmer via the Twilio Sandbox.
Request Body
{
"phone": "+919876543210",
"alertType": "weather"
}| Field | Type | Required | Values |
|---|---|---|---|
phone |
string |
β Yes | Recipient phone number in E.164 format (e.g. +919876543210) |
alertType |
string |
β Yes | "weather", "drought", or "fertilizer" |
Example Response
{
"success": true,
"sid": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}Twilio Sandbox Note: The recipient must first opt-in to the Twilio WhatsApp Sandbox by sending
join <sandbox-keyword>to+1 415 523 8886before they can receive messages.
| Route | Page | Description |
|---|---|---|
/ |
Home | Main dashboard with soil, weather, pest, commodity, and news widgets |
/Weather |
Weather Dashboard | Forecast carousel and detailed weather grid |
/resources |
Farm Management | Full farm-operations suite (crops, inventory, finance, tasks) |
/detect |
Detect | Disease/pest detection (in development) |
/manage |
Manage | Additional management tools (in development) |
/login |
Login | User authentication (in development) |
The frontend uses i18next with react-i18next and automatic browser-language detection.
- English translations:
Frontend/src/locales/en/translation.json - Hindi translations:
Frontend/src/locales/hn/translation.json
The fallbackLng is set to "en", so English strings are used when a translation key is missing in the detected language.
To add a new language:
- Create a new folder under
Frontend/src/locales/<lang-code>/. - Add a
translation.jsonfile with the required keys. - Import and register it in
Frontend/src/i18.js.
- Fork the repository and create a new branch:
git checkout -b feature/your-feature-name - Make your changes and ensure the code lints cleanly:
npm run lint(inFrontend/) - Commit your changes with a clear message.
- Open a Pull Request against the
mainbranch.