Coder Social home page Coder Social logo

juriansluiman / groceri.es Goto Github PK

View Code? Open in Web Editor NEW
370.0 7.0 33.0 860 KB

groceri.es is a recipe manager and meal planning tool

License: MIT License

Dockerfile 0.26% Python 42.95% Mako 0.64% Shell 0.27% HTML 53.92% JavaScript 1.95%
open-source recipes meal-planner recipes-app

groceri.es's Introduction

groceri.es

This repository contains all source code for hosting your own groceri.es app. groceri.es is a webapplication to manage your own recipes, planning your meals for the week and it automatically creates a groceries list for you to do shopping.

groceri.es is built by Jurian Sluiman and its design of groceri.es is opinionated how I perform my meal planning and grocery shopping in the last years.

Screenshot of the home page

Functional design

The basic idea is you do you groceries weekly and plan the meals ahead for that week. You can skip days if you plan to eat outdoors, this is your planning for meals you cook yourself.

You can quick search a known recipe for a certain day. Otherwise, you can browse the recipes for a certain day and filter on a variety of options. These recipes can be planned on a certain day.

Recipes are entered beforehand manually and contains ingredient listings. If you plan a recipe on a certain day, ingredients are automatically added to your grocery shopping list.

When you haven't a recipe entered but know what meal you want to schedule at a certain day, you can enter it as free text yourself at that day. You can also provide short notes which can act as guidelines for the meal prep itself. Please be aware when you schedule meals manually this way, no ingredients are mapped so you have to add those to the groceries yourself.

The process above is set out in a functional flow diagram below:

Flow chart of groceri.es functional design

Pantry

Some ingredients are part of you pantry and you buy them in bulk. groceri.es will automatically map those for you. When you plan a recipe, the pantry items are assumed to be available and not added to your groceries list. As part of above flow chart, mind you have to check your pantry and make sure all pantry items as ingredient are present. If you haven't enough stock, just select the pantry item to add those to your groceries.

Servings

A recipe has a default servings. You are able to change the servings when you plan your meals. groceri.es will automatically adjust the amount to your needs.

To be more precise, a recipe ingredients listing contains a scale factor. By default the scale factor is 1, which means that the ingredients are scaled linear by the servings you need.

However, some ingredients (like, salt) don't need to double when you double the servings. You can adjust the scaling factor by the scale parameter. When the scale for salt, for example, is 0.5, this means doubling the servings means the amount of salt will be 1.5 of the original recipe.

Please note you can also scale down servings. Most recipes will serve 4 people, if your household is only 2, groceri.es will recalculate the ingredients for 2 people. The default servings of a recipe to be calculated, can be set in the settings menu.

Technical design

UML of the data models

Basically the application is a simple CRUD system around recipes and meals. In the domain model, a recipe is a set of instructions for preparing a particular dish, including the the list of ingredients required. A meal is a dish planned at a specified date.

Recipe organisation

To help categorize the recipes, a Category is offered. A category has a one-to-many relationship with a recipe, to mark a recipe as starter, main or desert. This helps greatly in filtering recipes. You can also state which categories must be shown at default in a recipe listing. If you mainly use groceri.es for dinner meals, you can filter out drinks, breakfast or lunch.

Another way or organisation is the Tag. A tag has a many-to-many relationship with recipes and adds reusable labels to the recipe. Think for example about the cuisine (Italian, Indian, French etc) or mark recipes as vegetarian, gluten-free or whatever organisation you can think of.

Meal planning

A meal is a planned dish at a certain day. If a recipe is required for the meal, the meal scheduler will provide the recipe for you. If you don't have a recipe but you know what to eat, you can simply enter a title of the meal. For later reference, you can add a note which help you memorize what to prepare.

Note that groceri.es is not opinionated on the time the meal is planned or the amount of meals you plan at a certain day. This enables users to plan breakfast, lunch and/or dinner. Or, you can schedule a starter, main course, side dish and desert at the same day for a large menu.

