An AI-Powered Recipe Management Platform
Culinary Canvas is a modern, intelligent recipe management application that transforms how you discover, create, and manage recipes. Built with cutting-edge AI technology, it offers innovative features like image-to-recipe generation, random recipe suggestions, and ingredients-based recipe creation.
- Image to Recipe: Upload any food image and get a complete recipe with ingredients and cooking instructions
- Random Recipe Generator: Discover new culinary adventures with AI-generated recipes tailored to your preferences
- Ingredient-Based Creation: Input available ingredients and get personalized recipe suggestions
- Smart Recipe Optimization: AI-assisted recipe creation with automatic image generation and nutritional insights
- Complete Recipe Database: Store and organize your personal recipe collection
- Advanced Search & Filtering: Find recipes by ingredients, category, dietary preferences, and more
- Recipe Details: Comprehensive recipe view with ingredients, step-by-step instructions, prep/cook times
- Mobile-Responsive Design: Perfect experience across all devices
- Secure Authentication: Powered by Clerk with support for Google and GitHub OAuth
- User Profiles: Personalized dashboard with recipe statistics and recent activity
- Cloud Storage: Automatic image storage and optimization via Cloudinary
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui with Radix UI primitives
- Authentication: Clerk
- Image Handling: Next.js Image optimization + Cloudinary
- State Management: React Hooks + Server Actions
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: Clerk Express SDK + JWT
- AI Services: Google Gemini AI (2.0 Flash)
- Image Storage: Cloudinary
- Workflow Automation: n8n integration
- Environment: Docker-ready configuration
- Primary AI: Google Gemini 2.0 Flash
- Computer Vision: Image analysis for recipe generation
- Natural Language Processing: Recipe optimization and generation
- Image Generation: AI-powered recipe image creation
- Workflow Engine: n8n for AI pipeline orchestration
I have also implemented n8n workflows to automate the recipe generation process. Here is a screenshot of the workflow:
- Node.js 18+ and npm/yarn
- MongoDB Atlas account or local MongoDB instance
- Clerk account for authentication
- Google AI Studio API key
- Cloudinary account
- n8n instance (optional, for advanced workflows)
-
Clone the repository
git clone https://github.com/AlphaBeast97/MegaProject.git cd MegaProject -
Backend Setup
cd backend npm install # Create .env file cp .env.example .env
-
Frontend Setup
cd ../frontend npm install # Create .env.local file cp .env.local.example .env.local
# Database
MONGODB_URI=mongodb+srv://your-connection-string
# Authentication
CLERK_PUBLISHABLE_KEY=pk_test_your-key
CLERK_SECRET_KEY=sk_test_your-key
JWT_SECRET=your-jwt-secret
# AI Services
GEMINI_API_KEY=your-gemini-api-key
# Cloud Storage
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
# n8n Integration
N8N_WEBHOOK_URL_RECIPE=your-n8n-webhook-url
N8N_WEBHOOK_URL_IMAGE=your-n8n-image-webhook-url
# Server Configuration
PORT=5000
NODE_ENV=development# Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your-key
CLERK_SECRET_KEY=sk_test_your-key
# API Configuration
NEXT_PUBLIC_API_BASE_URL=http://localhost:5000/api
# App URLs
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
# Cloudinary Name
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your-cloud-name-
Start the Backend
cd backend npm run server # Development with nodemon # or npm start # Production
-
Start the Frontend
cd frontend npm run dev # Development server on port 9002 # or npm run build && npm start # Production build
-
Access the Application
- Frontend: http://localhost:9002
- Backend API: http://localhost:5000
All protected endpoints require a Bearer token in the Authorization header:
Authorization: Bearer <your-clerk-jwt-token>
GET /api/recipes- Get user's recipesPOST /api/recipes- Create/generate recipeGET /api/recipes/:id- Get specific recipe
POST /api/upload-image- Upload image to Cloudinary
GET /api/users/profile- Get user profilePUT /api/users/profile- Update user profile
POST /api/recipes
{
"type": "ingredients",
"content": {
"userid": "user_123",
"ingredients": ["chicken", "broccoli", "garlic"]
}
}POST /api/recipes
{
"type": "image",
"content": {
"userid": "user_123",
"image": "https://cloudinary-url/image.jpg"
}
}POST /api/recipes
{
"type": "random",
"content": {
"userid": "user_123",
"preferences": {
"cuisine": "Italian", //optional
"difficulty": "Medium", //optional
"dietary": "Vegetarian" //optional
}
}
}MegaProject/
βββ frontend/ # Next.js Frontend Application
β βββ src/
β β βββ app/ # App Router pages
β β β βββ dashboard/ # User dashboard
β β β βββ recipes/ # Recipe management
β β β βββ image-to-recipe/ # Image upload & generation
β β β βββ random-recipe/ # Random recipe generator
β β β βββ about/ # Project information
β β βββ components/ # Reusable UI components
β β β βββ ui/ # shadcn/ui components
β β β βββ AppLayout.tsx
β β β βββ AppSidebar.tsx
β β βββ ai/ # AI integration
β β β βββ flows/ # Genkit AI flows
β β β βββ genkit.ts # AI configuration
β β βββ hooks/ # Custom React hooks
β β βββ types/ # TypeScript type definitions
β β βββ utils/ # Utility functions
β βββ public/ # Static assets
β βββ package.json
βββ backend/ # Express.js Backend API
β βββ controllers/ # API route handlers
β β βββ recipe.controller.js
β β βββ user.controller.js
β βββ models/ # MongoDB schemas
β β βββ recipe.model.js
β β βββ user.model.js
β βββ routes/ # API routes
β β βββ recipe.routes.js
β β βββ user.routes.js
β βββ libs/ # External service integrations
β β βββ image_generator.js
β βββ utils/ # Utility functions
β β βββ db.js # Database connection
β β βββ env.js # Environment variables
β β βββ jwtUtils.js # JWT utilities
β βββ config/ # Configuration files
β β βββ cloudinary.js
β βββ server.js # Application entry point
β βββ package.json
βββ Docs/ # Project documentation
β βββ PRD + Wireframes.md
β βββ wireframe_mob.png
βββ README.md
{
title: String, // Recipe name
description: String, // Recipe description
category: String, // Recipe category
clerkId: String, // User identifier
ingredients: [String], // List of ingredients
instructions: [String], // Step-by-step instructions
prepTime: String, // Preparation time
cookTime: String, // Cooking time
imageUrl: String, // Recipe image URL
timestamps: true // createdAt, updatedAt
}{
username: String,
email: String,
clerkId: String, // Clerk user ID
timestamps: true
}-
Recipe Title & Description Generation
- Input: ingredients, instructions
- Output: creative title and description
-
Recipe Suggestions from Ingredients
- Input: comma-separated ingredients
- Output: recipe suggestions array
-
Recipe Suggestions from Image
- Input: food image URI (base64)
- Output: recipe suggestions based on visual analysis
# Build and deploy to Vercel
npm run build
vercel --prod# Set environment variables in your platform
# Deploy using platform-specific methods- Create a MongoDB Atlas cluster
- Configure network access and database users
- Update connection string in environment variables
- Create Cloudinary account
- Get cloud name, API key, and API secret
- Configure upload presets for image optimization
- Create Clerk application
- Configure OAuth providers (Google, GitHub)
- Set up webhooks for user management
- Configure redirect URLs
cd frontend
npm run lint # ESLint checks
npm run typecheck # TypeScript validationcd backend
npm test # Run test suite (if configured)- Image Optimization: Next.js Image component with Cloudinary
- Code Splitting: Automatic with Next.js App Router
- Bundle Analysis: Built-in Next.js bundle analyzer
- Caching: Server-side caching for API responses
- Database Indexing: Optimized MongoDB queries
- Rate Limiting: API rate limiting for stability
- Compression: Gzip compression for responses
- Caching: Redis caching for frequently accessed data
- Authentication: Secure JWT-based authentication with Clerk
- Authorization: Role-based access control
- Input Validation: Comprehensive request validation
- Environment Security: Secure environment variable management
- CORS Configuration: Proper cross-origin resource sharing setup
- Image Upload Security: File type and size validation
# Check Clerk configuration
# Verify environment variables
# Clear browser cookies and local storage# Verify MongoDB connection string
# Check network access in MongoDB Atlas
# Ensure database user permissions# Verify Gemini API key
# Check API quota and limits
# Validate image formats and sizesThis project is licensed under the MIT License - see the LICENSE file for details.
- AlphaBeast - Full Stack Developer (Backend & AI Integration)
- MaximumCell - Frontend Developer (UI/UX & React Components)
- Google Gemini AI for powerful AI capabilities
- Clerk for seamless authentication
- Cloudinary for image management
- MongoDB for flexible data storage
- Vercel for deployment platform
- Next.js team for the amazing framework
- shadcn/ui for beautiful UI components
- Live Demo: https://mega-project-livid.vercel.app/
β Star this repository if you found it helpful!
Made with β€οΈ by the Culinary Canvas Team
