A FastAPI-based backend application for managing recipes and generating AI-powered recipe suggestions from available ingredients.
The AI Recipe Manager API was developed using a Spec-Driven Development approach.
The API provides endpoints for recipe management and AI-powered recipe suggestions using the Groq API.
- Create a new recipe
- Retrieve all recipes
- Retrieve a recipe by ID
- Update an existing recipe
- Delete a recipe
Generate recipe recommendations based on available ingredients.
For example, ingredients such as:
Rice, Chicken, Yogurt
can be used to generate a recipe suggestion with ingredients and cooking instructions.
The application provides two main areas of functionality:
- Recipe Management — Handles CRUD operations for recipes through FastAPI endpoints.
- AI Recipe Suggestions — Sends available ingredients to the Groq API and returns an AI-generated recipe suggestion.
| Technology | Purpose |
|---|---|
| Python | Core programming language |
| FastAPI | Backend framework |
| SQLModel | Database ORM and data modeling |
| SQLite | Database |
| Pydantic | Data validation |
| Groq API | AI-powered recipe generation |
| Git & GitHub | Version control and repository management |
recipe-manager-api/
│
├── routes/
├── services/
├── models.py
├── schemas.py
├── database.py
├── config.py
├── main.py
├── requirements.txt
├── .gitignore
└── README.md
| Method | Endpoint | Description |
|---|---|---|
| POST | /recipes |
Create a new recipe |
| GET | /recipes |
Retrieve all recipes |
| GET | /recipes/{id} |
Retrieve a recipe by ID |
| PUT | /recipes/{id} |
Update a recipe |
| DELETE | /recipes/{id} |
Delete a recipe |
| Method | Endpoint | Description |
|---|---|---|
| POST | /recipes/suggest |
Generate an AI-powered recipe suggestion |
git clone <repository-url>
cd recipe-manager-apipython -m venv venvWindows:
venv\Scripts\activatepip install -r requirements.txtCreate a .env file and add your Groq API key:
GROQ_API_KEY=your_api_keyuvicorn main:app --reloadThe API will be available at:
http://127.0.0.1:8000
FastAPI provides interactive API documentation at:
- Swagger UI:
http://127.0.0.1:8000/docs - ReDoc:
http://127.0.0.1:8000/redoc
This project helped strengthen practical understanding of:
- FastAPI development
- CRUD operations
- Dependency Injection
- Schema validation
- SQLModel ORM
- SQLite database integration
- AI API integration
- Spec-Driven Development
Potential future enhancements include:
- Improved recipe recommendation logic
- Additional recipe filtering and search functionality
- More advanced ingredient-based recommendations
- User authentication and authorization
- Deployment support
Muhammad Umar
Building practical applications at the intersection of software engineering and AI.
- GitHub: https://github.com/devsparkcodes
- LinkedIn: https://linkedin.com/in/devsparkcodes