A full-stack web application for daily meal logging and nutrition tracking, with progress visualization and barcode-based product import via the Open Food Facts API.
-
Backend: Java 21, Spring Boot 3, PostgreSQL, Redis, Flyway, Resilience4j, Bucket4j
-
Frontend: React, TypeScript, Vite, MUI
-
Infrastructure: Docker Compose, Nginx
-
External API Resilience: Barcode lookups rely on the Open Food Facts API. To prevent cascading failures and handle external downtime, the integration is wrapped in a Resilience4j Circuit Breaker.
-
Caching Strategy: Repeated external API queries are cached in Redis with a defined TTL to reduce latency and avoid rate-limit bans from the provider.
-
Rate Limiting: Unauthenticated endpoints (like the Demo session generator) are protected against abuse and brute-force attacks using Bucket4j.
-
Database Migrations: Schema evolution is strictly versioned and managed via Flyway.
-
Authentication: Google OAuth2 integration alongside a custom temporary session mechanism for demo users.
-
Time-series based meal logging categorized by daily slots (breakfast, lunch, dinner, snacks).
-
Supports composite entities (saved dishes) and single entities (products).
-
Global catalog with search and filtering based on categories and tags.
-
Users can fork global items into private catalogs for custom modifications.
- Manual product creation or automated barcode ingestion via Open Food Facts.
- Dynamic calculation of macronutrients based on ingredient proportions.
- Sandboxed temporary sessions via
POST /api/v1/demo/sessionutilizing separate roles to isolate demo data from real accounts.
git clone https://github.com/LizaMerzh/food-diary.git
cd food-diary
Create a .env file in the root directory:
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
Run the application:
docker compose up --build
Open: http://localhost/
API Documentation: OpenAPI/Swagger UI is available at http://localhost:8080/swagger-ui.html when running locally.




