ElevateHealth is a comprehensive health analytics platform that combines food analysis, barcode scanning, and biological age assessment to help users make informed health decisions.
- AI-Powered Food Analysis: Uses OpenAI Vision API to analyze food images and extract detailed nutritional information
- Camera Integration: Real-time camera capture for instant food analysis
- Barcode Scanning: Scan product barcodes to get nutritional information
- Sugar Content Tracking: Detailed sugar analysis and tracking
- Restaurant Integration: Automatic menu data fetching from supported restaurants
- Biological Age Assessment: Real-time analysis using advanced algorithms
- WebSocket Integration: Live data streaming for real-time updates
- Health Metrics: Comprehensive health scoring and recommendations
- Sugar Intake Calendar: Visual calendar for tracking daily sugar consumption
- Progress Tracking: Monitor health improvements over time
- Challenge System: Gamified health challenges and progress tracking
-
Create Environment Files:
cp .env_example .env cp .env.local_example .env.local
-
Configure OpenAI API Key:
- Get an API key from OpenAI Platform
- Add to
.env.local:OPENAI_API_KEY=sk-your-api-key-here
-
Configure Supabase (Optional):
- Add to
.env:NEXT_PUBLIC_SUPABASE_URL=your-supabase-url NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
- Add to
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS, Radix UI components
- AI Integration: OpenAI Vision API, GPT-4
- Barcode Scanning: ZXing library
- Backend: Next.js API routes, Python WebSocket server
- Database: Supabase (for user data and analytics)
ElevateHealth/
βββ app/ # Next.js app directory
β βββ api/ # API routes
β β βββ analyze-food/ # Food analysis endpoint
β β βββ analyze-barcode/ # Barcode analysis endpoint
β β βββ product-lookup/ # Product lookup endpoint
β βββ bioage/ # BioAge analysis page
β βββ bioage-analysis/ # BioAge results page
β βββ dashboard/ # Main dashboard
β βββ food-analytics/ # Food analysis interface
β βββ onboarding/ # User onboarding
βββ bioage/ # BioAge WebSocket server
β βββ backend/ # Python backend
β βββ frontend/ # BioAge frontend
β βββ websocket-server.py # WebSocket server
βββ components/ # Reusable UI components
βββ lib/ # Utility libraries
β βββ restaurant-data.ts # Restaurant menu data
β βββ restaurant-scraper.ts # Restaurant data scraper
βββ doc/ # Documentation
βββ public/ # Static assets
- Node.js 18+
- Python 3.8+
- OpenAI API key
-
Clone the repository
git clone <repository-url> cd ElevateHealth
-
Install dependencies
npm install
-
Set up environment variables
cp .env_example .env.local
Add your OpenAI API key to
.env.local:OPENAI_API_KEY=sk-your-api-key-here -
Start the development server
npm run dev
-
Start the BioAge WebSocket server (in a separate terminal)
cd bioage python3 websocket-server.py -
Open your browser Navigate to http://localhost:3000
- Get an API key from OpenAI Platform
- Add it to your
.env.localfile - Restart the development server
The BioAge analysis requires a WebSocket server running on port 8081. The server connects to an external service for biological age calculations.
- Navigate to the Food Analytics page
- Use the camera to capture food or upload an image
- The AI will analyze the food and provide nutritional information
- View detailed sugar content and health recommendations
- Use the barcode scanner to scan product codes
- Get instant nutritional information
- Track sugar content and other nutrients
- Navigate to the BioAge page
- The system will connect to the WebSocket server
- View real-time biological age analysis
- Monitor health metrics and recommendations
POST /api/analyze-food- Analyze food images using OpenAI Vision API
POST /api/analyze-barcode- Analyze product barcodes
POST /api/product-lookup- Look up product information
# OpenAI API
OPENAI_API_KEY=sk-your-api-key-here
# Supabase (if using database features)
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push to main branch
- Build the project:
npm run build - Start production server:
npm start - Ensure BioAge WebSocket server is running
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Check the documentation in the
doc/folder - Review the API documentation
- Open an issue on GitHub
OpenAI API Issues:
- 401 Unauthorized: Check your API key is correct and starts with
sk- - 429 Rate Limited: You've exceeded your API usage limits
- Invalid image format: Ensure images are in supported formats (PNG, JPEG, WebP)
BioAge WebSocket Issues:
- Connection failed: Ensure the WebSocket server is running on port 8081
- No data received: Check the external service connection
Environment Variables:
- Variables not loading: Restart the development server after adding new variables
- File not found: Ensure
.env.localfile exists and is properly named
- Check the browser console for detailed error messages
- Verify all environment variables are set correctly
- Ensure both Next.js and WebSocket servers are running
- β Enhanced food analysis with OpenAI Vision API
- β Added barcode scanning functionality
- β Integrated BioAge WebSocket server
- β Improved UI/UX with modern design
- β Added comprehensive error handling
- β
Organized documentation in
doc/folder - β Removed temporary and backup directories
