AgriLink is a farmer-to-buyer connection platform designed for Cameroon, enabling smallholder farmers to connect directly with restaurants, resellers and households. The platform focuses on discovery, communication, and trust, not payments (transactions happen offline).
# AgriLink
AgriLink is a MERN stack farm-to-customer platform for Cameroon, designed for mobile-first, multilingual, and low-bandwidth environments. It connects farmers directly with buyers, restaurants, and households.
## Features
- Farmer, Buyer, and Admin dashboards
- Produce listings, chat, commission tracking
- Real-time messaging (Socket.io)
- AI-powered suggestions and translation
- Cloudinary image uploads
- Dark/light mode and language switch
## Setup Instructions
### Prerequisites
- Node.js (v18+)
- npm
- MongoDB (local or Atlas)
- Git
### 1. Clone the Repository
```
git clone
cd AGRILINK
```
### 2. Install Dependencies
#### Client
```
cd client
npm install
```
#### Server
```
cd ../server
npm install
```
### 3. Environment Variables
#### Client: `client/.env`
```
VITE_API_URL=
localhost
VITE_SOCKET_URL=
localhost
VITE_CLOUDINARY_UPLOAD_PRESET=agrilink-demo
VITE_CLOUDINARY_CLOUD_NAME=agrilink
VITE_OPENAI_API_KEY=your-openai-key-here
VITE_HUGGINGFACE_API_KEY=your-huggingface-key-here
```
#### Server: `server/.env`
```
MONGO_URI=your-mongodb-uri
JWT_SECRET=your-jwt-secret
CLOUDINARY_CLOUD_NAME=agrilink
CLOUDINARY_API_KEY=your-cloudinary-key
CLOUDINARY_API_SECRET=your-cloudinary-secret
OPENAI_API_KEY=your-openai-key
HUGGINGFACE_API_KEY=your-huggingface-key
```
### 4. Run the App
#### Start Backend
```
cd server
npm run dev
```
#### Start Frontend
```
cd client
npm run dev
```
## Usage
- Register as a farmer or buyer
- Add/edit/delete produce listings
- Chat with buyers/farmers
- Track commissions
- Use AI features for suggestions and translation
- Switch between dark/light mode and languages
## Deployment
- Frontend: Deploy to Vercel
- Backend: Deploy to Render or Railway
- Set production environment variables in Vercel/Render/Railway dashboard
## API Endpoints
### Auth
- `POST /api/auth/register` - Register user
- `POST /api/auth/login` - Login user
- `GET /api/auth/me` - Get current user
### Produce
- `GET /api/produce` …