Skip to content

aminalav/project-flare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gut Insight

Gut Insight is an educational digestive health web app built on AWS.
It provides:

  • A home page and navigation for topic-focused learning

  • A FODMAP ingredient checker backed by a serverless API

  • Educational pages for celiac disease and Crohn's disease

  • Website URL: www.gut-insight.com

Medical Notice

This project is for educational use only and is not medical advice.
It does not replace professional care from a qualified clinician.
Do not enter personal identifiers in ingredient lookup fields.

Site Structure

  • index.html - Home page
  • fodmap.html - FODMAP checker and FODMAP education
  • celiac.html - Celiac disease education
  • crohns.html - Crohn's disease education
  • app.js - Frontend lookup request logic
  • styles.css - Shared styling
  • lookup_api/handler.py - Lambda handler for GET /lookup
  • template.yaml - SAM template for API/Lambda infrastructure

Quick Start

Prerequisites

  • AWS credentials configured locally, for example in ~/.aws/credentials
  • IAM permissions for:
    • Lambda invoke, such as lambda:InvokeFunction
    • DynamoDB import/write, such as dynamodb:BatchWriteItem and dynamodb:DescribeTable

Load FODMAP data into DynamoDB

python import_foods.py --table Foods --csv "FODMAP Diet - Foods Dataset - V2.csv" --region us-east-2

Check a FODMAP ingredient locally

python fodmap_checker.py --ingredient garlic

The checker output includes:

  • severityClassification
  • reason

Production Deployment

Users access static pages through S3 and CloudFront.
The browser calls GET /lookup on API Gateway, which invokes Lambda and reads from DynamoDB.

The live API currently supports the FODMAP checker path.
Celiac and Crohn's pages are educational content pages.

1) Deploy the lookup API with SAM

Install the AWS SAM CLI, then run:

sam validate
sam build
sam deploy --guided

During --guided:

  • Set FoodsTableName to your table, for example Foods
  • Set CorsAllowOrigin to your site origin once known, for example https://www.gut-insight.com
  • Use * only for temporary early testing

After deployment, copy the HttpApiUrl output, for example:

https://abc123.execute-api.us-east-2.amazonaws.com

Smoke test:

HTTP_API_URL="https://YOUR_API_ID.execute-api.REGION.amazonaws.com"
curl -sS "${HTTP_API_URL}/lookup?restriction=FODMAP&ingredient=garlic"

Expected fields include:

  • severityClassification
  • reason
  • restriction
  • ingredient

2) Point the website to the API

In fodmap.html, set:

window.__FLARE_API_BASE__ = "YOUR_HTTP_API_URL"

Use no trailing slash.

If you later proxy /lookup through the same CloudFront distribution, you can set:

window.__FLARE_API_BASE__ = ""

and use relative /lookup.

3) Upload static files

Upload at least:

  • index.html
  • fodmap.html
  • celiac.html
  • crohns.html
  • app.js
  • styles.css

Recommended hosting is S3 with CloudFront and HTTPS.

Security Checklist

  • Keep Lambda IAM permissions least-privilege, including read-only DynamoDB access where possible
  • Restrict CorsAllowOrigin to your production HTTPS domain
  • Configure AWS Budgets and billing alerts
  • Never commit secrets or tokens to the repository

About

A website designed to provide educational information about Gastrointestinal issues ranging from IBS to IBD.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages