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 β¦