HarvestLink AI is an AI-powered agricultural marketplace that connects farmers directly with buyers, enabling crop listings, enquiries, price negotiation, market insights, and intelligent farming assistance through a unified platform.
Frontend:
https://harvestlink-ai.vercel.app
Backend API:
https://harvestlink-api.onrender.com
API Health Check:
https://harvestlink-api.onrender.com/api/health
Add your screenshots inside a
screenshots/folder in the repository root using the filenames shown above.
-
🔐 Firebase Authentication
- Google Sign-In
- Secure Firebase ID-token-based authentication
- Protected user functionality
-
👨🌾 Farmer Dashboard
- View personalized dashboard statistics
- Manage crop listings
- Track buyer enquiries
- Respond to offers and negotiations
-
🛒 Buyer Dashboard
- Browse available crop listings
- Search and filter crops
- Send purchase enquiries
- Track submitted enquiries
-
🌾 Crop Marketplace
- Create crop listings
- View crop information
- Update existing listings
- Delete listings
- Store listing information persistently in MongoDB Atlas
-
🤝 Enquiry & Negotiation System
- Buyers can contact farmers regarding listings
- Farmers can accept, reject, or counter offers
- Buyers can track enquiry status
-
🤖 HarvestLink AI
- AI-powered farming chatbot
- Agricultural guidance
- Crop management suggestions
- Pest and disease guidance
- Post-harvest and storage advice
-
📈 AI Market Advisor
- Crop selling recommendations
- Pricing assessment
- Market-oriented insights
- Buyer purchase recommendations
-
✍️ AI Crop Description Generator
- Generates professional crop listing descriptions
- Uses crop, variety, quantity, price, location, and harvest information
-
📱 Responsive UI
- Mobile-friendly interface
- Tablet support
- Laptop and desktop layouts
- Responsive cards, forms, dashboards, and modals
-
⚡ REST API Architecture
- Dedicated Express backend
- Reusable frontend API service
- Centralized API communication
- Loading and error handling
- HTML5
- CSS3
- JavaScript
- Firebase Authentication
- Responsive CSS
- Node.js
- Express.js
- REST API
- Firebase Admin SDK
- MongoDB
- MongoDB Atlas
- Mongoose
- Google Gemini API
@google/generative-ai
- Firebase Authentication
- Google Sign-In
- Firebase ID Tokens
- Firebase Admin SDK
- Frontend: Vercel
- Backend: Render
- Database: MongoDB Atlas
- Authentication: Firebase
- Source Control: GitHub
git clone https://github.com/WHENKEY2007/HarvestLink.git
cd HarvestLinkNavigate to the backend:
cd serverInstall dependencies:
npm installCreate:
server/.env
Add the following variables:
MONGODB_URI=your_mongodb_atlas_connection_string
GEMINI_API_KEY=your_gemini_api_key
FIREBASE_PROJECT_ID=your_firebase_project_id
FIREBASE_CLIENT_EMAIL=your_firebase_service_account_email
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYOUR_PRIVATE_KEY\n-----END PRIVATE KEY-----\n"
FRONTEND_URL=http://localhost:3000Never commit
.envor private credentials to GitHub.
Development mode:
npm run devOr production mode:
npm startThe local backend runs at:
http://localhost:5000
Health check:
http://localhost:5000/api/health
Open another terminal from the repository root.
Use a local development server on port 3000.
For example, using VS Code Live Server or another static HTTP server, serve the frontend at:
http://localhost:3000
Do not open
index.htmldirectly usingfile://. The application should be served through a local HTTP server.
Create/configure a Firebase project and enable:
Authentication → Sign-in method → Google
For local development, ensure:
localhost
is present under Firebase Authentication authorized domains.
For production, add your deployed frontend domain.
Check the backend:
GET http://localhost:5000/api/health
Then open:
http://localhost:3000
Test:
- Google Sign-In
- Dashboard
- Crop listings
- Create/update/delete operations
- Enquiries
- AI chatbot
- AI crop description
- AI market recommendations
Production API base URL:
https://harvestlink-api.onrender.com/api
Local API base URL:
http://localhost:5000/api
GET /api/healthExample response:
{
"status": "OK",
"message": "HarvestLink AI REST API is running"
}GET /api/users/meReturns information associated with the authenticated user.
Authentication:
Authorization: Bearer <firebase-id-token>GET /api/profileGet the authenticated user's profile.
PUT /api/profileUpdate profile information.
Example request:
{
"name": "Farmer Name",
"location": "Nashik, Maharashtra"
}Get crop listings:
GET /api/listingsGet one listing:
GET /api/listings/:idCreate listing:
POST /api/listingsExample request:
{
"cropName": "Tomato",
"variety": "Hybrid",
"quantity": 500,
"unit": "kg",
"price": 30,
"location": "Nashik"
}Update listing:
PUT /api/listings/:idDelete listing:
DELETE /api/listings/:idGet enquiries:
GET /api/enquiriesCreate an enquiry:
POST /api/enquiriesExample:
{
"listingId": "LISTING_ID",
"quantity": 100,
"priceOffered": 28,
"message": "Interested in purchasing this crop."
}Update enquiry status:
PATCH /api/enquiries/:id/statusCounter an offer:
PATCH /api/enquiries/:id/counterGET /api/dashboardReturns dashboard information scoped to the authenticated user.
GET /api/marketReturns agricultural market-related information used by the frontend.
POST /api/ai/chatExample request:
{
"question": "What are the best storage conditions for onions?",
"history": []
}Example response:
{
"success": true,
"answer": "AI-generated agricultural guidance..."
}POST /api/ai/descriptionGenerates an AI-assisted crop listing description.
POST /api/ai/recommendationExample request:
{
"crop": {
"cropName": "Tomato",
"quantity": 500,
"unit": "kg",
"price": 30,
"location": "Nashik"
},
"isBuyer": false
}Returns an AI-generated market recommendation.
Protected API endpoints require a valid Firebase ID token in the
Authorizationheader.
HarvestLink follows a separated frontend/backend architecture:
HarvestLink/
│
├── index.html
├── app.js
├── auth.js
├── gemini.js
│
├── js/
│ └── api.js
│
├── css/
│ └── ...
│
├── screenshots/
│ ├── dashboard.png
│ ├── marketplace.png
│ ├── ai-assistant.png
│ └── crop-management.png
│
├── server/
│ ├── config/
│ │ └── db.js
│ │
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── services/
│ │
│ ├── app.js
│ ├── server.js
│ ├── seed.js
│ ├── package.json
│ └── .env.example
│
├── .gitignore
└── README.md
Browser
│
▼
Vercel Frontend
│
│ HTTPS REST API
▼
Render / Express Backend
│
├────────► Firebase Admin
│ Authentication
│
├────────► MongoDB Atlas
│ Application Data
│
└────────► Google Gemini
AI Services
The frontend communicates with the backend through the reusable ApiService. Sensitive credentials such as MongoDB credentials, Firebase Admin credentials, and Gemini API keys remain exclusively on the backend.
-
Render Free Tier Cold Starts: The backend may spin down after a period of inactivity. The first API request after inactivity can therefore take additional time while the service wakes up.
-
AI Availability: HarvestLink AI depends on the availability, quota, and rate limits of the configured Gemini API.
-
Market Recommendations: AI-generated market recommendations should be treated as advisory information rather than guaranteed real-time commodity pricing.
-
Network Dependency: Authentication, AI features, marketplace operations, and database functionality require an active internet connection.
-
Deployment Wake-Up Time: When the Render backend is sleeping, the frontend may temporarily appear slower during the first request.
-
Development Stage: HarvestLink is currently an academic/full-stack project and may require additional security, monitoring, testing, analytics, and scalability improvements before large-scale commercial use.
Connecting Farmers. Empowering Buyers. Enabling Smarter Agriculture.



