Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌿 NutriValue Enterprise Platform

Transparent nutrition values, controlled health insights, and traceable evidence

Backend CI Frontend CI Manual Deploy Data License: MIT

React · FastAPI · USDA FoodData Central · Open Food Facts · FDA Daily Values · AWS


NutriValue is a production-oriented nutrition intelligence platform. Users can search common foods, look up packaged products by barcode, or enter a nutrition label manually. The platform normalises provider data and explains meaningful nutrient contributions without generating diagnoses, cures, or personalised medical advice.

Important

Provider records may be incomplete or vary from the physical label. NutriValue exposes the source, serving context, completeness and confidence for every analysis.

Product experience

  • Food search: USDA Foundation, FNDDS, SR Legacy and branded records.
  • Barcode lookup: UPC/EAN/GTIN products through Open Food Facts v3.
  • Manual label analysis: validated nutrition inputs for products not found externally.
  • Nutrition facts: consistent nutrient names, units and FDA Daily Value percentages.
  • Controlled insights: deterministic benefits and cautions tied to measured values.
  • Transparent provenance: source link, confidence, completeness and safety disclaimer.

Architecture

flowchart LR
    U([Consumer]) --> ALB[HTTPS / Application Load Balancer]
    ALB --> UI[React + Nginx]
    ALB --> API[FastAPI Nutrition API]
    API --> C[(Provider cache)]
    API --> USDA[USDA FoodData Central]
    API --> OFF[Open Food Facts v3]
    API --> RULES[FDA DV rules engine]

    GH[GitHub Actions] -->|OIDC| IAM[AWS deploy role]
    IAM --> ECR[(Amazon ECR)]
    IAM -->|AWS SSM| EC2[Rolling EC2 deployment]
Loading

Enterprise controls

Concern Design
Data quality Normalised provider adapters, source attribution and completeness scoring
Health safety Allow-listed statements and threshold rules; no free-form medical generation
Resilience Provider timeout handling, TTL caching and clear upstream failure contracts
Security Strict validation, controlled CORS, OIDC federation and encrypted runtime settings
CI Tests, Ruff, ESLint, npm audit, secret scanning and blocking Trivy scans
Deployment Manual approval, immutable SHA tags, sequential SSM rollout and rollback
Operability Health endpoints, provider-specific errors, runbook and deployment summaries

Quick start

git clone https://github.com/jeevanm84/nutrivalue-enterprise-platform.git
cd nutrivalue-enterprise-platform
cp .env.example .env
make local-up

Open http://localhost:3000. The included DEMO_KEY fallback supports limited USDA development calls; obtain a data.gov key for normal development and production.

curl http://localhost:8000/api/health
curl "http://localhost:8000/api/v1/nutrition/search?q=oats"
curl "http://localhost:8000/api/v1/nutrition/barcode/3017624010701"

Interactive API documentation is available at http://localhost:8000/docs.

API surface

Method Endpoint Purpose
GET /api/health Service readiness
GET /api/v1/nutrition/search?q= USDA food search
GET /api/v1/nutrition/foods/{fdc_id} Normalised USDA details
GET /api/v1/nutrition/barcode/{barcode} Packaged-product lookup
POST /api/v1/nutrition/manual Manual label analysis

Manual production deployment

Complete AWS setup, protect the GitHub production environment, then use Actions → Manual Production Deployment or:

./scripts/manual-deploy.sh backend <commit-sha>
./scripts/manual-deploy.sh frontend <commit-sha>

Each instance must pass its health check before the rollout continues. A failed container is replaced with the previous image.

Documentation

Roadmap

  • Redis-backed distributed cache and provider circuit breakers
  • PostgreSQL audit/history service with retention controls
  • Organisation-reviewed health claim catalogue and approval workflow
  • Mobile camera barcode scanner and OCR label ingestion
  • Terraform AWS platform and CloudWatch service-level objectives
  • Regional nutrition reference frameworks and localisation

License

Released under the MIT License. USDA FoodData Central data is public domain; Open Food Facts data has its own database licence and attribution requirements.

About

Enterprise nutrition intelligence with USDA and Open Food Facts data, FDA Daily Value rules, React, FastAPI and secure AWS deployments

Topics

Resources

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages