Fullstack service to publish recipes, subscribe to publications of other users, add favorite recipes to the Favorites list. Has a possibility to download a summary ingredients list, needed for cooking of dishes from chosen list.
Using SQLite as DB, backend based on View-sets approach. JWT-token for authorization. DRF for permissions setup
Backend performs next modules:
- Recipe: can create new recipes with images, ingredients, tags, cooking time and text or edit/delete existing ones
- Tag: Colored titles
- Ingredient: Ingredient info, connected to recipe
Pages:
- Main - list of the first six recipes, sorted by publication date (newest to oldest). The rest of the recipes are available on the following pages: there is pagination at the bottom of the page.
- Recipe - full description of the recipe. For authorized users - the ability to add a recipe to favorites and to the shopping list, the ability to subscribe to the author of the recipe.
- User profile - the username, all recipes published by the user and the ability to subscribe to the user.
- Subscription - subscription to publications is available only to an authorized user. The subscriptions page is only available to the owner.
- List of favorites - the list of favorites is available only to an authorized user. The favorites list can only be viewed by its owner.
- Shopping list - the shopping list is available to authorized users. The shopping list can only be viewed by its owner.
Roles:
- Anonymous
- create an account
- view recipes on homepage
- view individual recipe pages
- view user pages
- filter recipes by tags.
- User (authenticated)
- log in with your username and password
- log out of the system (log out)
- change your password
- create/edit/delete your own recipes
- view recipes on homepage
- view user pages
- view individual recipe pages
- filter recipes by tags
- work with a personal favorites list: add recipes to it or delete them, view your favorite recipes page
- work with a personal shopping list: add / delete any recipes, upload a file with the number of ingredients needed for recipes from the shopping list
- subscribe to publications of recipe authors and unsubscribe, view your subscription page
- Administrator
- same rights as authenticated user
- change the password of any user
- create/block/delete user accounts
- edit/delete any recipes
- add/remove/edit ingredients
- add/remove/edit tags
git clone https://github.com/AdeleDev/food_menu_python_app.git
Take infra/.env.example as initial file
Rename ".env.example" to ".env"
Set necessary values in the file
cd foodgram-project-react/infra
docker compose up
docker-compose exec backend python manage.py makemigrations --noinput
docker-compose exec backend python manage.py migrate --noinput
docker-compose exec backend python manage.py collectstatic --no-input
sudo docker-compose exec backend python manage.py load_ingredients
sudo docker-compose exec backend python manage.py load_tags
docker-compose exec backend python manage.py createsuperuser
Navigate to http://localhost:8000/
API documentation:
http://127.0.0.1/api/docs/
Get JWT-token request:
http://127.0.0.1:8000/api/auth/token/login/
Get genres request:
http://127.0.0.1:8000/api/recipes/
Get tags:
http://127.0.0.1:8000/api/tags/