DietSpring is an AI-powered personalized nutrition and diet application that uses Google Gemini 3.1 Flash-Lite to generate personalized meal plans, recipe suggestions, and meal-based calorie and nutritional analysis.
Click the image above to watch the DietSpring demo video. 🎥
- Introduction
- What Problem Does DietSpring Solve?
- Features
- Input Validation
- History
- Technologies Used
- Run DietSpring Locally
- Live Website
- Disclaimer
DietSpring is an AI-powered personalized nutrition and diet application designed to help users make more informed food and meal decisions.
After completing their health profile, users can use DietSpring to:
- Generate personalized one-day meal plans.
- Get recipe suggestions based on their requirements.
- Analyze the approximate calories and macronutrients of a meal.
- Get meal suggestions based on their health goals and dietary preferences.
DietSpring uses Google Gemini 3.1 Flash-Lite to generate the AI-powered responses.
Planning meals and understanding nutritional information can sometimes be difficult.
Users may have questions such as:
- What should I eat today?
- What recipe can I prepare according to my dietary preferences?
- Approximately how many calories and macronutrients does my meal contain?
- What can I improve about my current meal?
- What types of meals may support my health goal?
- How can I plan balanced meals according to my requirements?
DietSpring provides AI-generated suggestions based on the information provided by the user.
Users must complete their health profile before using the main DietSpring features.
The profile contains:
- First Name
- Last Name
- Age
- Gender
- Height
- Weight
- Activity Level
- Allergies
The profile information is used when generating personalized meal plans, recipes, and nutritional analysis.
Authentication and user management are handled using Clerk.
DietSpring can generate a personalized one-day meal plan based on the user's profile and selected requirements.
Users provide:
- Health Goal
- Diet Preference
- Daily Calorie Target
- Food Preferences
The user's profile information, including allergies, is also considered.
The AI generates:
- Breakfast
- Morning Snack
- Lunch
- Evening Snack
- Dinner
For each meal, the generated response includes:
- Meal name
- Food items
- Estimated calories
- Estimated protein
- Estimated carbohydrates
- Estimated fat
The response also includes the estimated total nutritional values for the entire day.
- If the calorie target is set to "No Idea", the AI is instructed to estimate an appropriate daily calorie target based on the user's profile and health goal.
- The AI is instructed to respect the user's allergies and food preferences.
- The selected health goal and diet preference are considered when generating the meal plan.
- The generated meal plan is designed to be practical and balanced.
- The response is formatted using headings and bullet points rather than tables.
DietSpring can generate a personalized recipe based on the user's requirements.
Users provide:
- Meal Type
- Cooking Time
- Daily Calorie Target
- Ingredients to Include
- Ingredients to Exclude
The user's profile and allergies are also considered.
The AI-generated recipe contains:
- Recipe Name
- Estimated Preparation Time
- Estimated Cooking Time
- Estimated Total Calories
- Ingredients
- Step-by-step Cooking Instructions
- Estimated Protein
- Estimated Carbohydrates
- Estimated Fat
- Tips or Healthy Alternatives
- If the calorie target is set to "No Idea", the AI is instructed to estimate an appropriate calorie target.
- The AI is instructed to respect the user's allergies.
- Requested ingredients are considered whenever possible.
- The AI is instructed not to use excluded ingredients.
- The selected meal type is considered.
- The requested cooking time is considered.
- The response is formatted using headings and bullet points rather than tables.
DietSpring can analyze a meal based on the food consumed by the user.
Users provide:
- Meal Type
- Food Items Taken
- Portion Size of Each Food
- Approximate Total Calories
- Approximate Total Macronutrients
The user's profile and allergies are also considered.
The AI-generated response contains:
- Estimated Total Calories
- Estimated Protein
- Estimated Carbohydrates
- Estimated Fat
- Nutritional Analysis
- Positive Aspects of the Meal
- Areas for Improvement
- Healthier Alternatives or Suggestions
- Personalized Recommendations
- If the calorie amount is set to "No Idea", the AI is instructed to estimate it.
- If the macronutrient information is set to "No Idea", the AI is instructed to estimate it.
- The user's profile information is considered during the analysis.
- The AI provides practical nutritional suggestions based on the provided meal information.
DietSpring performs server-side input validation inside Next.js Server Actions before the data is included in the AI prompts.
This helps prevent invalid or unnecessarily large input values from being sent to the AI model.
- Maximum of 5 allergies can be entered.
- Each allergy can contain a maximum of 25 characters.
- Empty values created by comma-separated input are removed.
"No allergies"is case-insensitive.- If
"No allergies"is entered, no other allergy can be entered.
The current Meal Planner Server Action allows:
- A numeric value.
"No Idea"(case-insensitive).- Numeric values must contain digits only.
- The input can contain a maximum of 15 characters.
Note: The Meal Planner currently does not enforce a 500–10,000 calorie range in the Server Action.
- A maximum of 5 preferences can be entered.
- Each preference can contain a maximum of 25 characters.
- Empty comma-separated values are removed.
"No Preference"is case-insensitive.- If
"No Preference"is entered, no other preference can be entered.
- A numeric value or
"No Idea"can be entered. "No Idea"is case-insensitive.- Numeric values must contain digits only.
- Numeric values must be between 500 and 10,000 calories.
- The input can contain a maximum of 15 characters.
- Maximum of 5 ingredients.
- Each ingredient can contain a maximum of 25 characters.
- Empty comma-separated values are removed.
"None"is case-insensitive.- If
"None"is entered, no other ingredient can be entered.
The same validation rules are applied:
- Maximum of 5 ingredients.
- Maximum of 25 characters per ingredient.
- Empty comma-separated values are removed.
"None"is case-insensitive."None"cannot be combined with other ingredients.
- Maximum of 8 food items.
- Each food item can contain a maximum of 25 characters.
- Empty comma-separated values are removed.
- Maximum of 8 portion sizes.
- Each portion size can contain a maximum of 25 characters.
- Empty comma-separated values are removed.
- A numeric value or
"No Idea"can be entered. "No Idea"is case-insensitive.- Numeric values must contain digits only.
- Maximum input length is 15 characters.
"No Idea"is accepted."No Idea"is case-insensitive.- The input can contain a maximum of 30 characters.
- Other text is also accepted as long as it does not exceed the 30-character limit.
DietSpring stores generated results so users can access their previous AI-generated content.
The following information is stored for the corresponding features:
| Feature | Stored Information |
|---|---|
| Meal Planner | User inputs and AI-generated meal plan |
| Recipe Suggestion | User inputs and AI-generated recipe |
| Calorie Tracker | User inputs and AI-generated nutritional analysis |
Creation date and time are also stored for generated records.
| Technology | Purpose |
|---|---|
| Next.js 16 | Full-stack React framework |
| React 19 | User interface |
| Tailwind CSS | Styling |
| shadcn/ui | UI components |
| Next.js Server Actions | Server-side form processing and validation |
| Prisma ORM | Database access |
| Clerk | Authentication and user management |
| Neon PostgreSQL | Database |
| Google Gemini 3.1 Flash-Lite | AI-generated meal plans, recipes, and nutritional analysis |
| Google GenAI SDK | Communication with Google Gemini |
| Vercel | Deployment |
git clone https://github.com/somenath203/DietSpring.gitNavigate into the project directory:
cd DietSpringUsing pnpm:
pnpm installCreate a .env file in the root directory and add the required environment variables:
NEON_DATABASE_URL="your_neon_database_url"
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="your_clerk_publishable_key"
CLERK_SECRET_KEY="your_clerk_secret_key"
NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL="your_sign_in_redirect_url"
NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL="your_sign_up_redirect_url"
GOOGLE_GEMINI_API_KEY="your_google_gemini_api_key"Replace the placeholder values with your actual credentials.
pnpm devThen open the local application in your browser:
http://localhost:3000
You can visit the deployed version of DietSpring here:
DietSpring provides AI-generated nutritional and dietary information for informational purposes only.
The responses generated by the AI model may contain inaccurate, incomplete, or unsuitable information. DietSpring does not provide professional medical, nutritional, or dietary advice, and the creator cannot guarantee the accuracy, completeness, or suitability of AI-generated recommendations.
The creator also does not control the exact responses generated by the AI model.
If you have specific medical, dietary, nutritional, or health-related concerns, consult a qualified healthcare professional or registered dietitian before making decisions based on the information provided by DietSpring.
