This repository contains a sample project for a recipe generator application built using Python, FastAPI, Streamlit, Supabase, and Gemini. The application allows users to upload images of items in their refrigerator, analyzes the images, and provides recipe suggestions.
-
Install Daytona: Follow the Daytona installation guide.
-
Create the Workspace:
daytona create https://github.com/daytonaio/sample-python-recipe-generator
- Configure Supabase for the application:
- Create a Supabase project and note down the
URL
andKey
. - Use the following SQL command to set up the required database table:
CREATE TABLE recipes (
id SERIAL PRIMARY KEY,
file_id UUID NOT NULL,
file_name TEXT NOT NULL,
recipe_title TEXT NOT NULL,
recipe_description TEXT NOT NULL,
recipe_ingredients TEXT[] NOT NULL,
recipe_making_time TEXT NOT NULL,
recipe_instructions_to_make TEXT[] NOT NULL,
recipe_number_of_people_servings TEXT NOT NULL
);
- Create a
.env
file in the root directory of the project and add the following configurations:
SUPABASE_URL="https://example.supabase.co"
SUPABASE_KEY="your_supabase_key"
GEMINI_API_KEY="your_gemini_key"
Replace the placeholders with your actual Supabase URL
, Key
, and Gemini API Key
.
- Start the application by running the backend and frontend separately.
Run the FastAPI backend:
uvicorn main:app --reload
Run the Streamlit frontend:
streamlit run streamlit_app.py
- AI-Powered Recipe Suggestions: Analyze uploaded images using Gemini to generate recipes.
- Interactive UI: Built with Streamlit for an intuitive user experience.
- Database Integration: Store recipe data in Supabase.
- Modular Architecture: Clean separation between backend and frontend.
This project demonstrates how to combine FastAPI, Streamlit, and Supabase with AI capabilities to build a practical application. Feel free to explore, modify, and enhance!