Skip to content

Alexandr-Safariantc/product_assistant

Repository files navigation

Python Fridge Database

Product assistant

A simple app to find new amazing recipes
--> Quick start <--

Table of Contents
  1. Features
  2. Getting Started
  3. Explanations
  4. Restrictions
  5. Contact

Features

  • Adding your fantastic recipes to feed and show them for other users.
  • Editing post with your recipe if you want to make it perfect.
  • Watching other users' recipes and adding them to your favorites.
  • Following to authors which you like and watching their new recipes first.
  • Adding recipes to shopping list and download file with ingredients for cooking them.

Built With

Product assistant workflow

Getting Started

Get project

Go to Project

Run as python script

Prerequisites

  • python 3.9.19
  • pip

Installation

  1. Clone the repo
    $ git clone https://github.com/Alexandr-Safariantc/product_assistant
  2. Activate virtual environment
    $ cd product_assistant
    $ python3 -m venv venv
  • for Linux/macOS
    $ source .venv/bin/activate
  • for windows
    $ source .venv/scripts/activate
  1. Upgrade pip

    (venv) $ python3 -m pip install --upgrade pip
  2. Install requirements

    (venv) $ cd backend/
    (venv) $ pip install -r requirements.txt
  3. Migrate database

    (venv) $ python3 manage.py migrate
  4. Add test data to database

    (venv) $ python3 manage.py import_csv
  5. Run app

    (venv) $ python3 manage.py runserver

(back to top)

Setting up CI/CD pipeline on GitHub Actions

  • Fork this repository on GitHub
  • Configure secrets for your project in GitHub UI
  • Add a remote origin to the local repo
  • Configure .env secrets
  • Push the code
  • Open the GitHub Actions for your project to verify the state of the deployment pipeline

Secrets

GitHub secrets

DOCKER_PASSWORD: your password for https://hub.docker.com/
DOCKER_USERNAME: your username for https://hub.docker.com/
HOST: IP address of server you want to deploy
SSH_KEY: SSH key for deploy server access
SSH_PASSPHRASE: passphrase for deploy server access
USER: login for deploy server access
TELEGRAM_TOKEN: Telegram bot's authorization token that will send the message
TELEGRAM_TO: Unique identifier for chat you want to get message with deploy info

.env secrets

ALLOWED_HOSTS: {IP address of server you want to deploy},127.0.0.1,localhost,{your domaine name if exists}
DEBUG_VALUE: if not setted debug mode is off, not required
DB_HOST: your PostgreSQL db host name
DB_PORT: your PostgreSQL db port, not required
POSTGRES_DB: your PostgreSQL db host name, not required
POSTGRES_PASSWORD:your PostgreSQL db password access
POSTGRES_USER:your PostgreSQL db username access, not required
SECRET_DJANGO_KEY: secret key for Django app

(back to top)

Explanation

Database Structure

Recipe
Contains recipe's author, cooking_time, created_at, image, name, ingredients, tags, text.

Ingredient
Contains recipe ingredients' name, measurement_unit.

Tag
Contains recipe tags' name, color, slug.

IngredientRecipe
Linked model for ingredient - recipe relation, moreover contains ingredient amount.

TagRecipe
Linked model for tag - recipe relation.

Follow
Process following to recipe authors.

Favorite
Process adding recipes to favorites, moreover contains created_at.

ShoppingCartRecipe
Process adding recipes to user's shopping cart and download ingredients list for chosen recipes cooking.

Restrictions

1. Media files size
We know that you can share lots of delishes recipes so we have to set the maximum media files size for 20M to ensure all your wonderful dishes are featured in our feed.

2. Recipe's cooking time limits
Cooking time can't be less then 1 minute, isn't it? Too high values are also restricted.

3. Recipe's ingredient amount limits
Limits are same as for cooking time.

4. Tags are required
We really want to meet your expectations so to make it easier and faster to find the needed recipe you have to add at least one tag to your recipe.

(back to top)

Contacts

Alexandr Safariants Backend developer

Gmail Badge

(back to top)

Releases

No releases published

Packages

No packages published