AI assistant that helps Tunisian families reduce food waste during Ramadan 🌙 — input your leftovers, get authentic recipes in Tunisian Darja, track your environmental impact. Built with FastAPI + Google Gemini + PWA.
# 🌙 B9atlek (بقاتلك) — AI-Powered Ramadan Food Optimizer
> **"بقاتلك؟"** — *"What do you have left?"* — A question asked every night in Tunisian kitchens, now the starting point of a smarter, greener Ramadan.
B9atlek is a Progressive Web App (PWA) that uses AI to help Tunisian families reduce food waste during Ramadan. You input what you cooked today and what leftovers you have — the AI responds in **Tunisian Darja** with authentic recipes, storage tips, and a real-time estimate of food and money saved.
---
## ✨ Key Features
- 🤖 **AI Recipe Suggestions** — Powered by Google Gemini 2.5 Flash, responding entirely in Tunisian dialect
- 🎤 **Voice Input** — Speak your leftovers in Arabic/Tunisian (ar-TN) via the Web Speech API
- 📅 **Ramadan Calendar** — Interactive 30-day Islamic calendar with decade info (Mercy / Forgiveness / Liberation), powered by the AlAdhan API
- 📊 **Impact Dashboard** — Real-time stats: kg of food saved, CO₂ avoided, and Tunisian dinars recovered
- 📱 **PWA** — Installable on any phone like a native app, with partial offline support
- 🎨 **Immersive Ramadan UI** — Shooting stars, lanterns, glassmorphism, gold/night palette, full RTL layout
---
## 📁 Project Structure
```
AI-Powered-Ramadan-Food-Optimizer/
│
├── backend/ # FastAPI server + Gemini AI integration
│ ├── main.py # API routes (/, /optimize, /health)
│ ├── ai.py # Google Gemini prompt engineering
│ ├── requirements.txt # Python dependencies
│ ├── .env.example # API key template
│ └── README.md # Backend setup guide
│
├── frontend/ # Vanilla HTML/CSS/JS client
│ ├── index.html # Main app page
│ ├── style.css # Ramadan-themed design system
│ ├── script.js # Voice input, calendar, stats logic
│ ├── manifest.json # PWA configuration
│ ├── sw.js # Service worker (offline caching)
│ ├── icon-192.png # PWA icon (1 …