# 🌾 Agro-Connect Kenya v2.0
A full-stack MERN agri-marketplace with 10 features connecting Kenyan farmers, buyers, hotels, and admins.
---
## 🚀 Quick Start
```bash
# 1. Install all dependencies
npm run install:all
# 2. Configure backend environment
cp backend/.env.example backend/.env
# Edit backend/.env with your values
# 3. Seed the database (240 products + demo users)
npm run seed
# 4. Start development
npm run dev:backend #
localhost
npm run dev:frontend #
localhost
```
---
## 🔑 Demo Credentials (after seeding)
| Role | Phone | Password | Dashboard |
|---------|------------------|------------|-----------|
| Farmer | +254712345001-005| farmer123 | /farmer |
| Buyer | +254712000001 | buyer123 | /buyer |
| Hotel | +254712000002 | hotel123 | /hotel |
| Admin | +254700000001 | admin123 | /admin |
---
## 📦 Features
| # | Feature | Description |
|---|---------|-------------|
| 1 | M-Pesa Callback | STK Push → Daraja callback → order auto-confirmed |
| 2 | Orders Display | Buyer & farmer dashboards with filters + sorting |
| 3 | How It Works | Step-by-step guide with FAQ for farmers & buyers |
| 4 | Profile Settings | Name, email, location, password (bcrypt), photo |
| 5 | PDF Receipts | Styled A4 PDF via pdfkit — download after payment |
| 6 | Receipt Modal | In-app payment confirmation with download button |
| 7 | Dark Mode | Tailwind class strategy, persisted in localStorage |
| 8 | Scroll-to-Top | Floating button visible after 400px scroll |
| 9 | Cart System | Multi-item cart, qty controls, bulk checkout |
| 10 | Hotels Feature | Hotel role, bulk ordering, 5% auto-discount |
---
## 🏗️ Architecture
```
Frontend (React 18 + Vite + Tailwind CSS)
↓ /api proxy
Backend (Node.js + Express, ES6 Modules)
↓
Database (MongoDB Atlas + Mongoose)
↓
External: Safaricom Daraja API (M-Pesa STK Push)
```
---
## 📁 Project Structure
```
agro-connect-full/
├── backend/
│ ├── config/ …