Skip to content

FCTL3314/SpecialRecipe

Repository files navigation

📖 Contents

📃 About

Special Recipe is a webapp where you can search for recipes, bookmark them, and access them as needed. Each recipe can be viewed in detail along with its comments, and users can optionally leave a comment. The search functionality allows for both category and keyword searches, while users also have the option to browse all available recipes. Additionally, the website enables users to create or edit an account, reset lost passwords, and verify email addresses.

The project was created for educational purposes.

🌄 Demonstration

  • Recipes page

firefox_NeEAcpxcd3 firefox_ojqwCSTJJx


  • Adding / removing from bookmarks

recipe-bookmark


  • Recipe detail pages

firefox_0DKWb1eWkW firefox_9SFI9HVncg


firefox_ea9Mhd9I3Y firefox_ICgV4HS1TZ


  • Bookmarks page

firefox_IrbXSTevJy


  • Profile pages

firefox_Rjwr6yUSXn firefox_GVubZrCC1K firefox_aLKDOhKHSg

  • Authentication pages

firefox_B4E9sQRVKS firefox_OHwLoPAKEr

🔥 Features

  • Django Rest API
  • Postponed Tasks / Celery
  • Recipe bookmarks
  • Recipe comments
  • Recipe markdown editing
  • Registration / Authorization
  • User profile
  • Profile editing
  • Password change / reset
  • Email verification
  • Tests

❕ Peculiarities

  • For correct display, at least 3 recipes must be created regardless of the category.
  • For correct display of images, their aspect ratio must be 16:10. Example: 1440×900, 1536×960, 1680:1050, 1920x1200...

💽 Local: Development

  1. Clone or download the repository.
  2. Create a virtual environment and install requirements from requirements/local.txt file.
  3. Create an .env file or rename .env.dist in .env and populate it only with development variables:
    • DEBUG
    • SECRET_KEY
    • DOMAIN_NAME
    • ALLOWED_HOSTS
    • INTERNAL_IPS
    • PROTOCOL
    • REDIS_HOST
    • REDIS_PORT
    • EMAIL_HOST_USER
    • EMAIL_SEND_INTERVAL_SECONDS
    • EMAIL_EXPIRATION_HOURS
    • RECIPES_PAGINATE_BY
    • CATEGORIES_PAGINATE_BY
    • COMMENTS_PAGINATE_BY
  4. Make migrations:
    • python manage.py makemigrations
    • python manage.py migrate
  5. Run redis:
  6. Run celery:
    • Windows: celery -A core worker -l INFO -P solo
    • Linux: celery -A core worker -l INFO
  7. Run development server:
    • python manage.py runserver

🐳 Docker: Production

  • All actions with files are performed in the project directory.
  • Don't forget to install docker and docker compose first.

Project Deployment:

  1. Clone or download the repository and go to its directory.
  2. Create an .env file or rename .env.dist in .env and populate it with all variables from .env.dist file.
    • In the REDIS_HOST, you need to specify not the local ip, but the name of the redis container, like this: REDIS_HOST=redis.
  3. Open data/nginx/nginx.conf file and change server_name example.com www.example.com; to your domains.
  4. Grant executable rights to the entrypoint.sh script: chmod +x ./entrypoint.sh
  5. Start the services: docker-compose up --build -d

Obtaining an ssl certificate:

  1. Access nginx container: docker exec -it <nginx-container-id> bin/sh
  2. Get ssl certificate: certbot --nginx
  3. Done ! Now you can exit from nginx container: exit