Skip to content

Alwin-Sajan/Recipe.AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

██████╗ ███████╗ ██████╗██╗██████╗ ███████╗   █████╗ ██╗
██╔══██╗██╔════╝██╔════╝██║██╔══██╗██╔════╝  ██╔══██╗██║
██████╔╝█████╗  ██║     ██║██████╔╝█████╗    ███████║██║
██╔══██╗██╔══╝  ██║     ██║██╔═══╝ ██╔══╝    ██╔══██║██║
██║  ██║███████╗╚██████╗██║██║     ███████╗  ██║  ██║██║
╚═╝  ╚═╝╚══════╝ ╚═════╝╚═╝╚═╝     ╚══════╝  ╚═╝  ╚═╝╚═╝

Tell it what's in your fridge. Get a recipe. Order the rest.

FastAPI Next.js SQLite Gemini


✨ What is Recipe.ai?

Recipe.ai is a full-stack web application that lets you describe ingredients you have at home (or snap a photo of them) and instantly get a professional, step-by-step recipe generated by Google Gemini AI. Beyond recipe generation, it's a complete culinary ecosystem with a marketplace, blog platform, and admin dashboard.


🚀 Features

🤖 AI Recipe Generation

  • Text-based — type your ingredients, get a complete recipe instantly
  • Image-based — upload a photo of your fridge or ingredients, AI identifies them and crafts a recipe
  • Powered by Google Gemini API
  • Saves full recipe history per user

🛒 Ingredient Marketplace

  • Browse premium, chef-curated ingredients
  • Filter by category and price range
  • Cart management with real-time quantity updates
  • Full checkout flow with GST calculation
  • UPI QR code on the bill for payment

📍 Delivery Address Management

  • Save and edit delivery address from your profile
  • Address is required before checkout (gate enforced)
  • Address shown on the bill during payment

📖 Community Blog

  • Users can submit culinary articles and tips
  • Admin approval workflow (pending / approved / rejected)
  • Filter by category, search by keyword
  • Featured post support

👤 User Profile

  • Recipe count, membership duration stats
  • Saved delivery address management
  • Full order history with expandable item details

🔐 Authentication

  • JWT-based auth (register / login)
  • Role-based access: user and admin
  • Admin panel for managing users, orders, blogs, and products

🛠️ Admin Dashboard

  • KPI stats: total users, revenue, recipes, pending blogs
  • Manage all users, orders, products, and blogs
  • Toggle product stock, update order status, approve/reject blogs

🗂️ Project Structure

recipe.ai/
├── Recipe-Generator/
│   ├── main.py                     # FastAPI app — all routes
│   ├── database_sql.py             # SQLite wrapper class
│   ├── APIConnect.py               # Gemini API integration
│   ├── security.py                 # JWT, password hashing
│   └── database/
│       └── data.db                 # SQLite database (auto-created)
│
├── recipe-chef-frontend/
│   ├── app/
│   │   ├── page.tsx                # Landing page
│   │   ├── layout.tsx
│   │   ├── globals.css    
│   │   ├── auth/page.tsx           # Login / Register
|   |   ├── admin-panel/page.tsx    # admin dashboard
│   │   └── dashboard/page.tsx      # Main dashboard
│   └── components/
│       └── Blogs.tsx               # Blog component
│
└── README.md

⚙️ Environment Setup

Backend .env

Create a .env file in your backend directory:

GEMINI_API_KEY="your_gemini_api_key_here"
Variable Description
GEMINI_API_KEY Your Google Gemini API key from Google AI Studio

🏃 Running the Project

1. Clone the repo

git clone https://github.com/yourusername/recipe.ai.git
cd recipe.ai

2. Backend setup

cd Recipe-Generator
pip install fastapi uvicorn python-jose passlib google-generativeai python-multipart
python database_sql.py   # initializes the DB tables
uvicorn main:app --reload --port 8000

3. Frontend setup

cd recipe-chef-frontend
npm install
npm run dev

4. Open in browser

http://localhost:3000

The FastAPI docs are available at http://localhost:8000/docs


🗄️ Database Schema

Table Purpose
user User accounts
chat_history Recipe generation history
blogs Community blog posts
products Marketplace ingredients
cart Per-user cart items
orders Placed orders
order_items Individual items per order
user_address Saved delivery addresses

🔌 API Overview

Method Endpoint Description
POST /register Create new account
POST /login Login and receive JWT token
POST /generate_recipe Generate recipe from ingredients
POST /generate_recipe_from_image Generate recipe from uploaded image
GET /history Retrieve user recipe history
DELETE /history/{id} Delete history entry
GET /profile Get user profile
GET /products List marketplace products
GET /products/categories List product categories
GET /cart View cart items
POST /cart Add or update cart item
DELETE /cart Clear cart
POST /checkout Place an order
GET /orders Get user orders
GET /orders/{id} Get specific order
GET / PUT /address Get or save delivery address
GET /blogs List approved blogs
POST /blogs Submit blog post
GET /my-blogs User blog submissions
GET /admin/stats Admin dashboard metrics

Full interactive API docs: http://localhost:8000/docs


🛡️ Tech Stack

Layer Technology
Frontend Next.js 14, TypeScript, Tailwind CSS
Backend FastAPI, Python
Database SQLite (via custom wrapper)
AI Google Gemini API
Auth JWT (python-jose), bcrypt (passlib)
Styling Tailwind CSS, Playfair Display + DM Sans fonts

About

Tell it what's in your fridge. Get a recipe. Order the rest.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors