← BACK TO LEVEL SELECT

🌐 Full-Stack

NutriLog - AI Food Logger

Full-stack AI-powered nutrition tracking application with dual AI models, serverless architecture, and Infrastructure as Code deployment.

Overview

Full-stack AI-powered nutrition tracking application featuring dual AI model support (OpenAI GPT-4 and Groq Llama 3), modern serverless architecture, and comprehensive nutrition analysis capabilities.

Live Demo: food-logger-xi.vercel.app

Key Features

Dual AI Model Support

  • OpenAI GPT-4 - Premium accuracy for detailed nutrition analysis
  • Groq Llama 3 - Lightning-fast analysis for real-time use
  • User choice between models based on needs (accuracy vs. speed)

Serverless Architecture

  • AWS Lambda deployment for cost-effective scaling (~$0/month for low-medium traffic)
  • Terraform Infrastructure as Code for reproducible deployments
  • GitHub Actions CI/CD pipeline for automated deployments
  • Function URLs for direct HTTPS access without API Gateway

Secure API Management

  • User-specific API key management with encryption
  • Each user can add their own OpenAI/Groq keys
  • Encrypted storage per user
  • Key validation before saving

Modern Tech Stack

  • Frontend: React 18 + Vite + Tailwind CSS (deployed on Vercel)
  • Backend: Node.js + Express (serverless on AWS Lambda)
  • Database: MongoDB Atlas (cloud-managed)
  • AI Integration: OpenAI GPT-4, Groq Llama 3 APIs

Architecture

flowchart LR
  A["React + Vite<br/>(Vercel edge)"] --> B["Node / Express API<br/>AWS Lambda Fn URL"]
  B --> C{"Model choice?"}
  C -->|"accuracy"| D["OpenAI GPT-4"]
  C -->|"speed"| E["Groq Llama 3"]
  D --> F["Nutrition analysis"]
  E --> F
  B --> G["MongoDB Atlas<br/>+ encrypted user keys"]
  H["git push → GitHub Actions<br/>→ Terraform"] -.->|"deploys"| B

Deployment Pipeline

GitHub Push → GitHub Actions → Terraform → AWS Lambda → Live

Infrastructure as Code

  • Complete Terraform configuration for AWS resources
  • Automated IAM role creation with least-privilege policies
  • CloudWatch logging (7-day retention)
  • Environment variable management via Terraform
  • One-command deployment: terraform apply

Monitoring & Observability

  • CloudWatch metrics (invocations, errors, duration)
  • Real-time log tailing: aws logs tail /aws/lambda/nutri-log-backend --follow
  • Custom health check endpoint
  • Lambda function URL for easy access

Technical Highlights

DevOps Excellence

  • Infrastructure as Code: Complete Terraform setup
  • CI/CD Automation: GitHub Actions workflow
  • Zero-downtime deployments: Serverless instant updates
  • Cost optimization: AWS Free Tier eligible (~$0/month)

Security Best Practices

  • API key encryption at rest
  • Session-based authentication
  • CORS protection
  • Input validation and sanitization
  • MongoDB injection protection

Performance Optimization

  • Serverless auto-scaling (handles 1000+ concurrent users)
  • Efficient cold start optimization
  • Response caching strategies

Design Philosophy

Claude.ai-inspired minimal design:

  • Clean, generous whitespace
  • Neutral gray color palette with subtle accents
  • Inter font with careful typography
  • Intuitive, focused UI
  • Fully responsive across all devices

Deployment

Backend (AWS Lambda)

  • Infrastructure provisioned via Terraform
  • Automated via GitHub Actions on git push
  • Environment variables managed securely
  • Monitoring via CloudWatch

Frontend (Vercel)

  • Auto-deploys from git push
  • Edge network distribution
  • Instant cache invalidation
  • Zero configuration needed

Impact & Metrics

  • Cost: ~$0/month on AWS Free Tier + Vercel Free
  • Scalability: Supports 1000+ users with no performance issues
  • Reliability: 99.9% uptime with serverless architecture
  • Response Time: < 2s for AI analysis

What I Learned

Infrastructure as Code

  • Mastered Terraform for AWS Lambda deployment
  • Implemented CI/CD with GitHub Actions
  • Managed secrets and environment variables securely

Serverless Architecture

  • Cold start optimization techniques
  • Cost-effective scaling strategies
  • Monitoring and debugging serverless functions

Full-Stack Integration

  • React frontend with Node.js backend
  • MongoDB Atlas cloud database management
  • Multi-AI model integration
  • User authentication and session management