- Gemini 2.5 Flash Integration: Google's latest multimodal AI for food identification and nutrition estimation.
- Clean Architecture: Modular design (Controllers, Services, Providers, Repositories).
- Provider Protocol Pattern: Easily swap vision providers (Gemini, OpenAI, etc.).
- Repository Pattern: Centralized data access using SQLAlchemy and SQLite.
- Image Optimization: Automatic compression and normalization via Pillow.
- Middleware Stack: Request tracing, detailed logging, and performance timing.
- Pydantic v2: Strict schema validation for robust API contracts.
- Next.js 15 App Router: High-performance React framework for optimal UX.
- Modern TypeScript: End-to-end type safety for reliable development.
- Drag & Drop Upload: Secure, intuitive interface with real-time image preview.
- Interactive Loading: Multi-step real-time progress indicator during analysis.
- Data Visualization: Animated macro progress bars and nutrition ratio charts.
- Premium Design System: Dark Emerald aesthetic with deep slate and vibrant accents.
- Micro-animations: Seamless transitions (fade-up, float, shimmer) via CSS.
- Portion estimation from images is inherently unreliable without a reference scale.
- Current approach relies on AI estimation (Gemini Vision), which may produce inaccurate weights.
- Future improvement: user-assisted portion input or reference-based estimation.
[ User ] [ Cloud ]
| |
v v
[ Frontend ] -- (Multipart Image) -> [ FastAPI ]
(Next.js) (Backend)
|
|-- [ Image Processor ] (Pillow)
|-- [ Vision Provider ] (Gemini API)
|-- [ Data Repository ] (Sqlite/Alchemy)
|
[ Dashboard ] <--- (Analyzed Data) --- [ Controller ]
┌───────────────────────────────────────────┐
│ API Controllers │ (FastAPI Routes)
└─────────────────────┬─────────────────────┘
v
┌───────────────────────────────────────────┐
│ Service Layer │ (MealService)
└─────────────────────┬─────────────────────┘
┌──────────┴──────────┐
v v
┌────────────────────┐ ┌────────────────────┐
│ Vision Provider │ │ Meal Repository │ (Data Access)
│ (Gemini/Multimodal)│ │ (SQLAlchemy CRUD) │
└────────────────────┘ └─────────┬──────────┘
v
┌────────────────────┐
│ SQLite DB │ (Persistence)
└────────────────────┘
| Technology | Role |
|---|---|
| FastAPI | High-performance API framework. |
| Pydantic v2 | Data modeling and validation. |
| SQLAlchemy | SQL Toolkit and Object Relational Mapper. |
| Pillow | Image processing and optimization. |
| Google GenAI | Gemini 2.5 Flash / Pro model integration. |
| Technology | Role |
|---|---|
| Next.js 15 | Application framework & SSR. |
| TypeScript | Type-safe development environment. |
| Tailwind CSS | Utility-first styling engine. |
| Framer Motion | UI animation and orchestration. |
| Lucide React | Premium icon system. |
| Technology | Role |
|---|---|
| Docker | Containerization of services. |
| Docker Compose | Multi-container orchestration. |
| GitHub Actions | CI/CD automation. |
- Docker & Docker Compose (Recommended)
- Python 3.11+
- Node.js 20+
- Gemini API Key
Start the entire stack with one command:
docker-compose up --buildThe app will be available at http://localhost:3000.
# Build production images
docker-compose -f docker-compose.yml build
# Run in detached mode
docker-compose up -d- Backend is deployed on Render (free tier)
- First request may take ~30–60 seconds due to cold start
- Fork the repository.
- Create your feature branch (
git checkout -b feature/amazing-feature). - Commit your changes (
git commit -m 'Add amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.
© Built by Mariam Maysara