# AgriData Smarts 🍍
**Kilimo Cha Kisasa - Smart Pineapple Farming for Tanzania**
A complete web application for smart agriculture with AI-powered crop analysis, real-time chatbot support, and farmer analytics.
## Features
✨ **Smart Chatbot** - Kiswahili-language chatbot for farming advice and WhatsApp integration
📊 **AI Image Analysis** - Analyze crop health using OpenAI or Azure Computer Vision
📈 **Analytics Dashboard** - Real-time farm data visualization and trends
🌾 **Farmer Dashboard** - Track moisture, temperature, and crop health
🏪 **Digital Marketplace** - Connect farmers directly with buyers
💬 **Socket.io Real-time Updates** - Live notifications and chat
🔐 **JWT Authentication** - Secure user accounts and data
## Tech Stack
**Backend:**
- Node.js + Express 5
- MongoDB + Mongoose
- Socket.io for real-time chat
- JWT authentication
- Multer for file uploads
**Frontend:**
- React 18 with Vite
- Material UI components
- React Router v6
- Socket.io client
- Recharts for analytics
**Services:**
- MongoDB Atlas (cloud database)
- Replit (backend hosting)
- Vercel (frontend hosting)
- OpenAI / Azure Computer Vision (image analysis)
- Twilio (WhatsApp integration)
## Quick Start
### Local Development
**Backend:**
```bash
cd backend
npm install
# Create .env file with MongoDB URI and secrets
npm start
# Runs on
localhost
```
**Frontend:**
```bash
cd frontend
npm install
npm run dev
# Runs on
localhost
```
### Access on Phone (Same Wi-Fi)
1. Find your laptop IP: `ipconfig` (Windows) or `ifconfig` (Mac)
2. On phone, visit: `http:// :3000`
3. Or scan the QR code on the landing page
## Deployment
**See DEPLOYMENT.md for complete deployment instructions.**
Quick summary:
1. Set up MongoDB Atlas
2. Deploy backend to Replit
3. Deploy frontend to Vercel
4. Configure environment variables
## Project Structure
```
agridata-smarts/
├── backend/
│ ├── routes/
│ │ ├── auth.js # User authentication
│ │ ├── chatbot.js …