AgriSense is a smart agricultural intelligence system designed to empower farmers and agricultural enthusiasts with AI-backed crop analysis, real-time weather monitoring, and regional analytics. This repository contains the improved, modular structure of the AgriSense platform.
The project is structured as a monorepo containing two main parts:
agrisense/
├── backend/ # Express API Server
└── frontend/ # React + Vite Web Client
The backend is built with Node.js and Express.js, using MongoDB for storage and integrates with Google's Gemini AI and OpenWeather APIs.
- Navigate to the backend directory:
cd backend - Install dependencies:
npm install
- Create a
.envfile in thebackend/directory with the following variables:PORT=5000 MONGO_URI=your_mongodb_connection_uri GEMINI_API_KEY=your_google_gemini_api_key JWT_SECRET=your_jwt_signing_secret OPENWEATHER_API_KEY=your_openweather_api_key
- Run the development server (runs nodemon):
npm run dev
The frontend is a modern SPA powered by React 19, Vite, TypeScript, and Framer Motion for premium glassmorphism layouts and transitions.
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install
- Run the development server:
npm run dev
- Express.js / Node.js: Core API development.
- Google Gen AI SDK (
@google/generative-ai): Powering crop advice and AI chats. - Mongoose / MongoDB: Database modeling and data persistence.
- Express Rate Limit & Helmet: Security headers and API protection.
- Joi: API payload validation schemas.
- Vite & React 19: Ultra-fast build toolchain and rendering.
- Framer Motion: Smooth interface transitions and animations.
- Lucide Icons: Modern vector icon set.
- Glassmorphism UI: Beautiful aesthetic styles customized for agricultural stats.