An AI-powered serverless application that allows users to upload food images and receive real-time nutrition insights and personalized dietary recommendations.
- ๐ผ๏ธ Upload meal images via web interface
- ๐ฆ Serverless architecture with AWS Lambda, S3, API Gateway, DynamoDB
- ๐ง GPT-4o Turbo integration for personalized diet advice
- ๐ Real-time OCR using AWS Rekognition & Textract
- ๐ก REST API endpoints to fetch and store meal logs
- โ๏ธ CI/CD pipeline via GitHub Actions and Terraform
- โก Response times under 5 seconds for 1000+ calculations
- Frontend: React + Amplify
- Backend: AWS Lambda (Node.js), API Gateway
- OCR: AWS Rekognition, AWS Textract
- AI: GPT-4o Turbo
- Infrastructure: Terraform (6+ modules), IAM, CORS-enabled S3
- Database: AWS DynamoDB
- CI/CD: GitHub Actions Workflows(4-stage pipeline)
nutrition-assistant/
โ
โโโ terraform/ # All IaC code
โ โโโ modules/ # Modular AWS resources
โ
โโโ frontend/ # React + Amplify frontend
โ โโโ .env # Env config
โ
โโโ scripts/
| โโโ lambda/ # 1 of many Lambda functions, other functions are in terraform/modules/
โ
โโโ docs/ # Screenshots / demo.gif
โโโ README.mdThis project uses a powerful, input-driven GitHub Actions workflow to manage Terraform-based infrastructure provisioning and teardown.
name: Deploy AWeSome Nutrition App
on:
workflow_dispatch:
inputs:
action:
description: 'Terraform action to perform'
type: choice
options:
- Terraform_apply
- Terraform_destroy-
Go to your repository's Actions tab.
-
Select "Deploy AWeSome Nutrition App" workflow.
-
Click "Run workflow" โ Choose Terraform_apply or Terraform_destroy.
-
Clone the repository
git clone https://github.com/chetanchandane/cloud-native-aws-application.git cd cloud-native-aws-application -
Configure AWS Credentials
-
Create an IAM user with programmatic access.
-
Attach necessary permissions (AdministratorAccess for testing or scoped permissions).
-
Add credentials to your environment:
export AWS_ACCESS_KEY_ID=your_access_key export AWS_SECRET_ACCESS_KEY=your_secret_key
- Terraform Deployment
cd terraform/ terraform init terraform apply
This sets up:
-
API Gateway with 8 routes
-
Lambda Functions
-
S3 (CORS-enabled)
-
DynamoDB
-
IAM Roles
-
Cognito Auth
-
Output variables to copy into frontend .env
cd frontend
npm install
npm start
The app will launch at http://localhost:3000
Create a .env file in /frontend with the following values
REACT_APP_AWS_REGION=us-east-1
REACT_APP_USER_POOL_ID=us-east-1_xxxxxxx
REACT_APP_APP_CLIENT_ID=xxxxxxxx
REACT_APP_IDENTITY_POOL_ID=us-east-1:xxxxxxxx
REACT_APP_API_URL=https://your-api-id.execute-api.us-east-1.amazonaws.com๐ก Use amplify pull or console to retrieve values from AWS Amplify or Terraform outputs.
______________________________________________________________________________________________
| Method | Endpoint | Description |
| ------ | ------------------------------------- | ----------------------------------------- |
| `GET` | `/upload-url` | Returns pre-signed S3 URL for upload |
| `POST` | `/process-image` | Triggers Lambda to process uploaded image |
| `GET` | `/result/{image_key}` | Fetches nutrition info for an image |
| `GET` | `/meal-logs?date=YYYY-MM-DD&user_id=` | Get userโs meals for a date |
----------------------------------------------------------------------------------------------
[React UI]
โ
[GET /upload-url] โ pre-signed S3 upload
โ
[POST /process-image] โ OCR, GPT-4o, store in DynamoDB
โ
[GET /result/{image_key}] โ fetch personalized nutrition insights-
โฑ๏ธ Reduced manual data entry by 90%
-
๐ก 300+ personalized recommendations
-
๐งฎ 1000+ nutrient calculations
-
๐ 60% faster deployment time via CI/CD
-
๐ข 99.9% uptime with serverless architecture
| DevOps Pillar | How This Project Demonstrates It |
|---|---|
| 1. Automation | - Provisioning with Terraform (IaC) - CI/CD using GitHub Actions (manual Terraform apply/destroy) - Serverless architecture via Lambda functions |
| 2. Continuous Integration | - GitHub Actions pipeline runs on push/PR - Includes linting, formatting, and Terraform validation |
| 3. Continuous Delivery | - Zero-downtime deployments using GitHub Actions + Amplify - Applies and destroys infrastructure conditionally on the main branch |
| 4. Infrastructure as Code | - Terraform modules for S3, API Gateway, Lambda, Cognito, DynamoDB, IAM - Reusable, modular setup for easier collaboration and scaling |
| 5. Monitoring & Feedback | - Fast feedback loop through API response times (< 5s) - Design allows easy integration with CloudWatch, X-Ray, or Prometheus/Grafana for future monitoring |
| 6. Security & Compliance | - Secrets stored in GitHub Secrets and Org-level Variables - IAM roles scoped using principle of least privilege - CORS and Cognito ensure secure access |
| 7. Collaboration & Culture | - GitOps-friendly workflows - Modular architecture supports team collaboration - Documentation, naming conventions, and Terraform variables aid onboarding and sharing |
Contributions are welcome! Whether it's improving documentation, adding features, or fixing bugs โ feel free to open issues or submit pull requests.
If you have questions or want to collaborate, feel free to reach out:
- GitHub: @chetanchandane
- Email: cc5831@rit.edu
This project was a team effort built as part of a collaborative academic initiative.
Special thanks to all contributors for their dedication and expertise:
- Shardul Gadadare โ scg6975@rit.edu
- Sourav Patil โ sp1513@rit.edu
- Vinayaka Vishwanatha โ vv1629@rit.edu
- Abdul Ahad Khan โ ak7160@rit.edu
We worked together across design, backend, infrastructure, and testing to deliver a production-ready serverless AI application.
This project is licensed under the MIT License.
Built with โ๏ธ passion for cloud, DevOps, and nutrition โจ
