National Agricultural Price Discovery, Direct Market Linkages & Verified Trading Portal
Smart India Hackathon 2026 | Problem Statement: SIH 26132
ONE VANIJYA PORTAL
β
βββββββββββββββ΄ββββββββββββββ
βΌ βΌ
PUBLIC MARKET DATA COMMON LOGIN & SIGNUP
(Agmarknet Benchmarks) β
βΌ
VISUAL ALPHANUMERIC
CAPTCHA
β
βΌ
ADMIN VERIFICATION DESK
β
ββββββββββββββββββΌβββββββββββββββββ
βΌ βΌ βΌ
FARMER BUYER ADMIN
β β β
Command Center Procurement Desk Oversight Cockpit
Lots & Offers Bids & Catalog 12-KPI Monitor
Direct Sales Purchase Orders Audit Trail
Profile Gate Profile Gate Registration Desk
GPS & Photo GPS & Photo Dossier Inspection
- Step 1: Account Persona Selection: Choose between πΎ Farmer / Producer and π’ Institutional / Wholesale Buyer (Admin accounts cannot be self-registered).
-
Step 2: Profile Photo Verification:
- Live HTML5 webcam snapshot (
navigator.mediaDevices.getUserMedia) or drag-and-drop file upload (JPEG, PNG, WebP$\le 5\text{MB}$ ). - Persisted in MongoDB GridFS (
profile_photosbucket) and rendered across user avatars and admin dossier review.
- Live HTML5 webcam snapshot (
-
Step 3: Geolocation Coordination:
- Instant GPS location detection (
navigator.geolocation.getCurrentPosition) saved as GeoJSON Point[longitude, latitude]with2dspherespatial indexing. - Manual regional address fallback (State, District, Village / Warehouse Hub).
- Instant GPS location detection (
-
Step 4: Operational Credentials & Security Challenge:
- Farmers: Primary Crop, Farm Size (Acres), KCC Number, APMC License.
- Buyers: Organization, Contact Person, Business Type, Warehouse Location, GSTIN, FSSAI License.
- Live Password Strength Meter: 5-point evaluation verifying 8+ characters, uppercase, lowercase, number, and special character rules.
- Visual Alphanumeric CAPTCHA: Direct SVG challenge verification.
- Step 5: Registration Confirmation Screen: Displays π‘ Pending Admin Verification.
-
Login Enforcement:
-
PENDINGaccounts are blocked with an approval status notification. -
REJECTEDaccounts are blocked and display the administrator's specific rejection reason. -
APPROVEDaccounts receive JWT session tokens and access their dashboard with aπ’ Verifiedbadge.
-
- 4 Real-Time KPI Cards: Pending Farmers, Pending Buyers, Approved Today, Rejected Today.
- Interactive Applicant Directory: Full-text search (name, phone, organization, district, state), role filters, and status filters.
- Applicant Dossier Review Modal: Complete inspection of applicant identity photo, GPS coordinates, and agricultural/commercial credentials before approval.
- Structured Rejection Dialog: Captures constructive rejection reasons logged to the user's permanent record.
- Chronological Audit Trail: Records
USER_REGISTERED,USER_APPROVED, andUSER_REJECTEDaudit events.
- Real-time notification feed in the top navigation bar with unread badge count, dropdown panel, and background polling.
- Automated Event Triggers:
- Sourcing bid placed β Farmer receives
BID_RECEIVED. - Bid modified / cancelled β Farmer receives
BID_MODIFIED/BID_CANCELLED. - Farmer accepts offer β Winning buyer receives
BID_ACCEPTED&PAYMENT_INITIATED; competing bidders receiveBID_REJECTED. - Payment settled β Farmer receives
PAYMENT_PAID. - Registration submitted / approved / rejected β System notifications dispatched.
- Sourcing bid placed β Farmer receives
- "My Lots" area with category tabs: All, Active Bidding (π₯), Sold (β ), Open (π), and Cancelled (β).
- Dedicated views for Active Bidding lots (asking price, top bid, live incoming offers) and Sold contracts (buyer, contract total, payment status).
- 6 KPI dashboard summary cards dynamically calculated from backend data (Active Bidding, Sold Lots, Pending Bids, Open Lots, Total Sales, Pending Payments).
-
Live Bid Multiplier: Real-time
Bid Rate Γ Quantity = Total Order Valuecalculation on lot detail pages. -
Self-Service Quantity Modification: Update pending bid quantities (
$0 < \text{newQuantity} \le \text{lot.quantity}$ ) with automated bounds checking. -
Self-Service Bid Cancellation: Withdraw pending bids (
PENDINGβWITHDRAWN) with audit logging.
- Live Agmarknet benchmark rates, 7-day Simple Moving Average (SMA) charts, volatility indicators, and regional Spatial Arbitrage calculator accessible without authentication.
- 1-click instantaneous switching between English, ΰ€Ήΰ€Ώΰ€ΰ€¦ΰ₯ (Hindi), and ΰ°€ΰ±ΰ°²ΰ±ΰ°ΰ± (Telugu) across all 17 routes, status badges, forms, and validation prompts.
- Robust Mongoose schemas with 2dsphere indexing, GridFS streaming bucket, atomic multi-document transaction handling, and auto-seeding demo data with zero-downtime in-memory fallback.
| Portal / Feature | URL | Description |
|---|---|---|
| Unified Web Portal | http://localhost:3000 | Public landing page with live mandi tickers & core features |
| Public Price Discovery | http://localhost:3000/prices | Live rates, 7-day trend chart & arbitrage (No login needed) |
| Common Sign In | http://localhost:3000/login | Unified login with visual CAPTCHA & approval check |
| Unified Registration | http://localhost:3000/signup | Photo capture, GPS location, password meter & CAPTCHA |
| Smart Dashboard | http://localhost:3000/dashboard | Role-aware cockpit (Farmer, Buyer, Admin Verification Desk) |
| Farmer Lots & Bids | http://localhost:3000/my-lots | Category tabs: All, Active Bidding, Sold, Open, Cancelled |
| Buyer Active Bids | http://localhost:3000/my-bids | Buyer bids management with Modify Quantity & Cancel Bid |
| Marketplace Catalog | http://localhost:3000/browse-lots | Sourcing lots with live procurement value calculation |
| Profile Management | http://localhost:3000/profile | Identity photo, GPS location, and KYC completion gauge |
| Backend API & Swagger Docs | http://localhost:4000/api/docs | 34 NestJS REST APIs & Swagger interactive docs |
On the unified login page (http://localhost:3000/login), click any role tab to auto-fill credentials:
| Persona | Name / Entity | Identifier | Password | Role & Purpose |
|---|---|---|---|---|
| Farmer (ΰ€ΰ€Ώΰ€Έΰ€Ύΰ€¨) | Ramesh Patel | 9876543210 |
Farmer@123 |
Nashik, Maharashtra (Verified Farmer) |
| Buyer (ΰ€΅ΰ₯ΰ€―ΰ€Ύΰ€ͺΰ€Ύΰ€°ΰ₯) | FreshCart Agro Ltd. | buyer@freshcart.com |
asdfcv321 |
Mumbai, Maharashtra (Verified Buyer) |
| Admin (ΰ€΅ΰ₯ΰ€―ΰ€΅ΰ€Έΰ₯ΰ€₯ΰ€Ύΰ€ͺΰ€) | Vanijya System Admin | admin@vanijya.gov.in |
Admin@123 |
Ministry of Agriculture Oversight |
- Node.js: v18 or v20+ LTS
- MongoDB: Local MongoDB instance (e.g.
mongodb://localhost:27017/vanijya) or MongoDB Atlas - npm: v9 or v10+
# Clone the repository
git clone https://github.com/nithinpanuganti/Vanijya.git
cd Vanijya
# Install all workspace dependencies
npm install
# Build shared packages
npm run build:packagesDouble-click start-vanijya.bat in the root directory.
Run the Backend and Frontend in separate terminals:
# Terminal 1: Start Backend API (Port 4000)
npm run start:dev --workspace=apps/backend
# Terminal 2: Start Unified Web Portal (Port 3000)
npm run devThe portal will be available at http://localhost:3000 and API documentation at http://localhost:4000/api/docs.
All 66 automated unit, integration, and end-to-end transaction loop tests pass with 100% success rate:
npm test --workspace=@vanijya/backendPASS src/e2e-live-loop.spec.ts
PASS src/prices/services/price-analytics.service.spec.ts
PASS src/app.controller.spec.ts
PASS src/auth/captcha.service.spec.ts
PASS src/notifications/notifications.service.spec.ts
PASS src/bids/bids.service.spec.ts
PASS src/admin/admin.service.spec.ts
PASS src/prices/prices.service.spec.ts
PASS src/auth/auth.service.spec.ts
PASS src/lots/lots.service.spec.ts
Test Suites: 10 passed, 10 total
Tests: 66 passed, 66 total
Snapshots: 0 total
Time: 12.1 s
1. Open Vanijya Portal (http://localhost:3000) & Click "Sign In" (/login)
ββ Click "Create New Account" -> Opens /signup
2. Step 1: Choose Persona
ββ Select [ πΎ Farmer ] or [ π’ Buyer ]
3. Step 2: Live Photo & GPS Location
ββ Take Live Webcam Snapshot or Upload Identity Photo (GridFS)
ββ Click "Detect My Current Location" -> Acquires GPS Coordinates
4. Step 3: Fill Details & Verify CAPTCHA
ββ Name, Mobile (e.g. 9811223344), Password (with live strength gauge), Location & Crops
ββ Enter Visual Alphanumeric CAPTCHA (e.g. K7P4X)
ββ Click "Submit Application for Verification"
5. Step 4: View Confirmation Screen
ββ Displays π‘ "Pending Admin Verification"
6. Attempt Login before Approval
ββ Go to /login -> Enter 9811223344 -> CAPTCHA -> Sign In
ββ Blocked with notice: "Your account is awaiting admin approval."
7. Login as System Administrator
ββ Use admin@vanijya.gov.in / Admin@123 -> Enter CAPTCHA -> Sign In
ββ Open "Registration Requests" tab in Admin Dashboard
ββ Click "Review Application" -> Inspect Applicant Photo, GPS, and Credentials Dossier
ββ Click "Approve User" (or "Reject Request" with constructive reason)
8. Login as Newly Approved User
ββ Sign out of Admin -> Sign in with the newly approved Farmer credentials
ββ Farmer reaches Command Center with "π’ Verified Farmer" badge and profile avatar
- Problem Statement: SIH 26132
- Organization: Ministry of Agriculture & Farmers Welfare
- Theme: Agriculture, FoodTech & Rural Development
- Outcome: Direct farmer price discovery, visual alphanumeric CAPTCHA security verification, live photo capture & GridFS verification, GeoJSON location capture, complete registration & admin verification lifecycle, persistent multi-event notifications, and auditable national trade monitoring.