Inspiration
The challenge of providing everyone with personalized nutrition and health advice motivated us to create an accessible platform for users. Too often, traditional fitness applications offer the same generic workout and nutrition plans to everyone, failing to consider each person's unique metabolic needs, activity levels, and personal objectives. Our goal was to develop an app that utilizes artificial intelligence to combine the power of data analysis to generate tailored detailed health calculations based on a user’s information in order to provide the best possible individualized recommendations based upon the user's abilities, preferences, and goals.
What it does
Nutra.ai is a fully integrated AI Based Health Coach that helps users create a completely personalized daily health plan tailored to their individual needs each day. Nutra.ai includes:
- Personal Health Plan Creation: Nutra.ai uses AI to evaluate your user profile information (age/weight/height/activity level/goals/preference) and provides you with custom daily calorie targets/macronutrient values, step targets, and suggested foods.
- Smart Food Logging: The user has the ability to log food using text description or a photo. The app will analyse the food logs and calculate the calories, macronutrients, and micronutrient values for all the foods logged. The program will also account for fabricated meals.
- Progress Tracking: Users can see their daily progress towards their goals using graphic progress indicators and real-time updates. Progress indicators are saved and accessible to users over multiple sessions.
- AI Health Coach Bot Users can chat with a bot that has full context of their profile, health programme, and daily progress and provides them with personalized recommendations and answers to their questions.
- Smart Profile Management: Once a user updates their profile, Nutra.ai automatically recreates their health programme with the user's previously tracked progress saved.
- Persistent Memory: The user's data is stored server-side, providing Nutra.ai with a persistent memory of each user's information used in the programme.
How we built it
Frontend:
- Pure HTML, CSS, and JavaScript for a lightweight, fast client
- Responsive design with smooth animations and transitions
- Custom UI components replacing default browser alerts/confirms
- Real-time dashboard updates with animated progress bars
Backend:
- Node.js with Express for the REST API server
- File-based JSON storage system for persistent user data
- Multer middleware for handling image uploads
- CORS enabled for client-server communication
AI Integration:
- OpenAI GPT-3.5-turbo for chat interactions and plan generation
- OpenAI GPT-4o Vision for image-based food nutrition estimation
- Context-aware prompts that include full user profile and progress data
- Validation to detect non-food items and inappropriate content
Key Features:
- Onboarding flow with 11 questions covering demographics, goals, and preferences
- AI-powered plan generation with explanations for each target
- Food logging with text and/or image input
- Progress tracking with daily reset capability
- Settings panel for profile editing and plan regeneration
- Chatbot with typing animation and full context awareness
Challenges we ran into
- Reliable Data Storage: Develop a reliable file-based storage system that will manage multiple requests at the same time and maintain the integrity of the data through multiple sessions.
- AI Prompt Engineering: Develop prompts that will consistently return JSON-formatted structured information on health plan data while still retaining a personalized feel, including safe recommendations (for example, no recommendations of less than 1200 calories).
- Image Uploads: Integrate image uploads with Multer and use OpenAI's vision API to process those uploads while handling errors gracefully.
- Server and Client Synchronisation: Facilitate real-time updates to client-side state when the user makes changes to their settings or updates to their Dashboard occur.
- UI/UX Design: Provide for a better user experience by designing custom overlays that will replace browser alerts and include smooth animations and a responsive design that will work for users on different screen sizes.
- AI Food Validation: Use Artificial Intelligence to validate that users are logging food items only, by carefully developing prompts that will eliminate the logging of non-food items.
- User Engagement During Loading: Create an engaging loading experience for users who may be waiting too long, with an animated checklist that appears realistic.
Accomplishments that we're proud of
- AI Integration: Successfully integrated multiple AI models (GPT-3.5 for chat, GPT-4o for visual) with error handling and validation in place
- Full Stack Development: Developed a complete application that includes persistent storage, API endpoints and an attractive front-end design
- User Experience: Created an intuitive onboarding experience with animated loading screens and real-time progress tracking
- Data Persistence: Created a reliable server-side solution for storing user data across sessions
- Intelligent Features: Created a food logging tool that can intelligently estimate nutritional content based on text input as well as images.
- Contextualized Chatbot: Developed a chatbot capable of retaining the complete context of a user's profile, goals, and progress, and offering personalized advice
- Professional Visual Design: Created a professional and sleek UI design that includes custom components, animations, and responsiveness in design and implementation of an intelligent food logging tool.
What we learned
- Prompt Engineering - AI Prompt Engineering: Creating requests for a language model, which will then respond in an orderly manner using JSON format.
- Error Handling: Developing a system that accounts for network issues, API failures, and incorrect/invalid requests that the user may submit.
- Image Processing: Using Vision APIs to perform image analysis, and developing a way to accept multipart form data from the user.
- File-based storage: Gaining experience with providing persistent storage to users, without needing a database.
- State management: Understanding how to maintain accurate and consistent client and server state.
- API Design: Developing endpoints that properly handle both success cases as well as errors gracefully.
- User experience Design: Understanding how incorporating loading animations, feedback, and other loading resources can produce a better overall user experience.
What's next for nutra.ai
- Mobile application: Develop native iOS and Android applications for improved mobile usage.
- Advanced analytics: Provide weekly/monthly summaries of user's progress and related metrics and trends.
- Social Features: Enable users to share their accomplishments with their friends and build social interaction networks.
- Recipe suggestions: Generate meal plans for the user based on their preferences and fitness goals.
- Integration with fitness trackers: Connect to Fitbit, Apple Health and any other fitness tracking devices to automatically track user activity and steps.
- Meal Planning: Provide AI generated meal plans weekly along with shopping lists for user's convenience.
- Nutrition Database: Access to a complete nutrition database to improve the accuracy of nutrition information provided to users.
- Gamification: Create achievement badges, streaks, and challenges to encourage user interaction.
- Professional Features: Add features for nutritionists and trainers to manage multiple clients
- Export Data: Allow users to export their progress data for use with other health apps
Built With
- css
- dotenv
- express.js
- html
- javascript
- node.js
- openai
Log in or sign up for Devpost to join the conversation.