ChefWise is a cross-platform AI-driven cooking assistant that generates personalized recipes, meal plans, and nutrition tracking. Built with Next.js, Firebase, and OpenAI API.
ChefWise helps users:
- Generate AI-powered recipes from ingredients or prompts
- Manage pantry inventory
- Create personalized meal plans with macro tracking
- Track daily nutrition and macros
- Get ingredient substitutions
- Generate shopping lists
| Feature | Description | Tech Stack |
|---|---|---|
| AI Recipe Generator | Generates recipes from user prompts or pantry inventory | OpenAI API + Next.js |
| Pantry Inventory | CRUD interface for ingredients with recipe suggestions | Firebase Firestore |
| Meal Planner | Builds daily/weekly meal schedules with macro targets | React + Chart.js |
| Macro Tracker | Calculates protein, carbs, fat, sugar, sodium per meal/day | Chart.js |
| Substitution Engine | Suggests ingredient replacements | GPT prompt chain |
| Shopping List | Auto-generate lists from meal plan | Firebase functions |
| Diet Filters | Mediterranean, Vegan, Keto, Low Fat/Sugar, NAFLD, etc. | Filtered AI prompts |
| User Profiles | Store diet prefs, allergies, saved recipes, macro goals | Firebase Auth + Firestore |
| Freemium Model | Free (2 recipes/day) → Premium (unlimited) | Stripe + Firebase |
[User] → [UI (Next.js + React)] → [Firebase Auth + Firestore]
→ [OpenAI API via Cloud Functions] → [Recipe Response + Macro Calc]
→ [Render Meal Plan + Charts + Lists]
Frontend: Next.js + React + Tailwind CSS
Backend: Firebase Auth | Firestore | Cloud Functions
AI Layer: OpenAI API (GPT-4) + custom prompt templates
Integrations: Stripe Payments | Chart.js
Deployment: Firebase Hosting / Vercel
chefwise/
├─ src/
│ ├─ components/ # React components
│ │ ├─ RecipeCard.jsx
│ │ ├─ MealPlanner.jsx
│ │ ├─ PantryInventory.jsx
│ │ ├─ MacroTracker.jsx
│ │ └─ SubscriptionBanner.jsx
│ ├─ pages/ # Next.js pages
│ │ ├─ index.js # Home page
│ │ ├─ pantry.js # Pantry management
│ │ ├─ planner.js # Meal planner
│ │ ├─ tracker.js # Macro tracker
│ │ └─ profile.js # User profile
│ ├─ hooks/ # Custom React hooks
│ │ └─ useOpenAI.js # OpenAI API integration
│ ├─ utils/ # Utility functions
│ │ └─ SubscriptionGate.js
│ ├─ firebase/ # Firebase config
│ │ └─ firebaseConfig.js
│ ├─ prompts/ # AI prompt templates
│ │ └─ recipePrompts.js
│ └─ styles/ # CSS styles
│ └─ globals.css
├─ functions/ # Cloud Functions
│ ├─ index.js # OpenAI calls, billing checks
│ └─ package.json
├─ public/ # Static assets
├─ package.json
├─ firebase.json # Firebase config
├─ firestore.rules # Security rules
├─ firestore.indexes.json # Database indexes
└─ README.md
- Node.js 18+
- Firebase account
- OpenAI API key
- Stripe account (for payments)
- Clone the repository:
git clone https://github.com/AreteDriver/Chefwise.git
cd Chefwise- Install dependencies:
npm install
cd functions && npm install && cd ..- Set up environment variables:
cp .env.example .env.localEdit .env.local and add your Firebase and OpenAI credentials.
- Initialize Firebase:
firebase login
firebase init- Deploy Cloud Functions:
firebase deploy --only functions- Run the development server:
npm run devVisit http://localhost:3000
Create a .env.local file with:
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
OPENAI_API_KEY=your_openai_api_key
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_key
STRIPE_SECRET_KEY=your_stripe_secret
- Free users: 2 recipe calls/day, 1 diet filter, 3-day meal plans
- Premium users: Unlimited recipes, all diet filters, 30-day meal plans, export features
- Gating via
planTierfield in Firestore andcheckPlanTier()middleware in Cloud Functions
Generate a healthy [diet_type] recipe using: [ingredient_list].
Return JSON with title, ingredients, steps, prep_time, macros.
Suggest top 3 ingredient substitutions for [ingredient]
that maintain flavor, texture, and diet compatibility.
Create a 7-day meal plan hitting [protein, fat, carbs] goals
based on the user's saved preferences and pantry items.
firebaseConfig.js– Firebase initializationuseOpenAI.js– Custom hook for AI API calls with rate limitingMealPlanner.jsx– Weekly meal plan UI with chartsSubscriptionGate.js– Restricts features by plan tierRecipeCard.jsx– Displays recipe resultsPantryInventory.jsx– Manage ingredientsMacroTracker.jsx– Daily nutrition tracking
npm run build
firebase deploy --only hostingvercel deploynpm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm run lint- Run ESLint
- Community recipe sharing
- AI voice assistant mode
- Offline mode (local cache)
- Photo recognition for ingredients
- Wearable integration
- Multi-language support
Contributions are welcome! Please open an issue or submit a pull request.
MIT License - see LICENSE file for details
For support, email [email protected] or open an issue on GitHub.
Built with ❤️ by the ChefWise team