Loading repository dataβ¦
Loading repository dataβ¦
Harsh-1165 / repository
π± India's smart farm-to-market platform β AI crop diagnosis, live mandi prices, expert advisory & direct marketplace for 140M+ farmers
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
πΎ Empowering Indian Farmers with AI, Real-Time Market Intelligence & Expert Advisory
π Live Demo Β· π Full Docs Β· π Report Bug Β· β Star this repo
Indian farmers lose βΉ92,651 Crore annually due to:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π΄ Middlemen taking 40-60% of actual sale price β
β π΄ 35% crop loss due to undetected diseases β
β π΄ No access to real-time mandi prices before harvest β
β π΄ Agricultural experts unreachable in rural areas β
β π΄ Information asymmetry exploited by traders β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
KrushiSetu fixes ALL of this in ONE platform.
graph LR
U1["π¨βπΎ Farmer"] --> FE
U2["π¬ Expert"] --> FE
U3["π Consumer"] --> FE
FE["π₯οΈ Next.js Frontend"] --> BE
BE["β‘ Express API"] --> AUTH["π Auth & Users"]
BE --> MKT["π Marketplace"]
BE --> MANDI["π Mandi Prices"]
BE --> AI["π€ AI Advisory"]
BE --> QA["π¬ Q&A System"]
AI --> ML["π Python ML Engine"]
MANDI --> AGM["π‘ Agmarknet API"]
BE --> DB[("ποΈ MongoDB Atlas")]
BE --> CLOUD["βοΈ Cloudinary CDN"]
BE --> NOTIFY["π Notifications"]
NOTIFY --> SMS["π± Twilio SMS"]
NOTIFY --> PUSH["π₯ Firebase Push"]
NOTIFY --> EMAIL["π§ Nodemailer"]
sequenceDiagram
actor Farmer
actor Expert
participant App as KrushiSetu
participant AI as ML Engine
participant Mandi as Agmarknet API
participant Buyer
Farmer->>App: Upload crop photo
App->>AI: Send image for diagnosis
AI-->>App: Disease detected + treatment plan
App-->>Farmer: β‘ Instant diagnosis in <2s
Farmer->>App: Check mandi prices
App->>Mandi: Fetch live commodity data
Mandi-->>App: Real-time prices
App-->>Farmer: π Price trends + best mandi
Farmer->>App: List produce for sale
Buyer->>App: Browse & purchase
App-->>Farmer: π° Order with escrow protection
Farmer->>App: Post farming question
Expert->>App: Answer with expertise
App-->>Farmer: β
Expert-verified advice
Instant crop & soil disease detection using custom-trained CNN models. Upload a photo β get diagnosis + treatment in under 2 seconds.
TensorFlow Scikit-learn Python
Real-time commodity prices from Agmarknet with trend charts, price predictions and custom SMS alerts.
Recharts Agmarknet API Twilio
Escrow-protected direct farm produce sales. No middlemen. GPS-based product discovery.
MongoDB Cloudinary Express
Verified agronomists answer farmer questions. Knowledge Hub with articles, guides & crop tips.
Q&A Engine Rich Editor Ratings
| Layer | Technologies |
|---|---|
| π₯οΈ Frontend | Next.js 16, TypeScript, Tailwind CSS, Framer Motion, Recharts, SWR, Radix UI |
| β‘ Backend | Node.js, Express.js, JWT, Mongoose, Winston, Circuit Breaker, Rate Limiting |
| π€ ML Engine | Python 3.10, TensorFlow/Keras, Scikit-learn, CNN, Random Forest |
| βοΈ Cloud | MongoDB Atlas, Cloudinary CDN, Vercel, Firebase |
| π Notifications | Twilio SMS, Firebase Push (FCM), Nodemailer Email |
| π‘ APIs | Agmarknet (live prices), Google Generative AI |
| πΎ | π | π€ | β‘ | π |
|---|---|---|---|---|
| 50,000+ | +35% | 2M+ | <200ms | A Grade |
| Farmers Targeted | Avg Yield Gain | AI Diagnoses/yr | API Response | Security Rating |
graph LR
subgraph ROLES["User Roles"]
F["πΎ Farmer"]
E["π¬ Expert"]
C["π Consumer"]
end
subgraph FARMER_ACCESS["Farmer Can:"]
F1[List farm produce]
F2[Get AI crop diagnosis]
F3[View live mandi prices]
F4[Post farming questions]
F5[Track orders & earnings]
F6[Set price alerts]
end
subgraph EXPERT_ACCESS["Expert Can:"]
E1[Answer Q&A publicly]
E2[Publish articles]
E3[Build public profile]
E4[Earn reputation score]
end
subgraph CONSUMER_ACCESS["Consumer Can:"]
C1[Browse marketplace]
C2[Buy farm produce]
C3[Track deliveries]
C4[Review sellers]
end
F --> FARMER_ACCESS
E --> EXPERT_ACCESS
C --> CONSUMER_ACCESS
MongoDB Atlas β 17 Collections
βββ π Auth Layer
β βββ users β All roles: farmer/expert/consumer
β βββ tokens β JWT refresh token rotation
β
βββ π Marketplace Layer
β βββ products β Listings + inventory + location
β βββ orders β Full order lifecycle + escrow
β βββ cart β Session cart state
β βββ reviews β Verified purchase-only reviews
β
βββ πΎ Advisory Layer
β βββ questions β Farmer Q posts
β βββ answers β Expert responses + votes
β βββ articles β Knowledge Hub content
β βββ comments β Article discussion
β βββ cropadvisoriesβ AI diagnosis history per user
β
βββ π Market Layer
β βββ mandis β Mandi master data + GPS
β βββ mandiprices β Time-series commodity prices
β βββ pricealerts β User-defined price triggers
β
βββ π± Engagement Layer
βββ notifications β In-app notification feed
βββ aifeedback β AI response quality tracking
βββ searchhistory β Search analytics per user
graph TD
REQ[π¨ Incoming Request]
REQ --> H[Helmet.js β 11 Security Headers]
H --> CORS[CORS Whitelist Check]
CORS --> RL[Rate Limiter\n1000 req/15min API\n50 req/15min Auth]
RL --> XSS[XSS Filter + NoSQL Sanitizer]
XSS --> JWT[JWT Verification]
JWT --> VAL[Input Validator\nexpress-validator]
VAL --> ROUTE[β
Route Handler]
ROUTE --> ERR[Centralized Error Handler]
# 1. Clone
git clone https://github.com/Harsh-1165/KrushiSetu.git
cd KrushiSetu
# 2. Install all dependencies
npm install && cd backend && npm install && cd ..
# 3. Install Python ML dependencies
pip install -r backend/ml/requirements.txt
# 4. Set up environment (copy and fill these files)
cp .env.local.example .env.local # frontend config
cp backend/.env.example backend/.env # backend config
# 5. Run
# Terminal 1 β Backend
cd backend && node server
# Terminal 2 β Frontend
npm run dev
# π Open http://localhost:3000
KrushiSetu/
β
βββ π₯οΈ app/ # Next.js App Router
β βββ (auth)/ # Auth pages: login, signup, reset
β βββ (dashboard)/dashboard/ # 16 role-based dashboard sections
β βββ marketplace/ # Product listing, cart & checkout
β βββ knowledge-hub/ # Articles, categories, write
β
βββ π§© components/ # 57+ reusable UI components
β βββ ui/ # Radix-based primitives
β βββ dashboard/ # Dashboard-specific widgets
β βββ ai/ # AI advisory components
β βββ knowledge-hub/ # Article cards, reader progress
β
βββ β‘ backend/
β βββ routes/ # 14 API route modules
β βββ models/ # 17 Mongoose schemas
β βββ services/ # Email, SMS, Push, AI, Weather
β βββ middleware/ # Auth, CORS, Rate Limit, Validate
β βββ ml/ # Python ML: predict.py, train.py
β βββ utils/ # Logger, AppError, CircuitBreaker
β
βββ π lib/ # API clients & TypeScript utils
timeline
title KrushiSetu Development Roadmap
Q1 2026 : MVP Launch
: Core Auth + Marketplace
: AI Diagnosis (Crop + Soil)
: Live Mandi Prices
: Expert Q&A + Knowledge Hub
Q2 2026 : Payment Gateway (Razorpay)
: Mobile App (React Native)
: Hindi + Regional Languages
: Admin Dashboard
: PWA Offline Support
Q3 2026 : Weather-based Crop Planner
: FPO Bulk Listings
: IoT Sensor Integration
: Blockchain Supply Chain
Q4 2026 : B2B Wholesale Marketplace
: Credit Scoring Engine
: Crop Insurance Integration
: Export Marketplace
: AI Demand Forecasting
We welcome contributions! Here's how to get started:
git checkout -b feature/amazing-featuregit commit -m 'feat: add amazing feature'git push origin feature/amazing-featurePlease follow Conventional Commits for commit messages.
Distributed under the MIT License β free for personal and commercial use.
"KrushiSetu β Bridge between farmers and the future"
β Star this repo if it inspires you!
Made with β€οΈ by Harsh