AI-powered platform for improving coffee trade in Ethiopia.
# ☕ AI2CUP - AI-Powered Ethiopian Coffee Trade Platform
> **MVP / Demo-Ready** - Predict fair prices, verify bean quality, and connect with trading partners using artificial intelligence.
---
## 📋 Features
| Feature | Description |
|---------|-------------|
| **📈 Price Prediction** | ML-powered coffee price prediction based on region, month, altitude, rainfall, and variety |
| **🔬 Quality Detection** | Upload a coffee bean image and get instant quality grade (High / Medium / Low) |
| **🏪 Marketplace** | Browse sellers and buyers with smart matching |
---
## 🗂 Project Structure
```
AI2CUP/
├── backend/
│ ├── main.py # FastAPI entry point
│ ├── requirements.txt # Python dependencies
│ ├── data/
│ │ ├── generate_dataset.py # Synthetic dataset generator
│ │ └── coffee_prices.csv # Generated dataset (auto-created)
│ ├── ml/
│ │ ├── price_model.py # Linear Regression price model
│ │ ├── quality_detector.py # Image quality analysis (simulated)
│ │ ├── matcher.py # Buyer/Seller matching engine
│ │ └── trained_model.joblib # Trained model (auto-created)
│ └── routes/
│ ├── price.py # /predict-price endpoint
│ ├── quality.py # /analyze-quality endpoint
│ └── match.py # /match endpoints
├── frontend/
│ ├── index.html # Main UI
│ ├── script.js # Frontend logic & API calls
│ └── styles.css # Premium dark theme
└── README.md
```
---
## 🚀 Quick Start
### Prerequisites
- **Python 3.9+** installed
- **pip** package manager
### 1. Install Dependencies
```bash
cd backend
pip install -r requirements.txt
```
### 2. Run the Server
```bash
cd backend
uvicorn main:app --reload --port 8000
```
The server will automatically:
- ✅ Generate the synthetic coffee price dataset
- ✅ Train the ML model
- ✅ Start serving the API and frontend
### 3. Open the App
Visit **
http://localhost:8000** in your b …