About the Project: Ditewise – Your AI-Powered Health Companion Deployed Site: https://ditewise.netlify.app/dashboard Source Code: https://github.com/Manishk-1/AI-Based_DietWise What Inspired Me As someone fascinated by the intersection of health and technology, I noticed a common problem: most diet and nutrition apps are generic. They offer a one-size-fits-all approach that doesn't account for an individual's unique body, lifestyle, preferences, and goals. People are often left guessing, trying to adapt rigid plans to their life, which is a major reason why many fail to stick to their health objectives. This project, Ditewise, was born from that observation. As my first major AI project, I wanted to tackle a real-world problem. My inspiration was to build something more than just a calorie counter; I envisioned a smart, responsive, and truly personal health partner. The idea was to leverage the power of modern Large Language Models (LLMs) to provide the kind of personalized guidance that might otherwise require a nutritionist, making smarter health management more accessible to everyone. How I Built It Ditewise is a full-stack web application built with a focus on a clean user experience and powerful AI integration. Tech Stack: AI Engine: Google's Gemini Pro API Backend: Python with the Flask web framework Frontend: HTML, CSS, JavaScript (with dynamic content rendering) Database: MongoDB for flexible data storage (user profiles, logs) Deployment: Render for hosting the web application The Architecture: User-Centric Frontend: I designed the interface to be intuitive. Users start by creating a profile with essential information: age, weight, height, gender, activity level, dietary preferences (e.g., vegetarian, vegan), and their primary health goal (e.g., weight loss, muscle gain, maintenance). Flask Backend: The backend is the brain of the operation. It handles user authentication, manages all the data through API endpoints, and, most importantly, communicates with the Gemini API. The AI Core (Prompt Engineering): This is where the magic happens. I didn't just "use AI"; I learned the art of prompt engineering to get reliable and structured responses. For Personalized Diet Plans: When a user requests a plan, my backend constructs a detailed prompt for the Gemini API. This prompt includes the user's entire profile data and specifically asks the AI to generate a 7-day meal plan formatted as a structured response (e.g., JSON). For the AI Chat Guide: The chat feature takes the user's query (e.g., "Is an apple a good post-workout snack?") and sends it to the AI with pre-pended context, instructing it to act as a knowledgeable and friendly nutrition guide. For Nutrient Analysis: When a user logs a food item, a prompt is sent to the AI asking it to estimate the nutritional content (calories, protein, carbs, fats) based on the description. Data Persistence: User data, progress, and meal plans are stored in MongoDB, which is perfect for handling the semi-structured data coming from both user input and AI-generated plans. What I Learned This project was a tremendous learning experience that went far beyond just writing code. Practical AI Application: I moved from theoretical knowledge of AI to hands-on implementation. The most critical skill I gained was prompt engineering—learning how to "talk" to an LLM to get precisely the output I need. Full-Stack Development: I learned how to connect a frontend user interface to a powerful backend, managing the flow of data from user click to AI response and back. API Integration: I gained proficiency in integrating third-party APIs (like Google's Gemini) into a project, including handling authentication, sending requests, and parsing responses. Product Thinking: I had to think like a user. What features are most important? How should the user journey flow? This taught me to prioritize features and build an MVP (Minimum Viable Product). Responsible AI: I learned the importance of framing the AI's advice correctly, adding disclaimers that the guidance is not a substitute for professional medical advice. Challenges I Faced AI Consistency and Formatting: My biggest challenge was getting the AI to return data in a consistent, machine-readable format every single time. Sometimes it would return a nicely formatted list; other times, a chatty paragraph. Solution: I iterated heavily on my prompts, providing explicit instructions and even "few-shot" examples within the prompt itself to guide the AI toward the desired structure. I also built robust error-handling in my backend to manage unexpected AI responses. Managing Application State: Keeping the user's information and session active and consistent across different pages and features was complex. Solution: This pushed me to learn more about server-side session management in Flask and how to design a logical API structure to fetch and update user data seamlessly. Scope Creep: My initial vision was even bigger, with ideas for recipe databases and complex analytics. Solution: I quickly realized I needed to focus. I learned the valuable skill of scoping a project down to its core features to ensure I could build a polished and functional "Version 1.0" that I could be proud of.
Log in or sign up for Devpost to join the conversation.