Grocery list and pantry items

When you use the meal scheduler, several recipes will be planned at some days in your week planning. The ingredients for the recipes will be added to your grocery list. The quantity of several ingredients is not only based on the recipe, but also based on your default settings of servings and your (optionally entered) servings in the meal scheduler.

When using a manually planned dish in the scheduler, you can add grocery items yourself. Please be aware these manual items aren't linked to a meal. This means when you remove a meal from the schedule, these ingredients won't disappear from the grocery list.

Another set of items are the products from your pantry. You can enter pantry items yourself, but they can be linked from recipes. When you schedule a recipe, the pantry items won't be added to your groceries automatically, since it is assumed you have plenty in stock.

Source code and software dependencies

The source code is a Flask application with the help of the uwsgi-nginx-flask docker image. It is powered by several great projects:

  1. uwsgi-nginx-flask: groceri.es is a single docker image based on uwsgi-nginx-flask. This image contains the last Flask release and includes nginx as web browser and uWSGI to run the python application.
  2. Flask-Login: to provide user management in Flask applications
  3. Flask-Babel: to provide i18n (user translations) in Flask applications
  4. Flask-Migrate: to help users to keep the database up to date with new releases of groceri.es. If you (re)start a docker container, it will automatically migrate your database to the version from the container.
  5. Fomantic UI: as CSS framework to quickly build an interface for this app

Run groceri.es

The docker image is meant to be ephemeral, which means the container can be stopped and thrown away without losing data. The user generated content is stored in a database, which can be a SQLite database in a docker volume, or a (SQL based) database in a linked docker container separate from this application.

Furthermore it is advised to create a volume container for your image uploads, so these images are kept separately from the application container as well.

Build the image from source code

The image will be available on Docker Hub later, but you can already create the image yourself with the source code.

Clone the repository first to your local machine

git clone https://github.com/juriansluiman/groceri.es

Create the docker image from source

docker build -t groceri.es .

Run the container

To run an image which you just created, it simply is docker run:

docker run -d --name groceri.es -p 80:80 -e SECRET_KEY='my-secret-here' groceri.es

This will spin up nginx inside the container and will serve the site at port 80 on your host machine. If you want to use a different port, for example 1234, change the port argument to -p 1234:80. More information about the SECRET_KEY parameter can be read at the section about flask sessions

If you need to run Flask in development setup, you can use the below command to run it with the built in webserver. Mind this is not meant to scale for production!

docker run -d --rm --name groceri.es -p 1234:80 -v $(pwd)/app:/app \
 -e FLASK_APP=app.py -e FLASK_DEBUG=1 -e SECRET_KEY='my-secret-here' groceri.es \
 flask run --host=0.0.0.0 --port=80

Run outside the container

Alternatively you can run development mode outside of a container. This can be useful to speed development when you need to frequently restart the server. To do so you'll need to set up a Python virtual environment with the prerequisites:

python3 -m venv ve
source ve/bin/activate
pip install -r app/requirements.txt

After that you'll need to manually create a database file and run the migrations:

cd app/
FLASK_APP=app.py FLASK_DEBUG=1 SQLALCHEMY_DATABASE_URI=sqlite:///tmp/test.db flask current
FLASK_APP=app.py FLASK_DEBUG=1 SQLALCHEMY_DATABASE_URI=sqlite:///tmp/test.db flask upgrade

This will create a database file at /tmp/test.db. After that you can start the app and tell it to use the database file:

FLASK_APP=app.py FLASK_DEBUG=1 SQLALCHEMY_DATABASE_URI=sqlite:///tmp/test.db SECRET_KEY=something-secret flask run --host=127.0.0.1 --port=10020

You can then reach the development server at http://127.0.0.1:10020

If you need to create database migrations you can do so with:

FLASK_APP=app.py FLASK_DEBUG=1 SQLALCHEMY_DATABASE_URI=sqlite:///tmp/test.db flask db migrate
FLASK_APP=app.py FLASK_DEBUG=1 SQLALCHEMY_DATABASE_URI=sqlite:///tmp/test.db flask db upgrade

