Skip to content

Latest commit

 

History

115 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Healthium

3rd Place — BugsByte Hackathon · Built for the Nutrium challenge track.

A full-stack AI-powered nutrition and wellness platform. Upload a photo of your fridge, get a recipe. Scan a restaurant menu, get the healthiest pick. Log how you feel, get a clinical report. All personalized to your profile.


Features

Module Description
NutriChat Conversational AI nutritionist "Vitium": answers questions about food, supplements, and wellness
NutriUpgrade Transforms any dish into a healthier version targeting Nutri-Score A or B, while preserving the dish's identity
FoodSwap Suggests a completely different healthy alternative to a meal, based on your preferences
Photo to Recipe GPT-4o Vision scans a photo of your fridge or pantry and generates a complete recipe
Menu Scout GPT-4o Vision reads a restaurant menu photo and recommends the healthiest dish
Food Compare AI head-to-head nutritional comparison of two food items with a justified verdict
NutriMap Finds healthy restaurants and health stores near you via Google Places API
Insights Logs dietary reflections, analyzes sentiment, detects plan deviations
Clinical Report Generates a downloadable PDF clinical behaviour report from a user's insight history

Every AI feature is context-aware: once a user completes their profile, all recommendations automatically account for allergies, dietary preferences, biometrics, and nutritional goals.


Project Structure

The repo follows a bones / skin metaphor:

healthium/
├── bones/          # Backend
│   └── app/
│       ├── main.py
│       ├── database.py
│       ├── models.py
│       ├── schemas.py
│       ├── helpers/
│       │   ├── chat_gpt.py       
│       │   ├── fat_secret.py     
│       │   └── user_context.py   
│       └── router/
│           ├── auth.py
│           ├── nutrichat.py
│           ├── healthier_ref.py
│           ├── substituir_ref.py
│           ├── photo_to_recipe.py
│           ├── best_ref.py       
│           ├── compare_aliments.py
│           ├── places_near.py
│           └── insigths.py       
└── skin/           # Frontend 
    └── src/
        ├── views/              
        ├── components/         
        ├── api/                
        ├── stores/             
        └── router/             

Tech Stack

Backend (bones/)

  • FastAPI — async REST API
  • SQLModel + SQLite — ORM and local database
  • OpenAI Python SDK — GPT-4o (vision) and GPT-4o-mini
  • passlib + bcrypt — password hashing
  • fpdf — PDF generation for clinical reports
  • httpx — async HTTP client (FatSecret, Google Places, Nominatim)
  • uv — fast Python package manager

Frontend (skin/)


Getting Started

Prerequisites


Backend Setup

cd bones

# Install dependencies with uv
pip install uv
uv sync

# Create a .env file (see Environment Variables section)
cp .env.example .env   # or create manually

# Start the development server
uv run uvicorn app.main:app --reload --port 8000

The API will be available at http://localhost:8000.
Interactive docs: http://localhost:8000/docs


Frontend Setup

cd skin

# Install dependencies
npm install
# or: bun install

# Start the development server
npm run dev
# or: bun dev

The app will be available at http://localhost:5173.


Environment Variables

Create a .env file inside the bones/ directory:

# OpenAI — Required for all AI features
OPEN_AI_KEYS=sk-...

# FatSecret — Required for food database search (/product endpoint)
# Get credentials at https://platform.fatsecret.com/
FAT_SECRET_CLIENT_ID=your_client_id
FAT_SECRET_KEY=your_client_secret

# Google Places API — Required for NutriMap (/places/nearby endpoint)
# Falls back to mock data (Braga) if not provided
GOOGLE_API_KEY=your_google_api_key

# Session middleware secret — any random secure string
RANDOM_KEY_MIDDLEWARE=your_random_secret_string

Note: The app works without GOOGLE_API_KEY - it will return a mock healthy restaurant in Braga as a fallback. All AI features require a valid OPEN_AI_KEYS.


Development Notes

  • The backend currently uses SQLite for simplicity. The pyproject.toml also includes asyncpg and psycopg2-binary for a future migration to PostgreSQL.
  • CORS is configured to allow all origins (*) — restrict this in production.
  • The session middleware secret is hardcoded as a fallback in main.py — always set RANDOM_KEY_MIDDLEWARE in your .env for real deployments.
  • The AI prompts are written in European Portuguese — all model responses come back in PT-PT.

License

This project was built as a hackathon submission. All rights reserved.

About

[Hackathon] full-stack AI-powered nutrition and wellness platform

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages