Skip to content

sopelj/recipe-repository

Repository files navigation

Recipe Repository

A repository for all your recipes. Put all your saved recipes in one location and share them with family and friends.

Warning

This still a WIP and is mostly just for fun.

Features

  • Add and manage recipes using the Django Admin interface
  • Import recipes automatically using recipe-scrapers
  • Explore/Search recipes
  • Scale and display recipes in the most appropriate units
  • Convert between Metric and Imperial Units #TODO

Why another recipe manager site?

A lot of other projects already exist that fulfill most needs.

I really hesitated about using one of them, but there were a few things I really wanted, mainly:

  • Share any recipe without expiration dates
  • Scaling units dynamically and switching to the most appropriate units
  • Switching between metric and imperial on any recipe
  • Multilingual recipes

I wasn't able to find one project that did all of that currently, but, really, mainly I just wanted to work on a project for fun, and if it can be useful to others all the better.

Development

Dependencies

  • Python (3.12+)
  • Yarn + Node (v20+)

Env

Copy example env file and make changes as required. Notably, change the DJANGO_SECRET and POSTGRES_PASSWORD.

cp example.env .env

Frontend

  1. Install packages
    yarn
  2. Start dev server
    yarn dev

Backend

Note

These examples all use hatch, but you can also create your on venv, install dependencies, and run ./manage.py directly

  1. Start Database. For example with docker:
    docker compose up -d db
  2. Run migrations
    hatch run ./manage.py migrate
  3. Create a superuser
    hatch run ./manage.py createsuperuser
  4. Compile Translations
    hatch run ./manage.py compilemessages
  5. Load default data
    hatch run ./manage.py loaddata admin-theme
    hatch run ./manage.py loaddata units
    hatch run ./manage.py loaddata food  # example food
    hatch run ./manage.py loaddata categories  # basic example categories
    hatch run ./manage.py loaddata qualifiers
    hatch run ./manage.py loaddata yield-units
  6. Run server
    hatch run ./manage.py runserver

Tests

Backend

hatch run test:cov

Frontend

yarn test

Linting

pre-commit run --all-files

Should be running on: http://localhost:8000/

Deployment

Settings

Settings can be configured via environment variables

Setting Default Note
SECRET_KEY None Required Must be set to a secure random string
DEBUG False Enable Django debug mode (Don't use in production)
QUERY_LOGGING_ENABLED False Log all DB queries for debugging purposes
WERKZEUG_DEBUG_PIN None Werkzeug PIN (can be set to off to diable. Only do this locally! )
SSL_ENABLED False Use HTTPS in Django. Set to True when Django is behind HTTPS proxy
POSTGRES_DB "recipe_repo" Postgres Database Table Name
POSTGRES_USER "recipe_repo" Postgres Database User
POSTGRES_PASSWORD "insecure-change-this" Postgres Database Password - Set to something secure if using Postgres
POSTGRES_HOST "db" Postgres Database Host
MEMCACHED_ENABLED False Enable Memcached
MEMCACHED_HOST None Memcached connection string. ex. "pymemcache://memcached:11211"
AUTH_LDAP_ENABLED False Enable LDAP Authentication
VITE_APP_THEME_COLOUR "#482880" Primary theme colour
VITE_APP_TITLE "Recipe Repository" Main site title
VITE_APP_TITLE_SHORT "Recipes" Short title for web app

Docker

Build docker image:

DOCKER_BUILDKIT=1 docker build . -f docker/Dockerfile

About

Recipe Management project in Django

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published