Database and persistency

By default Flask uses SQLAlchemy with a database URI sqlite:///db/app.db. This creates as SQLite database in the /app/db/ folder of the image. Please be aware the container should be ephemeral and removing the container will destroy all your data.

You can persits the database storage in several ways:

Use a docker volume

Create a docker volume and mount the volume at /app/db so the database file will be created inside the mounted volume.

docker volume create groceries-db
docker run -d --name groceri.es -v groceries-db:/app/db -e SECRET_KEY='my-secret-here' -p 80:80 groceri.es

Use a SQL server

The more performant method is to create a separate container with an SQL server, for example myself and link that container to the groceri.es container.

It is possible to change the database URI from SQLAlchemy as the URI is stored in the Config object. This object contains all default config variables but they can be overridden by a docker env flag:

docker run -d -e MY_CONFIG_KEY='my-custom-value' groceri.es

Knowing this, it is possible to create a MySQL container, link it to the application container and change it's SQLALCHEMY_DATABASE_URI key with the new database server. The format of the URI is dialect+driver://username:password@host:port/database.

docker run -d --name groceries-db \
    -e MYSQL_RANDOM_ROOT_PASSWORD='yes' \
    -e MYSQL_DATABASE='groceries' \
    -e MYSQL_USER='groceries' \
    -e MYSQL_PASSWORD='my-random-password' \
    mysql:8.0

docker run -d --name groceri.es -p 80:80 \
    --link groceries-db \
    -e SQLALCHEMY_DATABASE_URI='mysql+pymysql://groceries:my-random-password@groceries-db/groceries?charset=utf8mb4' \
    -e -e SECRET_KEY='my-secret-here' \
    groceri.es

Flask session and SECRET_KEY

In all examples a variable SECRET_KEY is provided to run the docker container. This env variable works similar to the SQLALCHEMY_DATABASE_URI env variable, as it overwrites the configuration value of the Flask Config.

You must provide a secret key to Flask to make sessions work. The session is required for CSRF protection and to keep users logged into the application.

There are security measures by Docker using docker secret to keep variables secret in a Docker environment. However at this moment docker secrets are not supported in groceri.es.

groceri.es's People

Contributors

eliribble avatar jezz3 avatar jhollowe avatar juriansluiman avatar povode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

groceri.es's Issues

AttributeError: module 'app.db' has no attribute 'Table'

Logs from my docker container:

