This project is a simple recipe API that allows users to create, read, update, and delete recipes. The database used in this project is SQLite, and the ORM used is SQLAlchemy. The framework used is FastAPI.
- User registration and authentication using JWT tokens.
- Pagination for the recipes endpoint.
- Searching for recipes by name, ingredients, or instructions.
- GET
/- Welcome message - POST
/register- Register a new user - POST
/token- Get access token - POST
/recipe- Add a new recipe - GET
/recipes- Get all recipes - GET
/recipe/{recipe_id}- Get a recipe by id - PATCH
/recipe/{recipe_id}- Update a recipe by id - DELETE
/recipe/{recipe_id}- Delete a recipe by id - GET
/recipe/search- Search for recipes
This project is licensed under the MIT License. See the LICENSE file for details.
For any inquiries, please contact:
- Name: Saurabh Yadav (itsSauraj)
- GitHub: itsSauraj
- Email: sauraj.contact@gmail.com
- Welcome
- User Authentication: Operations with users. The register, login logic is here.
- Recipe: Operations with recipes. The create, read, update, and delete logic is here.
The configuration for this project is defined in config.py and includes:
app_title: "Recipe API"app_version: "1.0.0"app_summary: "A simple recipe API that allows users to create, read, update, and delete recipes."app_license_info: License informationapp_contact_info: Contact informationapp_description: Detailed description of the projectapp_tags_metadata: Metadata for API tags
To set up the project, follow these steps:
-
Clone the repository:
git clone https://github.com/itsSauraj/recipe-api.git cd recipe-api -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Run the application:
uvicorn app:app --reload
or
fastapi dev app.py -
Access the API documentation at http://127.0.0.1:8000/docs.