# Ethix

A sustainability platform that helps users detect and report greenwashing - misleading environmental claims made by companies and products. Powered by AI analysis using Google Gemini and Ollama.

## About

Ethix enables users to:

- **Scan Products**: Use camera to detect brand logos and analyze environmental claims
- **Report Greenwashing**: Submit incidents with evidence (images or PDF reports)
- **Browse Reports**: Explore company sustainability reports and user-submitted incidents
- **Chat with AI**: Get answers about sustainability, recycling, and eco-friendly alternatives

## Technology Overview

### Frontend

- SvelteKit with Svelte 5
- TypeScript
- TailwindCSS 4
- Tauri (desktop builds)
- Three.js (3D effects)

### Backend

- Flask (Python)
- Google Gemini AI
- Ollama (embeddings and vision)
- ChromaDB (vector database)
- MongoDB (document storage)

## Quick Start

### Prerequisites

- Node.js 18+ or Bun
- Python 3.10+
- MongoDB instance
- Google API Key

### Backend Setup

```bash
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python app.py
```

### Frontend Setup

```bash
cd frontend
bun install  # or npm install
bun run dev  # or npm run dev
```

### Using Docker Compose

```bash
docker-compose up
```

## Services

| Service | Port | Description |
|---------|------|-------------|
| Frontend | 5173 | SvelteKit development server |
| Backend | 5000 | Flask API server |

## External Dependencies

The application requires access to:

| Service | Purpose |
|---------|---------|
| ChromaDB | Vector storage for RAG |
| Ollama | Embeddings and vision models |
| MongoDB | Incident and metadata storage |
| Google Gemini | AI analysis and chat |

## Key Features

### Greenwashing Detection

Submit product photos or company PDF reports for AI-powered analysis. The system:

1. Detects brand logos using vision AI
2. Extracts text from documents
3. Searches for relevant context in the database
4. Provides structured verdicts with confidence levels

### RAG-Powered Chat

The AI assistant uses Retrieval-Augmented Generation to provide accurate, context-aware responses about sustainability topics.

### Catalogue System

Browse and search:

- Company sustainability reports with semantic search
- User-submitted greenwashing incidents
- Filter by category and view detailed analysis

## Environment Variables

### Backend (.env)

```env
GOOGLE_API_KEY=your_google_api_key
MONGO_URI=your_mongodb_connection_string
CHROMA_HOST=http://your-chromadb-host
OLLAMA_HOST=https://your-ollama-host
```

## Documentation

- [Backend Documentation](./backend/README.md)
- [Frontend Documentation](./frontend/README.md)