🌊 FineHydration - AI-Powered Water Bottle Analysis
(https://opensource.org/licenses/MIT)
Transform your hydration experience with AI-powered water bottle analysis
FineHydration is a comprehensive AI-powered platform that analyzes water bottles through computer vision, providing detailed mineral content analysis, hydration scores, and personalized food pairing recommendations. Built with AWS serverless architecture and featuring complete Australian water market coverage.
✨ Features
🔍 AI-Powered Brand Recognition
- Advanced Computer Vision: Uses AWS Rekognition for accurate bottle label detection
- 72+ Water Brands: Comprehensive database including international and Australian brands
- Auto-Discovery: Automatically identifies and adds new brands to the database
- Real-time Analysis: Instant brand identification and mineral analysis
📊 Comprehensive Water Analysis
- Mineral Content Profiling: Detailed breakdown of Ca, Mg, K, Na, bicarbonate, sulfate, chloride
- pH & Alkalinity Measurements: Complete water chemistry analysis
- TDS Analysis: Total Dissolved Solids calculation and health implications
- Hydration Scoring: 1-10 scale rating based on mineral composition
🍽️ Smart Food Pairing
- AI-Generated Recommendations: Personalized food pairings based on water characteristics
- Compatibility Scoring: Scientific matching based on mineral profiles
- Dietary Preferences: Customizable recommendations for different dietary needs
🇦🇺 Australian Market Focus
- Complete Coverage: All major Australian water brands included
- Regional Specialties: Local brands from all states and territories
- Quality Standards: Australian certification and sustainability information
🏗️ Architecture
Serverless AWS Infrastructure
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Mobile App │ │ Web Interface │ │ Shopify Plugin │
└─────────┬───────┘ └─────────┬────────┘ └─────────┬───────┘
│ │ │
└──────────────────────┼───────────────────────┘
│
┌────────────▼────────────┐
│ API Gateway │
│ (REST API + CORS) │
└────────────┬────────────┘
│
┌────────────▼────────────┐
│ Lambda Functions │
│ • Image Analysis │
│ • Water Data │
│ • User Preferences │
│ • Pairing Generation │
└────────────┬────────────┘
│
┌──────────────────────┼──────────────────────┐
│ │ │
┌─────────▼─────────┐ ┌─────────▼─────────┐ ┌─────────▼─────────┐
│ DynamoDB │ │ AWS Rekognition │ │ S3 Buckets │
│ • Water Brands │ │ • Text Detection │ │ • Images │
│ • User Prefs │ │ • Label Analysis │ │ • ML Models │
└───────────────────┘ └───────────────────┘ └───────────────────┘
Core Components
- API Gateway: RESTful API with CORS support
- Lambda Functions: Serverless compute for all business logic
- DynamoDB: NoSQL database for water brands and user data
- AWS Rekognition: Computer vision for brand detection
- S3: Storage for images and ML models
- Cognito: User authentication and management
🚀 Quick Start
Prerequisites
- AWS Account with appropriate permissions
- Node.js 18.x or later
- AWS CLI configured
- CDK CLI installed (
npm install -g aws-cdk)
1. Clone and Setup
git clone https://github.com/yourusername/finehydration.git
cd finehydration
npm install
2. Configure Environment
# Copy example environment file
cp .env.example .env
# Edit with your AWS configuration
nano .env
Required environment variables:
AWS_REGION=ap-southeast-2
AWS_ACCOUNT_ID=YOUR_AWS_ACCOUNT_ID
API_GATEWAY_ID=YOUR_API_GATEWAY_ID
USER_POOL_ID=YOUR_USER_POOL_ID
USER_POOL_CLIENT_ID=YOUR_USER_POOL_CLIENT_ID
3. Deploy Infrastructure
# Bootstrap CDK (first time only)
cdk bootstrap
# Deploy the stack
cd infrastructure
npm install
cdk deploy
4. Populate Water Brands Database
# Install dependencies
npm install @aws-sdk/client-dynamodb @aws-sdk/lib-dynamodb
# Populate international brands
node populate-water-brands.js
# Populate Australian brands
node populate-australian-brands.js
node populate-remaining-australian-brands.js
node populate-final-australian-brands.js
5. Test the API
# Health check
curl https://YOUR_API_GATEWAY_ID.execute-api.YOUR_REGION.amazonaws.com/prod/v1/health
# List water brands
curl https://YOUR_API_GATEWAY_ID.execute-api.YOUR_REGION.amazonaws.com/prod/v1/water
📱 Integration Options
Mobile App Integration
import { FineHydrationAPI } from './api/FineHydrationAPI';
const api = new FineHydrationAPI({
baseURL: 'https://YOUR_API_GATEWAY_ID.execute-api.YOUR_REGION.amazonaws.com/prod/v1',
apiKey: 'your-api-key'
});
// Analyze water bottle
const result = await api.analyzeWaterBottle(imageBase64);
Web Integration
<script src="https://cdn.jsdelivr.net/npm/finehydration-web@latest/dist/finehydration.min.js"></script>
<script>
const fineHydration = new FineHydration({
apiBase: 'https://YOUR_API_GATEWAY_ID.execute-api.YOUR_REGION.amazonaws.com/prod/v1'
});
</script>
Shopify Plugin
// Add to your Shopify theme
const FINEHYDRATION_CONFIG = {
apiBase: 'https://YOUR_API_GATEWAY_ID.execute-api.YOUR_REGION.amazonaws.com/prod/v1',
buttonText: '💧 Analyze Water Bottle',
modalTitle: 'FineHydration AI Analysis'
};
🗄️ Database Schema
Water Brands Table
{
"brandId": "mount-franklin",
"version": "v1",
"brandName": "Mount Franklin",
"country": "Australia",
"source": "Mount Franklin, Victoria",
"type": "Natural Spring Water",
"mineralContent": {
"calcium": 2.2,
"magnesium": 1.5,
"potassium": 0.4,
"sodium": 1.8,
"bicarbonate": 9.8,
"sulfate": 0.8,
"chloride": 2.8,
"fluoride": 0.02
},
"ph": 7.7,
"tds": 15,
"hydrationScore": 8,
"healthBenefits": ["Natural spring source", "Low mineral content"],
"certifications": ["Australian Made", "HACCP Certified"]
}
🔧 API Reference
POST /v1/analysis
Analyze a water bottle image
{
"imageBase64": "base64-encoded-image",
"deviceInfo": {
"platform": "ios",
"version": "1.0.0"
}
}
GET /v1/water
List all water brands
{
"brands": [...],
"count": 72,
"timestamp": "2024-01-01T00:00:00Z"
}
GET /v1/health
Health check endpoint
{
"status": "healthy",
"timestamp": "2024-01-01T00:00:00Z",
"version": "1.0.0"
}
🌊 Supported Water Brands
International Brands (16)
- Evian (France) - Natural Spring Water
- FIJI Water (Fiji) - Natural Artesian Water
- Perrier (France) - Natural Sparkling Water
- San Pellegrino (Italy) - Natural Sparkling Water
- smartwater (USA) - Vapor Distilled Water
- And 11 more premium international brands...
Australian & New Zealand Brands (56)
- Mount Franklin - Australia's most popular spring water
- Frantelle - Natural spring water with balanced minerals
- Beloka Water - Ultra-pure from Kosciuszko National Park
- Strange Love - Premium sparkling water
- Antipodes - New Zealand artesian water
- Neverfail Spring Water - Premium from Blue Mountains
- And 50+ more Australian regional brands...
🛠️ Development
Local Development Setup
# Install dependencies
npm install
# Start local DynamoDB
docker run -p 8000:8000 amazon/dynamodb-local
# Set environment variables
export DYNAMODB_ENDPOINT=http://localhost:8000
export AWS_REGION=us-east-1
# Run tests
npm test
Testing
# Unit tests
npm run test:unit
# Integration tests
npm run test:integration
# E2E tests
npm run test:e2e
# Coverage report
npm run test:coverage
Code Quality
# Linting
npm run lint
# Type checking
npm run type-check
# Format code
npm run format
📊 Performance & Monitoring
Metrics
- Response Time: < 2 seconds for image analysis
- Accuracy: > 95% brand recognition accuracy
- Availability: 99.9% uptime SLA
- Scalability: Auto-scaling serverless architecture
Monitoring
- CloudWatch metrics and alarms
- X-Ray distributed tracing
- Custom performance dashboards
- Real-time error tracking
🔒 Security
Data Protection
- All data encrypted in transit and at rest
- No sensitive information stored in images
- GDPR and privacy compliance
- Regular security audits
Authentication
- AWS Cognito user pools
- JWT token-based authentication
- Role-based access control
- API rate limiting
🌱 Sustainability
Environmental Focus
- Promotes sustainable water choices
- Highlights eco-friendly brands
- Carbon footprint tracking
- Recycling information
Brand Sustainability Data
- Packaging materials information
- Carbon neutral certifications
- Water source protection details
- Sustainability scores
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Process
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
Code Standards
- TypeScript for type safety
- ESLint + Prettier for code formatting
- Jest for testing
- Conventional commits
Made with 💧 by the FineHydration Team
Transforming hydration through AI and data science
Inspiration
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for Bottle Water Hydration Scorer
Built With
- amazon-dynamodb
- amazon-lambda
- amazon-web-services
- api
- bedrock
- cdk
- cloudformation
- node.js
- rekognition
- typescript
Log in or sign up for Devpost to join the conversation.