A beautiful Next.js application that generates personalized Indian recipes based on your cuisine preference, location, mood, and current season using Google's Gemini AI.
- Smart Recipe Generation: AI-powered recipe suggestions based on multiple factors
- Seasonal Awareness: Automatically detects current season for appropriate recipes
- Regional Customization: Recipes tailored to different Indian states and regions
- Mood-Based Suggestions: Recipes that match your current craving or mood
- Beautiful UI: Modern, responsive design with Shadcn UI components
- Detailed Recipes: Complete with ingredients, step-by-step instructions, and chef tips
- Interactive Cards: Click on any recipe to view full details
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first CSS framework
- Shadcn/UI - Modern UI components
- Google Gemini AI - AI-powered recipe generation
- React Hot Toast - Beautiful notifications
- Lucide React - Modern icons
- Node.js 18+ installed
- A Google account for Gemini API access
- Visit Google AI Studio
- Sign in with your Google account
- Click "Get API key" in the sidebar
- Create a new API key
- Copy the generated API key
# Clone the repository or create a new Next.js project
npx create-next-app@latest rasoi-ai --typescript --tailwind --eslint --app
# Navigate to project directory
cd rasoi-ai
# Install dependencies
npm install @google/generative-ai react-hot-toast lucide-react clsx tailwind-merge @radix-ui/react-select @radix-ui/react-separator class-variance-authority tailwindcss-animate# Initialize shadcn/ui
npx shadcn-ui@latest init
# Add required components
npx shadcn-ui@latest add card button select badge separatorCreate a .env.local file in your project root:
NEXT_PUBLIC_GEMINI_API_KEY=your_gemini_api_key_hereCreate the following files in your project:
src/
├── app/
│ ├── globals.css
│ ├── layout.tsx
│ └── page.tsx
└── lib/
├── gemini.ts
├── prompts.ts
└── utils.ts
Copy all the provided code files into their respective locations:
- Replace
app/page.tsxwith the main component code - Create
lib/gemini.tsfor AI integration - Create
lib/prompts.tsfor AI prompts - Create
lib/utils.tsfor utility functions - Update
app/layout.tsxwith toast provider - Update
app/globals.csswith custom styles
# Start development server
npm run devVisit http://localhost:3000 to see your application!
- Cuisine: Choose from 10 popular Indian cuisines (Bengali, Punjabi, South Indian, etc.)
- State/City: Select your location for regional recipe variations
- Mood: Pick what you're craving (Comfort Food, Spicy & Bold, Light & Healthy, etc.)
- Click "Generate My Menu ✨" to get 5 personalized main course recipes
- The app automatically considers the current season for ingredient suggestions
- Click on any recipe card to view complete details
- See ingredients list, step-by-step instructions, and chef tips
- Each recipe includes cooking time, servings, and difficulty level
The app automatically detects the current season and suggests appropriate recipes:
- Winter: Warming, hearty dishes
- Spring: Fresh, light recipes
- Monsoon: Comforting rainy-day meals
- Autumn: Crisp weather specialties
- Summer: Cooling, refreshing dishes
Different moods trigger different recipe styles:
- Comfort Food: Rich, indulgent dishes
- Spicy & Bold: High-spice, flavorful recipes
- Light & Healthy: Lower oil, nutritious options
- Festive & Rich: Special occasion dishes
- Quick & Easy: 30-minute meals
- Traditional: Authentic, time-tested recipes
- Fusion: Modern twists on classics
- Street Food Style: Popular street food recipes
Recipes are customized based on your selected state:
- Uses locally popular ingredients
- Incorporates regional cooking techniques
- Suggests state-specific variations of dishes
Edit the cuisines array in page.tsx:
const cuisines = [
'Bengali', 'Punjabi', 'South Indian', 'Gujarati',
'Maharashtrian', 'Rajasthani', 'North Indian',
'Hyderabadi', 'Kashmiri', 'Goan',
// Add your custom cuisines here
];Update the states array:
const states = [
'West Bengal', 'Delhi', 'Mumbai', 'Karnataka',
// Add more states/cities
];Edit lib/prompts.ts to customize how recipes are generated:
export const FOOD_PROMPT = `
Your custom prompt here...
Use placeholders: {CUISINE}, {STATE}, {MOOD}, {SEASON}
`;-
API Key Error
- Ensure your Gemini API key is correctly set in
.env.local - Check that the file name is exactly
.env.local - Restart your development server after adding the key
- Ensure your Gemini API key is correctly set in
-
Component Not Found
- Make sure all Shadcn components are installed
- Run
npx shadcn-ui@latest add [component-name]for missing components
-
Build Errors
- Ensure all dependencies are installed
- Check that TypeScript types are correctly imported
-
Styling Issues
- Verify Tailwind CSS is properly configured
- Check that
globals.cssincludes all necessary styles
- Gemini API has rate limits for free tier
- Consider implementing request caching for production use
- Add error handling for rate limit scenarios
- Push your code to GitHub
- Connect your repository to Vercel
- Add your
NEXT_PUBLIC_GEMINI_API_KEYin Vercel environment variables - Deploy!
The app can be deployed on any platform that supports Next.js:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
Feel free to contribute by:
- Adding more regional cuisines
- Improving AI prompts for better recipes
- Enhancing UI/UX design
- Adding recipe ratings and favorites
- Implementing user accounts and saved recipes
This project is open source and available under the MIT License.
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Review the Next.js documentation
- Check Shadcn/UI documentation
- Visit Google AI Studio docs
Happy Cooking! 👨🍳👩🍳
Enjoy discovering new flavors and creating delicious Indian meals with Rasoi AI!