Running script /app/prestart.sh
Run flask migration upgrades (show current version first)
Traceback (most recent call last):
  File "/usr/local/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 990, in main
    cli.main(args=sys.argv[1:])
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 596, in main
    return super().main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 439, in decorator
    with __ctx.ensure_object(ScriptInfo).load_app().app_context():
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 406, in load_app
    app = locate_app(self, import_name, None, raise_if_not_found=False)
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 256, in locate_app
    __import__(module_name)
  File "/app/app.py", line 25, in <module>
    from models import User  # noqa
  File "/app/models.py", line 5, in <module>
    recipe_tag = db.Table(
AttributeError: module 'app.db' has no attribute 'Table'

Note: I changed Flask-Login to 0.6.2. Probably not relevant.

Getting 500 after creating a new recipe - fresh installation

ERROR:app:Exception on /recipes/1/bakedsalmon [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2070, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1515, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/usr/local/lib/python3.8/site-packages/flask_login/utils.py", line 272, in decorated_view
return func(*args, **kwargs)
File "/app/./views.py", line 131, in recipe
return render_template('recipe.html', recipe=recipe)
File "/usr/local/lib/python3.8/site-packages/flask/templating.py", line 147, in render_template
return _render(
File "/usr/local/lib/python3.8/site-packages/flask/templating.py", line 128, in _render
rv = template.render(context)
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1304, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 925, in handle_exception
raise rewrite_traceback_stack(source=source)
File "/app/templates/recipe.html", line 4, in top-level template code
{% set active_page = 'recipes' %}
File "/app/templates/layout.html", line 81, in top-level template code
{% block content %}{% endblock %}
File "/app/templates/recipe.html", line 14, in block 'content'
{{ recipe.category.name }}
File "/app/./app.py", line 48, in slug
return slugify(value)
File "/usr/local/lib/python3.8/site-packages/slugify/slugify.py", line 104, in slugify
text = _unicode(text, 'utf-8', 'ignore')
TypeError: decoding to str: need a bytes-like object, Undefined found

Freshly build Docker Image won't start

While running a newly build Docker Image it will fail instantly with following error:

Checking for script in /app/prestart.sh
Running script /app/prestart.sh
Run flask migration upgrades (show current version first)
Usage: flask db current [OPTIONS]
Try 'flask db current --help' for help.

Error: While importing 'app', an ImportError was raised:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 256, in locate_app
    __import__(module_name)
  File "/app/app.py", line 6, in <module>
    from flask_login import LoginManager
  File "/usr/local/lib/python3.8/site-packages/flask_login/__init__.py", line 16, in <module>
    from .login_manager import LoginManager
  File "/usr/local/lib/python3.8/site-packages/flask_login/login_manager.py", line 24, in <module>
    from .utils import (login_url as make_login_url, _create_identifier,
  File "/usr/local/lib/python3.8/site-packages/flask_login/utils.py", line 13, in <module>
    from werkzeug.security import safe_str_cmp
ImportError: cannot import name 'safe_str_cmp' from 'werkzeug.security' (/usr/local/lib/python3.8/site-packages/werkzeug/security.py)

It might be related to https://stackoverflow.com/questions/71652965/importerror-cannot-import-name-safe-str-cmp-from-werkzeug-security

Volume for images

In the readme, it says it is advisable to create a volume for uploaded images but it is not mentioned where the images are located inside the container.

Running Groceri.es from Docker using a volume mount for the SQLite DB fails

Checking for script in /app/prestart.sh
Running script /app/prestart.sh
Run flask migration upgrades (show current version first)
mkdir: can't create directory 'db/': File exists

The problem is in the app/prestart.sh script, it tries to create the db/ directory, but due to mounting a volume on /app/db this directory already exists in the container and thus the command fails.

Error: No such command 'current'.

FLASK_APP=app.py FLASK_DEBUG=1 SQLALCHEMY_DATABASE_URI=sqlite:///tmp/test.db flask current
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'current'.


So, I followed the instructions on the readme...
git clone https://github.com/juriansluiman/groceri.es.git
cd groceri.es
(on second try I do git fetch origin pull/25/head:pr-25 && git checkout pr-25 here)
python3 -m venv ve
source ve/bin/activate
pip install -r app/requirements.txt
cd app/
FLASK_APP=app.py FLASK_DEBUG=1 SQLALCHEMY_DATABASE_URI=sqlite:///tmp/test.db flask current

and it errors

Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'current'.

So, what am I missing or is this a bug?

cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
(MX Linux)

Settings menu option generates internal server error

Pressing the Settings option under the menu gives an Internal Server Error. I guess there's no routing (yet) to generate this page. I guess it'd be nice to just put an empty placeholder in.

Stack trace:

ERROR:app:Exception on /settings [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2070, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1515, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.8/site-packages/flask_login/utils.py", line 290, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "/app/./views.py", line 178, in settings
    return render_template('settings.html',
  File "/usr/local/lib/python3.8/site-packages/flask/templating.py", line 147, in render_template
    return _render(
  File "/usr/local/lib/python3.8/site-packages/flask/templating.py", line 128, in _render
    rv = template.render(context)
  File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1291, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 926, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/app/templates/settings.html", line 2, in top-level template code
    {% set active_page = 'settings' %}
  File "/app/templates/layout.html", line 81, in top-level template code
    {% block content %}{% endblock %}
  File "/app/templates/settings.html", line 185, in block 'content'
    let uri = '{{ url_for('profile') }}'
  File "/usr/local/lib/python3.8/site-packages/flask/helpers.py", line 338, in url_for
    return appctx.app.handle_url_build_error(error, endpoint, values)
  File "/usr/local/lib/python3.8/site-packages/flask/helpers.py", line 325, in url_for
    rv = url_adapter.build(
  File "/usr/local/lib/python3.8/site-packages/werkzeug/routing.py", line 2307, in build
    raise BuildError(endpoint, values, method, self)
werkzeug.routing.BuildError: Could not build url for endpoint 'profile'. Did you mean 'groceries' instead?
[pid: 24|app: 0|req: 33/57] ip () {74 vars in 1584 bytes} [Sun Aug 21 11:44:32 2022] GET /settings => generated 290 bytes in 26 msecs (HTTP/1.1 500) 3 headers in 113 bytes (1 switches on core 0)
172.28.0.7 - - [21/Aug/2022:11:44:32 +0100] "GET /settings HTTP/1.1" 500 290 "https://groceries.ares.obbard.uk/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36" "ip"

Docker container keeps exiting on a Le Potato running Ubuntu Server

Hi Everyone,

I am really excited to build this on my home server. I run a home server on a Le Potato AML S905X-CC. I currently have Ubuntu server running on this SBC. I have tried to install this on my homeserver but I keep getting issues. The current issue I am facing is that the docker container keeps exiting when started. I am not sure what I am doing wrong.

Below are the steps I have done.

Step 1: Clone the Repository

git clone https://github.com/juriansluiman/groceri.es
cd groceri.es

Step 2: Build the Docker Image

Create a backup copy of the Dockerfile and update the Dockerfile

cp Dockerfile Dockerfile.bk
nano Dockerfile

Use an ARM-compatible base image instead of the x86_64 image:

# Dockerfile
FROM arm32v7/python:3.8-alpine

# Rest of your Dockerfile remains unchanged

Build the Docker image:

docker build -t groceri.es .

Step 3: Set Up Docker Volumes

For Database

docker volume create groceries-db
docker run -d --name groceri.es -v groceries-db:/app/db -e SECRET_KEY='my-secret-here' -p 1012:80 groceri.es

For Image Uploads

docker volume create groceries-uploads
docker run -d --name groceri.es_second -v groceries-db:/app/db -v groceries-uploads:/app/uploads -e SECRET_KEY='my-secret-here' -p 1012:80 groceri.es

Step 4: Run the Container

docker run -d --name groceri.es_app -p 1012:80 -e SECRET_KEY='my-secret-here' groceri.es

After completing these steps, I should be able to access the groceri.es application by navigating to http://192.168.1.94:1012 in my web browser. However, the container keeps exiting and when I navigate to the webpage, I get a this site can't be reached error.

Can you please help, I am not sure what to do to fix this. Or will it not work on a SBC?

ImportError: cannot import name 'User' from partially initialized module 'models' (most likely due to a circular import) (/app/models.py)

When attempting to run the app via python app.py I get the following error:

python app.py 
Traceback (most recent call last):
  File "app.py", line 25, in <module>
    from models import User  # noqa
  File "/app/models.py", line 1, in <module>
    from app import db
  File "/app/app.py", line 25, in <module>
    from models import User  # noqa
ImportError: cannot import name 'User' from partially initialized module 'models' (most likely due to a circular import) (/app/models.py)

I'm working on a fix. Shouldn't be too complicated.

Login after install

Is it just me or you don't mention how to create a login after deployment of docker container?

Any advice would be welcome.

Regards,
Petyo

Simple docker setup fails

When building the current master as a docker image like in the docs mentioned and running it like this:

docker run -d --name groceri.es -e SECRET_KEY='mysecret' -p 84:80 groceri.es

It fails with:

Checking for script in /app/prestart.sh
Running script /app/prestart.sh
Run flask migration upgrades (show current version first)
Traceback (most recent call last):
  File "/usr/local/bin/flask", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/flask/cli.py", line 967, in main
    cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None)
  File "/usr/local/lib/python3.6/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask/cli.py", line 426, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_migrate/cli.py", line 209, in current
    _current(directory, verbose, head_only)
  File "/usr/local/lib/python3.6/site-packages/flask_migrate/__init__.py", line 96, in wrapped
    f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_migrate/__init__.py", line 369, in current
    command.current(config, verbose=verbose, head_only=head_only)
TypeError: current() got an unexpected keyword argument 'head_only'

Dutch Pancakes

afbeelding

Hello dear devs. I was interested in your application, so I figured I'd take a look at your website. The design looks great and I really like the detailed recipes!

However, I couldn't help but notice the rating you gave the Dutch Pancakes. Now, I wouldn't say they're a piece of culinary excellence, but a measly One-Star-Review really breaks my Dutch heart. Have you tried adding apple slices? Or maybe a few slices of cheese? Or even a 'stroopwafel' or two?

Keep up the good work!

Improve recipe creating / editing

  • Improve creation form to better suit formatting needs
  • Allow recipe editing for textual properties (title, intro, description etc)
  • Allow edit mode to add/delete/update ingredients (including relationship properties as amount and scaling)

Sidebar closed leaves user unable to open

A closeable sidebar shows on small screens. With alpinejs the sidebar can be closed. After that state the user remains with:

  • The sidebar <div> remains as overlay so you can't interact with any clickable elements
  • The menu logo to expand the sidebar is outside the <div> where the alpinejs object is created, so an error is thrown ReferenceError: isOpen is not defined

As a result, a user can close the sidebar but cannot open it again

Flask Secret key

Hello,

Never set this up before, could you please help with understanding how you get the Secret key for Flask?
I am assuming I get the following error on docker run due to missing Secret Key for Flask...
error.txt

Error: While importing 'app', an ImportError was raised:

I've just installed and I get the following errors :
Checking for script in /app/prestart.sh
Running script /app/prestart.sh
Run flask migration upgrades (show current version first)
Usage: flask db current [OPTIONS]
Try 'flask db current --help' for help.
Error: While importing 'app', an ImportError was raised:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 218, in locate_app
import(module_name)
File "/app/app.py", line 6, in
from flask_login import LoginManager
File "/usr/local/lib/python3.8/site-packages/flask_login/init.py", line 16, in
from .login_manager import LoginManager
File "/usr/local/lib/python3.8/site-packages/flask_login/login_manager.py", line 24, in
from .utils import (login_url as make_login_url, _create_identifier,
File "/usr/local/lib/python3.8/site-packages/flask_login/utils.py", line 13, in
from werkzeug.security import safe_str_cmp
ImportError: cannot import name 'safe_str_cmp' from 'werkzeug.security' (/usr/local/lib/python3.8/site-packages/werkzeug/security.py)
Checking for script in /app/prestart.sh
Running script /app/prestart.sh
Run flask migration upgrades (show current version first)
Usage: flask db current [OPTIONS]
Try 'flask db current --help' for help.
Error: While importing 'app', an ImportError was raised:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 218, in locate_app
import(module_name)
File "/app/app.py", line 6, in
from flask_login import LoginManager
File "/usr/local/lib/python3.8/site-packages/flask_login/init.py", line 16, in
from .login_manager import LoginManager
File "/usr/local/lib/python3.8/site-packages/flask_login/login_manager.py", line 24, in
from .utils import (login_url as make_login_url, _create_identifier,
File "/usr/local/lib/python3.8/site-packages/flask_login/utils.py", line 13, in
from werkzeug.security import safe_str_cmp
ImportError: cannot import name 'safe_str_cmp' from 'werkzeug.security' (/usr/local/lib/python3.8/site-packages/werkzeug/security.py)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.