Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61f2a87cf6 | ||
|
|
fa6743110f | ||
|
|
b565cf24df | ||
|
|
903a9d8861 | ||
|
|
e2b9f02f55 | ||
|
|
82da1e51db | ||
|
|
0addb3fe6b | ||
|
|
72e614b6e5 | ||
|
|
8abcf0ca4d | ||
|
|
1f35742d8b | ||
|
|
0f5a564ff3 | ||
|
|
e11577f786 | ||
|
|
47e48e1350 | ||
|
|
9c379dfb83 | ||
|
|
b8cddfd6c5 | ||
|
|
114e878384 | ||
|
|
276e580ec4 | ||
|
|
01d991f38b | ||
|
|
ee0c519ef0 | ||
|
|
30ed5a2ba8 | ||
|
|
e2cb67f440 | ||
|
|
84639b616d | ||
|
|
250e31ac65 | ||
|
|
8c1a97df2c | ||
|
|
9fed572cc5 | ||
|
|
4611d6b791 | ||
|
|
38e20ba321 | ||
|
|
717d7ca0fb | ||
|
|
4913b90408 | ||
|
|
c430c8da33 | ||
|
|
8221c36a89 | ||
|
|
a899f46464 | ||
|
|
50a5b39836 | ||
|
|
7e26fb068f | ||
|
|
808f11da0a | ||
|
|
b3573dc078 | ||
|
|
3ec0f2ec21 | ||
|
|
70dbafb287 | ||
|
|
ba111073d6 | ||
|
|
c8655c3a50 | ||
|
|
81fc0c6cb2 | ||
|
|
2338f017ed | ||
|
|
d0faa52cfd | ||
|
|
4fd2de0b6e | ||
|
|
88dfd40b8d | ||
|
|
f6c1fa0e8b | ||
|
|
7279edbd4b | ||
|
|
85f9235a17 | ||
|
|
51f3d702a2 | ||
|
|
082448c6dc | ||
|
|
af87045037 | ||
|
|
cdad8b054e | ||
|
|
d7bd68198e |
@@ -1,3 +1,29 @@
|
||||
.git
|
||||
.github
|
||||
.dockerignore
|
||||
.gitignore
|
||||
|
||||
.idea
|
||||
.vscode
|
||||
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
htmlcov/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.pytest_cache/
|
||||
.venv
|
||||
venv
|
||||
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
._*
|
||||
|
||||
*/node_modules
|
||||
*/dist
|
||||
##
|
||||
*/data/db
|
||||
*/mealie/test
|
||||
*/mealie/.temp
|
||||
6
.flake8
Normal file
@@ -0,0 +1,6 @@
|
||||
[flake8]
|
||||
ignore = [
|
||||
E501 # Line Length - See Black Config in pyproject.toml
|
||||
E402 # Import Not at Top of File
|
||||
]
|
||||
exclude = _all_models.py
|
||||
3
.gitattributes
vendored
@@ -1 +1,2 @@
|
||||
*.css linguist-detectable=false
|
||||
*.css linguist-detectable=false
|
||||
*.html linguist-detectable=false
|
||||
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
github: [hay-kot]
|
||||
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Create a bug report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
**Steps To Reproduce**
|
||||
Please be specific!
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. etc.
|
||||
|
||||
**Sample Code**
|
||||
<!-- If applicable, please include Sample code to reproduce the issue. -->
|
||||
|
||||
**Expected behavior**
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
**Actual Behavior**
|
||||
<!-- A clear and concise description of what actually happens. -->
|
||||
|
||||
**Screenshots**
|
||||
<!-- If applicable, add screenshots to help explain your problem. -->
|
||||
|
||||
**Device Information (please complete the following information):**
|
||||
- OS: [e.g., WSL2 on Win10, Mac]
|
||||
- Deployment: [e.g., Docker-version, docker-compose, Python application]
|
||||
- Browser: [e.g., chrome, safari]
|
||||
- Version: [e.g., 0.2.0-dev]
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context about the problem here. If applicable, please include why you think the bug is occurring and/or troubleshooting you have already performed. -->
|
||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
contact_links:
|
||||
- name: Feature Requests
|
||||
url: https://github.com/hay-kot/mealie/issues/122
|
||||
about: Please add any Feature Requests here.
|
||||
4
.github/workflows/build-docs.yml
vendored
@@ -2,7 +2,7 @@ name: Publish docs via GitHub Pages
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -17,4 +17,4 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CONFIG_FILE: docs/mkdocs.yml
|
||||
EXTRA_PACKAGES: build-base
|
||||
EXTRA_PACKAGES: build-base
|
||||
|
||||
30
.github/workflows/dockerbuild.dev-docs.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Docker Build Dev Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
push_to_registry:
|
||||
name: Push Docker image to GitHub Packages
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Log in to GitHub Docker Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build container image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: ./docs
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}/dev-docs:latest
|
||||
49
.github/workflows/dockerbuild.dev.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Docker Build Dev
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
#
|
||||
# Checkout
|
||||
#
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v2
|
||||
#
|
||||
# Setup QEMU
|
||||
#
|
||||
- name: Set up QEMU
|
||||
id: qemu
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
image: tonistiigi/binfmt:latest
|
||||
platforms: all
|
||||
#
|
||||
# Setup Buildx
|
||||
#
|
||||
- name: install buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
install: true
|
||||
#
|
||||
# Login to Docker Hub
|
||||
#
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
#
|
||||
# Build
|
||||
#
|
||||
- name: build the image
|
||||
run: |
|
||||
docker build --push --no-cache \
|
||||
--tag hkotel/mealie:dev \
|
||||
--platform linux/amd64,linux/arm64 .
|
||||
48
.github/workflows/dockerbuild.prod.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Docker Build Production
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
#
|
||||
# Checkout
|
||||
#
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v2
|
||||
#
|
||||
# Setup QEMU
|
||||
#
|
||||
- name: Set up QEMU
|
||||
id: qemu
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
image: tonistiigi/binfmt:latest
|
||||
platforms: all
|
||||
#
|
||||
# Setup Buildx
|
||||
#
|
||||
- name: install buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
install: true
|
||||
#
|
||||
# Login to Docker Hub
|
||||
#
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
#
|
||||
# Build
|
||||
#
|
||||
- name: build the image
|
||||
run: |
|
||||
docker build --push \
|
||||
--tag hkotel/mealie:latest \
|
||||
--platform linux/amd64,linux/arm64 .
|
||||
56
.github/workflows/dockerbuild.release.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
name: Docker Build Production
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
#
|
||||
# Get Release Version
|
||||
#
|
||||
- uses: oprypin/find-latest-tag@v1
|
||||
with:
|
||||
repository: hay-kot/mealie # The repository to scan.
|
||||
releases-only: true # We know that all relevant tags have a GitHub release for them.
|
||||
id: mealie_version # The step ID to refer to later.
|
||||
#
|
||||
# Checkout
|
||||
#
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v2
|
||||
#
|
||||
# Setup QEMU
|
||||
#
|
||||
- name: Set up QEMU
|
||||
id: qemu
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
image: tonistiigi/binfmt:latest
|
||||
platforms: all
|
||||
#
|
||||
# Setup Buildx
|
||||
#
|
||||
- name: install buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
install: true
|
||||
#
|
||||
# Login to Docker Hub
|
||||
#
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
#
|
||||
# Build
|
||||
#
|
||||
- name: build the image
|
||||
run: |
|
||||
docker build --push \
|
||||
--tag hkotel/mealie:${{ steps.mealie_version.outputs.tag }} \
|
||||
--platform linux/amd64,linux/arm64 .
|
||||
77
.github/workflows/test-all.yml
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
name: Project Tests
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- dev
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- dev
|
||||
types: [synchronize, opened, reopened, ready_for_review]
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
env:
|
||||
PRODUCTION: false
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres
|
||||
env:
|
||||
POSTGRES_USER: mealie
|
||||
POSTGRES_PASSWORD: mealie
|
||||
POSTGRES_DB: mealie
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
ports:
|
||||
- 5432:5432
|
||||
steps:
|
||||
#----------------------------------------------
|
||||
# check-out repo and set-up python
|
||||
#----------------------------------------------
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
#----------------------------------------------
|
||||
# ----- install & configure poetry -----
|
||||
#----------------------------------------------
|
||||
- name: Install Poetry
|
||||
uses: snok/install-poetry@v1.1.1
|
||||
with:
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
#----------------------------------------------
|
||||
# load cached venv if cache exists
|
||||
#----------------------------------------------
|
||||
- name: Load cached venv
|
||||
id: cached-poetry-dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .venv
|
||||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
|
||||
#----------------------------------------------
|
||||
# install dependencies if cache does not exist
|
||||
#----------------------------------------------
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
poetry install
|
||||
poetry add "psycopg2-binary==2.8.6"
|
||||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
||||
#----------------------------------------------
|
||||
# run test suite
|
||||
#----------------------------------------------
|
||||
- name: Run Test Suite
|
||||
run: |
|
||||
make test-all
|
||||
#----------------------------------------------
|
||||
# run test suite
|
||||
#----------------------------------------------
|
||||
- name: Run Test Suite Postgres
|
||||
env:
|
||||
DB_ENGINE: postgres
|
||||
POSTGRES_SERVER: localhost
|
||||
run: |
|
||||
make test-all
|
||||
38
.gitignore
vendored
@@ -1,25 +1,20 @@
|
||||
# Byte-compiled / optimized / DLL files
|
||||
.env
|
||||
__pycache__/
|
||||
*__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# frontend/.env.development
|
||||
docs/site/
|
||||
mealie/temp/*
|
||||
mealie/temp/api.html
|
||||
*temp/*
|
||||
.secret
|
||||
frontend/dist/
|
||||
|
||||
|
||||
mealie/data/backups/*
|
||||
mealie/data/debug/*
|
||||
mealie/data/img/*
|
||||
!mealie/dist/*
|
||||
|
||||
#Exception to keep folders
|
||||
!mealie/dist/.gitkeep
|
||||
!mealie/data/backups/.gitkeep
|
||||
!mealie/data/backups/dev_sample_data*
|
||||
!mealie/data/debug/.gitkeep
|
||||
!mealie/data/img/.gitkeep
|
||||
dev/data/backups/*
|
||||
dev/data/debug/*
|
||||
dev/data/img/*
|
||||
dev/data/migration/*
|
||||
dev/data/users/*
|
||||
|
||||
.DS_Store
|
||||
node_modules
|
||||
@@ -60,6 +55,7 @@ eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
!frontend/src/components/Recipe/Parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
@@ -88,6 +84,7 @@ coverage.xml
|
||||
*.cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
test.db
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
@@ -143,8 +140,13 @@ ENV/
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
|
||||
# IDE settings
|
||||
# .vscode/
|
||||
|
||||
# Node Modules
|
||||
node_modules/
|
||||
*.db
|
||||
*.sqlite
|
||||
scratch.py
|
||||
dev/data/backups/dev_sample_data*.zip
|
||||
!dev/data/backups/test*.zip
|
||||
dev/data/recipes/*
|
||||
dev/scripts/output/app_routes.py
|
||||
dev/scripts/output/javascriptAPI/*
|
||||
588
.pylintrc
Normal file
@@ -0,0 +1,588 @@
|
||||
[MASTER]
|
||||
|
||||
# A comma-separated list of package or module names from where C extensions may
|
||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||
# run arbitrary code.
|
||||
extension-pkg-whitelist=
|
||||
|
||||
# Specify a score threshold to be exceeded before program exits with error.
|
||||
fail-under=10.0
|
||||
|
||||
# Add files or directories to the blacklist. They should be base names, not
|
||||
# paths.
|
||||
ignore=CVS
|
||||
|
||||
# Add files or directories matching the regex patterns to the blacklist. The
|
||||
# regex matches against base names, not paths.
|
||||
ignore-patterns=
|
||||
|
||||
# Python code to execute, usually for sys.path manipulation such as
|
||||
# pygtk.require().
|
||||
#init-hook=
|
||||
|
||||
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
|
||||
# number of processors available to use.
|
||||
jobs=1
|
||||
|
||||
# Control the amount of potential inferred values when inferring a single
|
||||
# object. This can help the performance when dealing with large functions or
|
||||
# complex, nested conditions.
|
||||
limit-inference-results=100
|
||||
|
||||
# List of plugins (as comma separated values of python module names) to load,
|
||||
# usually to register additional checkers.
|
||||
load-plugins=
|
||||
|
||||
# Pickle collected data for later comparisons.
|
||||
persistent=yes
|
||||
|
||||
# When enabled, pylint would attempt to guess common misconfiguration and emit
|
||||
# user-friendly hints instead of false-positive error messages.
|
||||
suggestion-mode=yes
|
||||
|
||||
# Allow loading of arbitrary C extensions. Extensions are imported into the
|
||||
# active Python interpreter and may run arbitrary code.
|
||||
unsafe-load-any-extension=no
|
||||
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
|
||||
# Only show warnings with the listed confidence levels. Leave empty to show
|
||||
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
|
||||
confidence=
|
||||
|
||||
# Disable the message, report, category or checker with the given id(s). You
|
||||
# can either give multiple identifiers separated by comma (,) or put this
|
||||
# option multiple times (only on the command line, not in the configuration
|
||||
# file where it should appear only once). You can also use "--disable=all" to
|
||||
# disable everything first and then reenable specific checks. For example, if
|
||||
# you want to run only the similarities checker, you can use "--disable=all
|
||||
# --enable=similarities". If you want to run only the classes checker, but have
|
||||
# no Warning level messages displayed, use "--disable=all --enable=classes
|
||||
# --disable=W".
|
||||
disable=print-statement,
|
||||
parameter-unpacking,
|
||||
unpacking-in-except,
|
||||
old-raise-syntax,
|
||||
backtick,
|
||||
long-suffix,
|
||||
old-ne-operator,
|
||||
old-octal-literal,
|
||||
import-star-module-level,
|
||||
non-ascii-bytes-literal,
|
||||
raw-checker-failed,
|
||||
bad-inline-option,
|
||||
locally-disabled,
|
||||
file-ignored,
|
||||
suppressed-message,
|
||||
useless-suppression,
|
||||
deprecated-pragma,
|
||||
use-symbolic-message-instead,
|
||||
apply-builtin,
|
||||
basestring-builtin,
|
||||
buffer-builtin,
|
||||
cmp-builtin,
|
||||
coerce-builtin,
|
||||
execfile-builtin,
|
||||
file-builtin,
|
||||
long-builtin,
|
||||
raw_input-builtin,
|
||||
reduce-builtin,
|
||||
standarderror-builtin,
|
||||
unicode-builtin,
|
||||
xrange-builtin,
|
||||
coerce-method,
|
||||
delslice-method,
|
||||
getslice-method,
|
||||
setslice-method,
|
||||
no-absolute-import,
|
||||
old-division,
|
||||
dict-iter-method,
|
||||
dict-view-method,
|
||||
next-method-called,
|
||||
metaclass-assignment,
|
||||
indexing-exception,
|
||||
raising-string,
|
||||
reload-builtin,
|
||||
oct-method,
|
||||
hex-method,
|
||||
nonzero-method,
|
||||
cmp-method,
|
||||
input-builtin,
|
||||
round-builtin,
|
||||
intern-builtin,
|
||||
unichr-builtin,
|
||||
map-builtin-not-iterating,
|
||||
zip-builtin-not-iterating,
|
||||
range-builtin-not-iterating,
|
||||
filter-builtin-not-iterating,
|
||||
using-cmp-argument,
|
||||
eq-without-hash,
|
||||
div-method,
|
||||
idiv-method,
|
||||
rdiv-method,
|
||||
exception-message-attribute,
|
||||
invalid-str-codec,
|
||||
sys-max-int,
|
||||
bad-python3-import,
|
||||
deprecated-string-function,
|
||||
deprecated-str-translate-call,
|
||||
deprecated-itertools-function,
|
||||
deprecated-types-field,
|
||||
next-method-defined,
|
||||
dict-items-not-iterating,
|
||||
dict-keys-not-iterating,
|
||||
dict-values-not-iterating,
|
||||
deprecated-operator-function,
|
||||
deprecated-urllib-function,
|
||||
xreadlines-attribute,
|
||||
deprecated-sys-function,
|
||||
exception-escape,
|
||||
comprehension-escape
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
# either give multiple identifier separated by comma (,) or put this option
|
||||
# multiple time (only on the command line, not in the configuration file where
|
||||
# it should appear only once). See also the "--disable" option for examples.
|
||||
enable=c-extension-no-member
|
||||
|
||||
|
||||
[REPORTS]
|
||||
|
||||
# Python expression which should return a score less than or equal to 10. You
|
||||
# have access to the variables 'error', 'warning', 'refactor', and 'convention'
|
||||
# which contain the number of messages in each category, as well as 'statement'
|
||||
# which is the total number of statements analyzed. This score is used by the
|
||||
# global evaluation report (RP0004).
|
||||
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
|
||||
|
||||
# Template used to display messages. This is a python new-style format string
|
||||
# used to format the message information. See doc for all details.
|
||||
#msg-template=
|
||||
|
||||
# Set the output format. Available formats are text, parseable, colorized, json
|
||||
# and msvs (visual studio). You can also give a reporter class, e.g.
|
||||
# mypackage.mymodule.MyReporterClass.
|
||||
output-format=text
|
||||
|
||||
# Tells whether to display a full report or only the messages.
|
||||
reports=no
|
||||
|
||||
# Activate the evaluation score.
|
||||
score=yes
|
||||
|
||||
|
||||
[REFACTORING]
|
||||
|
||||
# Maximum number of nested blocks for function / method body
|
||||
max-nested-blocks=5
|
||||
|
||||
# Complete name of functions that never returns. When checking for
|
||||
# inconsistent-return-statements if a never returning function is called then
|
||||
# it will be considered as an explicit return statement and no message will be
|
||||
# printed.
|
||||
never-returning-functions=sys.exit
|
||||
|
||||
|
||||
[STRING]
|
||||
|
||||
# This flag controls whether inconsistent-quotes generates a warning when the
|
||||
# character used as a quote delimiter is used inconsistently within a module.
|
||||
check-quote-consistency=no
|
||||
|
||||
# This flag controls whether the implicit-str-concat should generate a warning
|
||||
# on implicit string concatenation in sequences defined over several lines.
|
||||
check-str-concat-over-line-jumps=no
|
||||
|
||||
|
||||
[MISCELLANEOUS]
|
||||
|
||||
# List of note tags to take in consideration, separated by a comma.
|
||||
notes=FIXME,
|
||||
XXX,
|
||||
TODO
|
||||
|
||||
# Regular expression of note tags to take in consideration.
|
||||
#notes-rgx=
|
||||
|
||||
|
||||
[SPELLING]
|
||||
|
||||
# Limits count of emitted suggestions for spelling mistakes.
|
||||
max-spelling-suggestions=4
|
||||
|
||||
# Spelling dictionary name. Available dictionaries: none. To make it work,
|
||||
# install the python-enchant package.
|
||||
spelling-dict=
|
||||
|
||||
# List of comma separated words that should not be checked.
|
||||
spelling-ignore-words=
|
||||
|
||||
# A path to a file that contains the private dictionary; one word per line.
|
||||
spelling-private-dict-file=
|
||||
|
||||
# Tells whether to store unknown words to the private dictionary (see the
|
||||
# --spelling-private-dict-file option) instead of raising a message.
|
||||
spelling-store-unknown-words=no
|
||||
|
||||
|
||||
[BASIC]
|
||||
|
||||
# Naming style matching correct argument names.
|
||||
argument-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct argument names. Overrides argument-
|
||||
# naming-style.
|
||||
#argument-rgx=
|
||||
|
||||
# Naming style matching correct attribute names.
|
||||
attr-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct attribute names. Overrides attr-naming-
|
||||
# style.
|
||||
#attr-rgx=
|
||||
|
||||
# Bad variable names which should always be refused, separated by a comma.
|
||||
bad-names=foo,
|
||||
bar,
|
||||
baz,
|
||||
toto,
|
||||
tutu,
|
||||
tata
|
||||
|
||||
# Bad variable names regexes, separated by a comma. If names match any regex,
|
||||
# they will always be refused
|
||||
bad-names-rgxs=
|
||||
|
||||
# Naming style matching correct class attribute names.
|
||||
class-attribute-naming-style=any
|
||||
|
||||
# Regular expression matching correct class attribute names. Overrides class-
|
||||
# attribute-naming-style.
|
||||
#class-attribute-rgx=
|
||||
|
||||
# Naming style matching correct class names.
|
||||
class-naming-style=PascalCase
|
||||
|
||||
# Regular expression matching correct class names. Overrides class-naming-
|
||||
# style.
|
||||
#class-rgx=
|
||||
|
||||
# Naming style matching correct constant names.
|
||||
const-naming-style=UPPER_CASE
|
||||
|
||||
# Regular expression matching correct constant names. Overrides const-naming-
|
||||
# style.
|
||||
#const-rgx=
|
||||
|
||||
# Minimum line length for functions/classes that require docstrings, shorter
|
||||
# ones are exempt.
|
||||
docstring-min-length=-1
|
||||
|
||||
# Naming style matching correct function names.
|
||||
function-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct function names. Overrides function-
|
||||
# naming-style.
|
||||
#function-rgx=
|
||||
|
||||
# Good variable names which should always be accepted, separated by a comma.
|
||||
good-names=i,
|
||||
j,
|
||||
k,
|
||||
ex,
|
||||
Run,
|
||||
_
|
||||
|
||||
# Good variable names regexes, separated by a comma. If names match any regex,
|
||||
# they will always be accepted
|
||||
good-names-rgxs=
|
||||
|
||||
# Include a hint for the correct naming format with invalid-name.
|
||||
include-naming-hint=no
|
||||
|
||||
# Naming style matching correct inline iteration names.
|
||||
inlinevar-naming-style=any
|
||||
|
||||
# Regular expression matching correct inline iteration names. Overrides
|
||||
# inlinevar-naming-style.
|
||||
#inlinevar-rgx=
|
||||
|
||||
# Naming style matching correct method names.
|
||||
method-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct method names. Overrides method-naming-
|
||||
# style.
|
||||
#method-rgx=
|
||||
|
||||
# Naming style matching correct module names.
|
||||
module-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct module names. Overrides module-naming-
|
||||
# style.
|
||||
#module-rgx=
|
||||
|
||||
# Colon-delimited sets of names that determine each other's naming style when
|
||||
# the name regexes allow several styles.
|
||||
name-group=
|
||||
|
||||
# Regular expression which should only match function or class names that do
|
||||
# not require a docstring.
|
||||
no-docstring-rgx=^_
|
||||
|
||||
# List of decorators that produce properties, such as abc.abstractproperty. Add
|
||||
# to this list to register other decorators that produce valid properties.
|
||||
# These decorators are taken in consideration only for invalid-name.
|
||||
property-classes=abc.abstractproperty
|
||||
|
||||
# Naming style matching correct variable names.
|
||||
variable-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct variable names. Overrides variable-
|
||||
# naming-style.
|
||||
#variable-rgx=
|
||||
|
||||
|
||||
[LOGGING]
|
||||
|
||||
# The type of string formatting that logging methods do. `old` means using %
|
||||
# formatting, `new` is for `{}` formatting.
|
||||
logging-format-style=old
|
||||
|
||||
# Logging modules to check that the string format arguments are in logging
|
||||
# function parameter format.
|
||||
logging-modules=logging
|
||||
|
||||
|
||||
[VARIABLES]
|
||||
|
||||
# List of additional names supposed to be defined in builtins. Remember that
|
||||
# you should avoid defining new builtins when possible.
|
||||
additional-builtins=
|
||||
|
||||
# Tells whether unused global variables should be treated as a violation.
|
||||
allow-global-unused-variables=yes
|
||||
|
||||
# List of strings which can identify a callback function by name. A callback
|
||||
# name must start or end with one of those strings.
|
||||
callbacks=cb_,
|
||||
_cb
|
||||
|
||||
# A regular expression matching the name of dummy variables (i.e. expected to
|
||||
# not be used).
|
||||
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
|
||||
|
||||
# Argument names that match this expression will be ignored. Default to name
|
||||
# with leading underscore.
|
||||
ignored-argument-names=_.*|^ignored_|^unused_
|
||||
|
||||
# Tells whether we should check for unused import in __init__ files.
|
||||
init-import=no
|
||||
|
||||
# List of qualified module names which can have objects that can redefine
|
||||
# builtins.
|
||||
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
|
||||
|
||||
|
||||
[TYPECHECK]
|
||||
|
||||
# List of decorators that produce context managers, such as
|
||||
# contextlib.contextmanager. Add to this list to register other decorators that
|
||||
# produce valid context managers.
|
||||
contextmanager-decorators=contextlib.contextmanager
|
||||
|
||||
# List of members which are set dynamically and missed by pylint inference
|
||||
# system, and so shouldn't trigger E1101 when accessed. Python regular
|
||||
# expressions are accepted.
|
||||
generated-members=pydantic.*
|
||||
|
||||
# Tells whether missing members accessed in mixin class should be ignored. A
|
||||
# mixin class is detected if its name ends with "mixin" (case insensitive).
|
||||
ignore-mixin-members=yes
|
||||
|
||||
# Tells whether to warn about missing members when the owner of the attribute
|
||||
# is inferred to be None.
|
||||
ignore-none=yes
|
||||
|
||||
# This flag controls whether pylint should warn about no-member and similar
|
||||
# checks whenever an opaque object is returned when inferring. The inference
|
||||
# can return multiple potential results while evaluating a Python object, but
|
||||
# some branches might not be evaluated, which results in partial inference. In
|
||||
# that case, it might be useful to still emit no-member and other checks for
|
||||
# the rest of the inferred objects.
|
||||
ignore-on-opaque-inference=yes
|
||||
|
||||
# List of class names for which member attributes should not be checked (useful
|
||||
# for classes with dynamically set attributes). This supports the use of
|
||||
# qualified names.
|
||||
ignored-classes=optparse.Values,thread._local,_thread._local
|
||||
|
||||
# List of module names for which member attributes should not be checked
|
||||
# (useful for modules/projects where namespaces are manipulated during runtime
|
||||
# and thus existing member attributes cannot be deduced by static analysis). It
|
||||
# supports qualified module names, as well as Unix pattern matching.
|
||||
ignored-modules=
|
||||
|
||||
# Show a hint with possible names when a member name was not found. The aspect
|
||||
# of finding the hint is based on edit distance.
|
||||
missing-member-hint=yes
|
||||
|
||||
# The minimum edit distance a name should have in order to be considered a
|
||||
# similar match for a missing member name.
|
||||
missing-member-hint-distance=1
|
||||
|
||||
# The total number of similar names that should be taken in consideration when
|
||||
# showing a hint for a missing member.
|
||||
missing-member-max-choices=1
|
||||
|
||||
# List of decorators that change the signature of a decorated function.
|
||||
signature-mutators=
|
||||
|
||||
|
||||
[FORMAT]
|
||||
|
||||
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
|
||||
expected-line-ending-format=
|
||||
|
||||
# Regexp for a line that is allowed to be longer than the limit.
|
||||
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
|
||||
|
||||
# Number of spaces of indent required inside a hanging or continued line.
|
||||
indent-after-paren=4
|
||||
|
||||
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
|
||||
# tab).
|
||||
indent-string=' '
|
||||
|
||||
# Maximum number of characters on a single line.
|
||||
max-line-length=100
|
||||
|
||||
# Maximum number of lines in a module.
|
||||
max-module-lines=1000
|
||||
|
||||
# Allow the body of a class to be on the same line as the declaration if body
|
||||
# contains single statement.
|
||||
single-line-class-stmt=no
|
||||
|
||||
# Allow the body of an if to be on the same line as the test if there is no
|
||||
# else.
|
||||
single-line-if-stmt=no
|
||||
|
||||
|
||||
[SIMILARITIES]
|
||||
|
||||
# Ignore comments when computing similarities.
|
||||
ignore-comments=yes
|
||||
|
||||
# Ignore docstrings when computing similarities.
|
||||
ignore-docstrings=yes
|
||||
w54
|
||||
# Ignore imports when computing similarities.
|
||||
ignore-imports=no
|
||||
|
||||
# Minimum lines number of a similarity.
|
||||
min-similarity-lines=4
|
||||
|
||||
|
||||
[DESIGN]
|
||||
|
||||
# Maximum number of arguments for function / method.
|
||||
max-args=5
|
||||
|
||||
# Maximum number of attributes for a class (see R0902).
|
||||
max-attributes=7
|
||||
|
||||
# Maximum number of boolean expressions in an if statement (see R0916).
|
||||
max-bool-expr=5
|
||||
|
||||
# Maximum number of branch for function / method body.
|
||||
max-branches=12
|
||||
|
||||
# Maximum number of locals for function / method body.
|
||||
max-locals=15
|
||||
|
||||
# Maximum number of parents for a class (see R0901).
|
||||
max-parents=7
|
||||
|
||||
# Maximum number of public methods for a class (see R0904).
|
||||
max-public-methods=20
|
||||
|
||||
# Maximum number of return / yield for function / method body.
|
||||
max-returns=6
|
||||
|
||||
# Maximum number of statements in function / method body.
|
||||
max-statements=50
|
||||
|
||||
# Minimum number of public methods for a class (see R0903).
|
||||
min-public-methods=2
|
||||
|
||||
|
||||
[IMPORTS]
|
||||
|
||||
# List of modules that can be imported at any level, not just the top level
|
||||
# one.
|
||||
allow-any-import-level=
|
||||
|
||||
# Allow wildcard imports from modules that define __all__.
|
||||
allow-wildcard-with-all=no
|
||||
|
||||
# Analyse import fallback blocks. This can be used to support both Python 2 and
|
||||
# 3 compatible code, which means that the block might have code that exists
|
||||
# only in one or another interpreter, leading to false positives when analysed.
|
||||
analyse-fallback-blocks=no
|
||||
|
||||
# Deprecated modules which should not be used, separated by a comma.
|
||||
deprecated-modules=optparse,tkinter.tix
|
||||
|
||||
# Create a graph of external dependencies in the given file (report RP0402 must
|
||||
# not be disabled).
|
||||
ext-import-graph=
|
||||
|
||||
# Create a graph of every (i.e. internal and external) dependencies in the
|
||||
# given file (report RP0402 must not be disabled).
|
||||
import-graph=
|
||||
|
||||
# Create a graph of internal dependencies in the given file (report RP0402 must
|
||||
# not be disabled).
|
||||
int-import-graph=
|
||||
|
||||
# Force import order to recognize a module as part of the standard
|
||||
# compatibility libraries.
|
||||
known-standard-library=
|
||||
|
||||
# Force import order to recognize a module as part of a third party library.
|
||||
known-third-party=enchant
|
||||
|
||||
# Couples of modules and preferred modules, separated by a comma.
|
||||
preferred-modules=
|
||||
|
||||
|
||||
[CLASSES]
|
||||
|
||||
# List of method names used to declare (i.e. assign) instance attributes.
|
||||
defining-attr-methods=__init__,
|
||||
__new__,
|
||||
setUp,
|
||||
__post_init__
|
||||
|
||||
# List of member names, which should be excluded from the protected access
|
||||
# warning.
|
||||
exclude-protected=_asdict,
|
||||
_fields,
|
||||
_replace,
|
||||
_source,
|
||||
_make
|
||||
|
||||
# List of valid names for the first argument in a class method.
|
||||
valid-classmethod-first-arg=cls
|
||||
|
||||
# List of valid names for the first argument in a metaclass class method.
|
||||
valid-metaclass-classmethod-first-arg=cls
|
||||
|
||||
|
||||
[EXCEPTIONS]
|
||||
|
||||
# Exceptions that will emit a warning when being caught. Defaults to
|
||||
# "BaseException, Exception".
|
||||
overgeneral-exceptions=BaseException,
|
||||
Exception
|
||||
24
.vscode/settings.json
vendored
@@ -1,19 +1,19 @@
|
||||
{
|
||||
"python.formatting.provider": "black",
|
||||
"python.pythonPath": "venv/bin/python",
|
||||
"python.linting.pylintEnabled": true,
|
||||
"python.pythonPath": ".venv/bin/python3.9",
|
||||
"python.linting.pylintEnabled": false,
|
||||
"python.linting.enabled": true,
|
||||
"python.autoComplete.extraPaths": ["mealie", "mealie/mealie"],
|
||||
"python.analysis.extraPaths": ["mealie", "mealie/mealie"],
|
||||
|
||||
"python.testing.unittestEnabled": false,
|
||||
"python.testing.nosetestsEnabled": false,
|
||||
"python.discoverTest": true,
|
||||
"python.testing.pytestEnabled": true,
|
||||
"cSpell.enableFiletypes": [
|
||||
"!python"
|
||||
],
|
||||
"python.testing.pytestArgs": [
|
||||
"mealie"
|
||||
]
|
||||
"python.testing.autoTestDiscoverOnSaveEnabled": false,
|
||||
"python.testing.pytestArgs": ["tests"],
|
||||
"cSpell.enableFiletypes": ["!javascript", "!python", "!yaml"],
|
||||
"i18n-ally.localesPaths": "frontend/src/locales/messages",
|
||||
"i18n-ally.sourceLanguage": "en-US",
|
||||
"i18n-ally.enabledFrameworks": ["vue"],
|
||||
"i18n-ally.keystyle": "nested",
|
||||
"cSpell.words": ["compression", "hkotel", "performant", "postgres", "webp"],
|
||||
"search.mode": "reuseEditor",
|
||||
"python.linting.flake8Enabled": true
|
||||
}
|
||||
|
||||
61
.vscode/tasks.json
vendored
@@ -3,7 +3,7 @@
|
||||
"tasks": [
|
||||
{
|
||||
"label": "DEV: Build and Start Docker Compose",
|
||||
"command": "./dev/scripts/docker-compose.dev.sh",
|
||||
"command": "make docker-dev",
|
||||
"type": "shell",
|
||||
"args": [],
|
||||
"problemMatcher": ["$tsc"],
|
||||
@@ -13,15 +13,54 @@
|
||||
"group": "test"
|
||||
},
|
||||
{
|
||||
"label": "Production: Build and Start Docker Compose",
|
||||
"command": "./dev/scripts/docker-compose.sh",
|
||||
"type": "shell",
|
||||
"args": [],
|
||||
"problemMatcher": ["$tsc"],
|
||||
"presentation": {
|
||||
"reveal": "always"
|
||||
},
|
||||
"group": "test"
|
||||
}
|
||||
"label": "Production: Build and Start Docker Compose",
|
||||
"command": "make docker-prod",
|
||||
"type": "shell",
|
||||
"args": [],
|
||||
"problemMatcher": ["$tsc"],
|
||||
"presentation": {
|
||||
"reveal": "always"
|
||||
},
|
||||
"group": "test"
|
||||
},
|
||||
{
|
||||
"label": "Dev: Start Backend",
|
||||
"command": "make backend",
|
||||
"type": "shell",
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"group": "groupA"
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Dev: Start Frontend",
|
||||
"command": "make frontend",
|
||||
"type": "shell",
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"group": "groupA"
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Dev: Start Docs Server",
|
||||
"command": "make docs",
|
||||
"type": "shell",
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"group": "groupA"
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Run python tests",
|
||||
"command": "make test",
|
||||
"type": "shell",
|
||||
"presentation": {
|
||||
"reveal": "always"
|
||||
},
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
34
Caddyfile
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
auto_https off
|
||||
admin off
|
||||
}
|
||||
|
||||
:80 {
|
||||
@proxied path /api/* /docs /openapi.json
|
||||
|
||||
@static {
|
||||
file
|
||||
path *.ico *.css *.js *.gif *.jpg *.jpeg *.png *.svg *.woff *.woff2 *.webp
|
||||
}
|
||||
|
||||
encode gzip zstd
|
||||
|
||||
# Handles Recipe Images / Assets
|
||||
handle_path /api/media/recipes/* {
|
||||
header @static Cache-Control max-age=31536000
|
||||
root * /app/data/recipes/
|
||||
file_server
|
||||
}
|
||||
|
||||
handle @proxied {
|
||||
uri strip_suffix /
|
||||
reverse_proxy http://127.0.0.1:9000
|
||||
}
|
||||
|
||||
handle {
|
||||
header @static Cache-Control max-age=31536000
|
||||
root * /app/dist
|
||||
try_files {path}.html {path} /
|
||||
file_server
|
||||
}
|
||||
}
|
||||
141
Dockerfile
@@ -1,29 +1,140 @@
|
||||
FROM node:lts-alpine as build-stage
|
||||
###############################################
|
||||
# Frontend Builder Image
|
||||
###############################################
|
||||
FROM node:lts-alpine as frontend-build
|
||||
WORKDIR /app
|
||||
COPY ./frontend/package*.json ./
|
||||
RUN npm install
|
||||
COPY ./frontend/ .
|
||||
RUN npm run build
|
||||
|
||||
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8
|
||||
###############################################
|
||||
# Base Image
|
||||
###############################################
|
||||
FROM python:3.9-slim as python-base
|
||||
|
||||
RUN apt-get update -y && \
|
||||
apt-get install -y python-pip python-dev
|
||||
ENV MEALIE_HOME="/app"
|
||||
|
||||
# We copy just the requirements.txt first to leverage Docker cache
|
||||
COPY ./requirements.txt /app/requirements.txt
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PIP_NO_CACHE_DIR=off \
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=on \
|
||||
PIP_DEFAULT_TIMEOUT=100 \
|
||||
POETRY_HOME="/opt/poetry" \
|
||||
POETRY_VIRTUALENVS_IN_PROJECT=true \
|
||||
POETRY_NO_INTERACTION=1 \
|
||||
PYSETUP_PATH="/opt/pysetup" \
|
||||
VENV_PATH="/opt/pysetup/.venv"
|
||||
|
||||
WORKDIR /app
|
||||
# prepend poetry and venv to path
|
||||
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
|
||||
|
||||
RUN pip install -r requirements.txt
|
||||
# create user account
|
||||
RUN useradd -u 911 -U -d $MEALIE_HOME -s /bin/bash abc \
|
||||
&& usermod -G users abc \
|
||||
&& mkdir $MEALIE_HOME
|
||||
|
||||
COPY ./mealie /app
|
||||
COPY ./mealie/data/templates/recipes.md /app/data/templates/recipes.md
|
||||
COPY --from=build-stage /app/dist /app/dist
|
||||
RUN rm -rf /app/test /app/temp
|
||||
###############################################
|
||||
# Builder Image
|
||||
###############################################
|
||||
FROM python-base as builder-base
|
||||
RUN apt-get update \
|
||||
&& apt-get install --no-install-recommends -y \
|
||||
curl \
|
||||
build-essential \
|
||||
libpq-dev \
|
||||
libwebp-dev \
|
||||
gnupg gnupg2 gnupg1 \
|
||||
debian-keyring \
|
||||
debian-archive-keyring \
|
||||
apt-transport-https \
|
||||
&& curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | apt-key add - \
|
||||
&& curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends -y \
|
||||
caddy \
|
||||
&& pip install -U --no-cache-dir pip
|
||||
|
||||
ENV ENV prod
|
||||
# install poetry - respects $POETRY_VERSION & $POETRY_HOME
|
||||
ENV POETRY_VERSION=1.1.6
|
||||
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
|
||||
|
||||
VOLUME [ "/app/data" ]
|
||||
# copy project requirement files here to ensure they will be cached.
|
||||
WORKDIR $PYSETUP_PATH
|
||||
COPY ./poetry.lock ./pyproject.toml ./
|
||||
|
||||
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "9000"]
|
||||
# install runtime deps - uses $POETRY_VIRTUALENVS_IN_PROJECT internally
|
||||
RUN poetry install -E pgsql --no-dev
|
||||
|
||||
###############################################
|
||||
# Development Image
|
||||
###############################################
|
||||
FROM python-base as development
|
||||
ENV PRODUCTION=false
|
||||
|
||||
# copying poetry and venv into image
|
||||
COPY --from=builder-base $POETRY_HOME $POETRY_HOME
|
||||
COPY --from=builder-base $PYSETUP_PATH $PYSETUP_PATH
|
||||
|
||||
# copy backend
|
||||
COPY ./mealie $MEALIE_HOME/mealie
|
||||
COPY ./poetry.lock ./pyproject.toml $MEALIE_HOME/
|
||||
|
||||
#! Future
|
||||
# COPY ./alembic ./alembic.ini $MEALIE_HOME/
|
||||
|
||||
# venv already has runtime deps installed we get a quicker install
|
||||
WORKDIR $MEALIE_HOME
|
||||
RUN . $VENV_PATH/bin/activate && poetry install
|
||||
WORKDIR /
|
||||
|
||||
RUN chmod +x $MEALIE_HOME/mealie/run.sh
|
||||
ENTRYPOINT $MEALIE_HOME/mealie/run.sh "reload"
|
||||
|
||||
###############################################
|
||||
# Production Image
|
||||
###############################################
|
||||
FROM python-base as production
|
||||
ENV PRODUCTION=true
|
||||
|
||||
# curl for used by healthcheck
|
||||
RUN apt-get update \
|
||||
&& apt-get install --no-install-recommends -y \
|
||||
curl \
|
||||
&& apt-get autoremove \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# copying poetry and venv into image
|
||||
COPY --from=builder-base $POETRY_HOME $POETRY_HOME
|
||||
COPY --from=builder-base $PYSETUP_PATH $PYSETUP_PATH
|
||||
|
||||
# copying caddy into image
|
||||
COPY --from=builder-base /usr/bin/caddy /usr/bin/caddy
|
||||
|
||||
# copy backend
|
||||
COPY ./mealie $MEALIE_HOME/mealie
|
||||
COPY ./poetry.lock ./pyproject.toml $MEALIE_HOME/
|
||||
COPY ./gunicorn_conf.py $MEALIE_HOME
|
||||
|
||||
#! Future
|
||||
# COPY ./alembic ./alembic.ini $MEALIE_HOME/
|
||||
|
||||
# venv already has runtime deps installed we get a quicker install
|
||||
WORKDIR $MEALIE_HOME
|
||||
RUN . $VENV_PATH/bin/activate && poetry install -E pgsql --no-dev
|
||||
WORKDIR /
|
||||
|
||||
# copy frontend
|
||||
COPY --from=frontend-build /app/dist $MEALIE_HOME/dist
|
||||
COPY ./dev/data/templates $MEALIE_HOME/data/templates
|
||||
COPY ./Caddyfile $MEALIE_HOME
|
||||
|
||||
VOLUME [ "$MEALIE_HOME/data/" ]
|
||||
ENV APP_PORT=80
|
||||
|
||||
EXPOSE ${APP_PORT}
|
||||
|
||||
HEALTHCHECK CMD curl -f http://localhost:${APP_PORT} || exit 1
|
||||
|
||||
RUN chmod +x $MEALIE_HOME/mealie/run.sh
|
||||
ENTRYPOINT $MEALIE_HOME/mealie/run.sh
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
FROM python:3
|
||||
|
||||
RUN apt-get update -y && \
|
||||
apt-get install -y python-pip python-dev
|
||||
|
||||
|
||||
COPY ./requirements.txt /app/requirements.txt
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN pip install -r requirements.txt
|
||||
RUN pip install pytest
|
||||
|
||||
COPY ./mealie /app
|
||||
|
||||
|
||||
ENTRYPOINT [ "python" ]
|
||||
|
||||
CMD [ "app.py" ]
|
||||
92
README.md
@@ -4,6 +4,11 @@
|
||||
[![Issues][issues-shield]][issues-url]
|
||||
[![MIT License][license-shield]][license-url]
|
||||
[![Docker Pulls][docker-pull]][docker-pull]
|
||||
[](https://www.codefactor.io/repository/github/hay-kot/mealie)
|
||||
[](https://github.com/hay-kot/mealie/actions/workflows/dockerbuild.release.yml)
|
||||
[](https://github.com/hay-kot/mealie/actions/workflows/test-all.yml)
|
||||
[](https://github.com/hay-kot/mealie/actions/workflows/dockerbuild.dev.yml)
|
||||
[](https://github.com/hay-kot/mealie/actions/workflows/test-all.yml)
|
||||
|
||||
<!-- PROJECT LOGO -->
|
||||
<br />
|
||||
@@ -23,71 +28,82 @@
|
||||
<a href="https://github.com/hay-kot/mealie">
|
||||
</a>
|
||||
<br />
|
||||
<a href="https://github.com/hay-kot/mealie"><s>View Demo</s></a>
|
||||
<a href="https://mealie-demo.hay-kot.dev/">View Demo</a>
|
||||
·
|
||||
<a href="https://github.com/hay-kot/mealie/issues">Report Bug</a>
|
||||
·
|
||||
<a href="https://hay-kot.github.io/mealie/api/docs/">API</a>
|
||||
<a href="https://hay-kot.github.io/mealie/api/redoc/">API</a>
|
||||
·
|
||||
<a href="https://github.com/hay-kot/mealie/issues">
|
||||
Request Feature
|
||||
</a>
|
||||
·
|
||||
<a href="https://hub.docker.com/repository/docker/hkotel/mealies"> Docker Hub
|
||||
<a href="https://hub.docker.com/r/hkotel/mealie"> Docker Hub
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<!-- ABOUT THE PROJECT -->
|
||||
## About The Project
|
||||
|
||||
|
||||
[![Product Name Screen Shot][product-screenshot]](https://example.com)
|
||||
|
||||
**Mealie** is a self hosted recipe manager and meal planner with a RestAPI backend and a reactive frontend application built in Vue for a pleasant user experience for the whole family. Easily add recipes into your database by providing the url and mealie will automatically import the relevant data or add a family recipe with the UI editor.
|
||||
# About The Project
|
||||
|
||||
Mealie also provides a secure API for interactions from 3rd party applications. **Why does my recipe manager need an API?** An API allows integration into applications like [Home Assistant]() that can act as notification engines to provide custom notifications based of Meal Plan data to remind you to defrost the chicken, marinade the steak, or start the CrockPot. See the section on [Meal Plan hooks](#hooks) for more information. Additionally, you can access any available API from the backend server. To explore the API spin up your server and navigate to http://yourserver.com/docs for interactive API documentation.
|
||||
Mealie is a self hosted recipe manager and meal planner with a RestAPI backend and a reactive frontend application built in Vue for a pleasant user experience for the whole family. Easily add recipes into your database by providing the url and Mealie will automatically import the relevant data or add a family recipe with the UI editor. Mealie also provides an API for interactions from 3rd party applications.
|
||||
|
||||
[Remember to join the Discord](https://discord.gg/QuStdQGSGK)!
|
||||
|
||||
|
||||
|
||||
### Main Features
|
||||
#### Recipes
|
||||
- Automatic web scrapping for common recipe platforms
|
||||
- Interactive API Documentation thanks to [FastAPI](https://fastapi.tiangolo.com/) and [Swagger](https://petstore.swagger.io/)
|
||||
- UI Recipe Editor
|
||||
- JSON Recipe Editor in browser
|
||||
- Custom tags and categories
|
||||
- Rate recipes
|
||||
- Add notes to recipes
|
||||
#### Meal Planner
|
||||
- Random Meal plan generation based off categories
|
||||
- Expose notes in the API to allow external applications to access relevant information for meal plans
|
||||
#### Database Import / Export
|
||||
- Easily Import / Export your recipes from the UI
|
||||
- Export recipes in into custom files using Jinja2 templates
|
||||
## Key Features
|
||||
- 🔍 Fuzzy search
|
||||
- 🏷️ Tag recipes with categories or tags for flexible sorting
|
||||
- 🕸 Import recipes from around the web by URL
|
||||
- 💪 Powerful bulk Category/Tag assignment
|
||||
- 📱 Beautiful Mobile Views
|
||||
- 📆 Create Meal Plans
|
||||
- 🛒 Generate shopping lists
|
||||
- 🐳 Easy setup with Docker
|
||||
- 🎨 Customize your interface with color themes
|
||||
- 💾 Export all your data in any format with Jinja2 Templates
|
||||
- 🔒 Keep your data safe with automated backup and easy restore options
|
||||
- 🌍 localized in many languages
|
||||
- ➕ Plus tons more!
|
||||
- Flexible API
|
||||
- Custom key/value pairs for recipes
|
||||
- Webhook support
|
||||
- Interactive API Documentation thanks to [FastAPI](https://fastapi.tiangolo.com/) and [Swagger](https://petstore.swagger.io/)
|
||||
- Raw JSON Recipe Editor
|
||||
- Migration from other platforms
|
||||
- Chowdown
|
||||
- Nextcloud Cookbook
|
||||
- Random meal plan generation
|
||||
|
||||
### Built With
|
||||
## FAQ
|
||||
|
||||
* [Vue.js](https://vuejs.org/)
|
||||
* [Vuetify](https://vuetifyjs.com/en/)
|
||||
* [FastAPI](https://fastapi.tiangolo.com/)
|
||||
* [MongoDB](https://www.mongodb.com/)
|
||||
* [Docker](https://www.docker.com/)
|
||||
### Why An API?
|
||||
An API allows integration into applications like [Home Assistant](https://www.home-assistant.io/) that can act as notification engines to provide custom notifications based of Meal Plan data to remind you to defrost the chicken, marinade the steak, or start the CrockPot. Additionally, you can access nearly any backend service via the API giving you total control to extend the application. To explore the API spin up your server and navigate to http://yourserver.com/docs for interactive API documentation.
|
||||
|
||||
### Why a Database?
|
||||
Some users of static-site generator applications like ChowDown have expressed concerns about their data being stuck in a database. Considering this is a new project it is a valid concern to be worried about your data. Mealie specifically addresses this concern by provided automatic daily backups that export your data in json, plain-text markdown files, and/or custom Jinja2 templates. **This puts you in controls of how your data is represented** when exported from Mealie, which means you can easily migrate to any other service provided Mealie doesn't work for you.
|
||||
|
||||
As to why we need a database?
|
||||
|
||||
- **Developer Experience:** Without a database a lot of the work to maintain your data is taken on by the developer instead of a battle tested platform for storing data.
|
||||
- **Multi User Support:** With a solid database as backend storage for your data Mealie can better support multi-user sites and avoid read/write access errors when multiple actions are taken at the same time.
|
||||
|
||||
|
||||
<!-- CONTRIBUTING -->
|
||||
## Contributing
|
||||
|
||||
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. Especially test. Literally any tests. See the [Contributors Guide](https://hay-kot.github.io/mealie/contributors/developers-guide/code-contributions/) for help getting started.
|
||||
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. Especially test. Literally any tests. See the [Contributors Guide](https://hay-kot.github.io/mealie/contributors/non-coders/) for help getting started.
|
||||
|
||||
If you are not a coder, you can still contribute financially. financial contributions help me prioritize working on this project over others and helps me know that there is a real demand for project development.
|
||||
|
||||
<a href="https://www.buymeacoffee.com/haykot" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-green.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
|
||||
<a href="https://www.buymeacoffee.com/haykot" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-green.png" alt="Buy Me A Coffee" style="height: 30px !important;width: 107px !important;" ></a>
|
||||
|
||||
<!-- LICENSE -->
|
||||
## License
|
||||
|
||||
Distributed under the MIT License. See `LICENSE` for more information.
|
||||
|
||||
|
||||
@@ -97,16 +113,6 @@ Project Link: [https://github.com/hay-kot/mealie](https://github.com/hay-kot/mea
|
||||
|
||||
|
||||
|
||||
<!-- ACKNOWLEDGEMENTS -->
|
||||
## Acknowledgements
|
||||
|
||||
* [Talk Python Training for helping me learn python](https://training.talkpython.fm/)
|
||||
* [Academind for helping me learn Javascript and Vue.js](https://academind.com/)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- MARKDOWN LINKS & IMAGES -->
|
||||
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
||||
[contributors-shield]: https://img.shields.io/github/contributors/hay-kot/mealie.svg?style=flat-square
|
||||
@@ -122,4 +128,4 @@ Project Link: [https://github.com/hay-kot/mealie](https://github.com/hay-kot/mea
|
||||
[license-url]: https://github.com/hay-kot/mealie/blob/master/LICENSE.txt
|
||||
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
|
||||
[linkedin-url]: https://linkedin.com/in/hay-kot
|
||||
[product-screenshot]: docs/docs/img/home_screenshot.png
|
||||
[product-screenshot]: docs/docs/assets/img/home_screenshot.png
|
||||
|
||||
6
crowdin.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
preserve_hierarchy: false
|
||||
files:
|
||||
- source: /frontend/src/locales/messages/en-US.json
|
||||
translation: /frontend/src/locales/messages/%locale%.json
|
||||
- source: /frontend/src/locales/dateTimeFormats/en-US.json
|
||||
translation: /frontend/src/locales/dateTimeFormats/%locale%.json
|
||||
@@ -1,19 +1,17 @@
|
||||
|
||||
|
||||

|
||||

|
||||
|
||||
# {{ recipe.name }}
|
||||
{{ recipe.description }}
|
||||
|
||||
## Ingredients
|
||||
{% for ingredient in recipe.recipeIngredient %}
|
||||
- [ ] {{ ingredient }}
|
||||
{% endfor %}
|
||||
{% for ingredient in recipe.recipeIngredient %}
|
||||
- [ ] {{ ingredient }} {% endfor %}
|
||||
|
||||
## Instructions
|
||||
{% for step in recipe.recipeInstructions %}
|
||||
- [ ] {{ step.text }}
|
||||
{% endfor %}
|
||||
{% for step in recipe.recipeInstructions %}
|
||||
- [ ] {{ step.text }} {% endfor %}
|
||||
|
||||
{% for note in recipe.notes %}
|
||||
**{{ note.title }}:** {{ note.text }}
|
||||
@@ -1,61 +0,0 @@
|
||||
# Getting A Developer Instance Started
|
||||
For the best experience developing I recommend using docker. I've used both WSL2 and Ubuntu to develop mealie and have had no issues with cross compatibility with docker. 2 Scripts are available along ith docker-compose files to make development instances easier. After cloning the repo you can set the scripts in /dev/scripts/ as executable and then use VSCode tasks to execute the scripts or execute them from the CLI.
|
||||
|
||||
`docker-compose.dev.sh` Will spin up a development stack with hot-reloading enabled.
|
||||
`docker-compose.sh` Will spin up a production version of the stack.
|
||||
|
||||
After the stack is running navigate to the [admin page localhost:9090/settings/site](http://localhost:9090/settings/site). On the Backups and Exports section import the backup labeled dev_sample_data_{DATE}.zip. This will give you some recipe data to work with.
|
||||
|
||||
Once you're up and running you should be able to make changes and see them reflected on the frontend/backend. If you're not sure what to work on you can check:
|
||||
|
||||
- The Todo's below.
|
||||
- The [Development Road Map](https://hay-kot.github.io/mealie/2.0%20-%20roadmap/)
|
||||
- The [Current Open Issues](https://github.com/hay-kot/mealie/issues)
|
||||
|
||||
Don't forget to [join the Discord](https://discord.gg/R6QDyJgbD2)!
|
||||
|
||||
# Todo's
|
||||
|
||||
Frontend
|
||||
- [x] .Vue file reorganized into something that makes sense
|
||||
- [ ] Recipe Print Page
|
||||
- [x] Catch 400 / bad response on create from URL
|
||||
- [ ] Recipe Editor Data Validation Client Side
|
||||
- [x] Favicon
|
||||
- [x] Rename Window
|
||||
- [x] Add version indicator and notification for new version available
|
||||
- [ ] Enhanced Search Functionality
|
||||
- [ ] Organize Home Page my Category, ideally user selectable.
|
||||
|
||||
Backend
|
||||
- [x] Add Debug folder for writing the last pulled recipe data to.
|
||||
- [x] Recipe Editor Data Validation Server Side
|
||||
- [ ] Normalize Recipe data on scrape
|
||||
- [ ] Support how to Sections and how to steps
|
||||
- [ ] Export Markdown on Auto backups
|
||||
- [ ] Recipe request by category/tags
|
||||
- [ ] Add Additional Migrations, See mealie/services/migrations/chowdown.py for examples of how to do this.
|
||||
- [ ] Open Eats [See Issue #4](https://github.com/hay-kot/mealie/issues/4)
|
||||
- [ ] NextCloud [See Issue #14](https://github.com/hay-kot/mealie/issues/14)
|
||||
|
||||
# Draft Changelog
|
||||
## v0.0.2
|
||||
|
||||
Bug Fixes
|
||||
- Fixed opacity issues with marked steps - [mtoohey31](https://github.com/mtoohey31)
|
||||
- Fixed hot-reloading development environment - [grssmnn](https://github.com/grssmnn)
|
||||
- Fixed recipe not saving without image
|
||||
- Fixed parsing error on image property null
|
||||
|
||||
General Improvements
|
||||
- Added Confirmation component to deleting recipes - [zackbcom](https://github.com/zackbcom)
|
||||
- Updated Theme backend - [zackbcom](https://github.com/zackbcom)
|
||||
- Added Persistent storage to vuex - [zackbcom](https://github.com/zackbcom)
|
||||
- General Color/Theme Improvements
|
||||
- More consistent UI
|
||||
- More minimalist coloring
|
||||
- Added API Key Extras to Recipe Data
|
||||
- Users can now add custom json key/value pairs to all recipes via the editor for access in 3rd part applications. For example users can add a "message" field in the extras that can be accessed on API calls to play a message over google home.
|
||||
- Improved image rendering (nearly x2 speed)
|
||||
- Improved documentation + API Documentation
|
||||
- Improved recipe parsing
|
||||
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
@@ -1,32 +0,0 @@
|
||||
import requests
|
||||
import json
|
||||
|
||||
POST_URL = "http://localhost:9921/api/recipe/create-url"
|
||||
URL_LIST = [
|
||||
"https://www.bonappetit.com/recipe/hallacas"
|
||||
"https://www.bonappetit.com/recipe/oat-and-pecan-brittle-cookies",
|
||||
"https://www.bonappetit.com/recipe/tequila-beer-and-citrus-cocktail",
|
||||
"https://www.bonappetit.com/recipe/corn-and-crab-beignets-with-yaji-aioli",
|
||||
"https://www.bonappetit.com/recipe/nan-e-berenji",
|
||||
"https://www.bonappetit.com/recipe/ginger-citrus-cookies",
|
||||
"https://www.bonappetit.com/recipe/chocolate-pizzettes-cookies",
|
||||
"https://www.bonappetit.com/recipe/swedish-glogg",
|
||||
"https://www.bonappetit.com/recipe/roasted-beets-with-dukkah-and-sage",
|
||||
"https://www.bonappetit.com/recipe/collard-greens-salad-with-pickled-fennel-and-coconut"
|
||||
"https://www.bonappetit.com/recipe/sparkling-wine-cocktail",
|
||||
"https://www.bonappetit.com/recipe/pretzel-and-potato-chip-moon-pies",
|
||||
"https://www.bonappetit.com/recipe/coffee-hazlenut-biscotti",
|
||||
"https://www.bonappetit.com/recipe/curry-cauliflower-rice",
|
||||
"https://www.bonappetit.com/recipe/life-of-the-party-layer-cake",
|
||||
"https://www.bonappetit.com/recipe/marranitos-enfiestados",
|
||||
]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
for url in URL_LIST:
|
||||
data = {"url": url}
|
||||
data = json.dumps(data)
|
||||
try:
|
||||
response = requests.post(POST_URL, data)
|
||||
except:
|
||||
continue
|
||||
@@ -1,40 +0,0 @@
|
||||
import json
|
||||
|
||||
import requests
|
||||
|
||||
POST_URL = "http://localhost:9921/api/site-settings/themes/create/"
|
||||
GET_URL = "http://localhost:9921/api/site-settings/themes/"
|
||||
|
||||
SITE_SETTINGS = [
|
||||
{
|
||||
"name": "default",
|
||||
"colors": {
|
||||
"primary": "#E58325",
|
||||
"accent": "#00457A",
|
||||
"secondary": "#973542",
|
||||
"success": "#5AB1BB",
|
||||
"info": "#FFFD99",
|
||||
"warning": "#FF4081",
|
||||
"error": "#EF5350",
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "purple",
|
||||
"colors": {
|
||||
"accent": "#4527A0",
|
||||
"primary": "#FF4081",
|
||||
"secondary": "#26C6DA",
|
||||
"success": "#4CAF50",
|
||||
"info": "#2196F3",
|
||||
"warning": "#FB8C00",
|
||||
"error": "#FF5252",
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
if __name__ == "__main__":
|
||||
for theme in SITE_SETTINGS:
|
||||
data = json.dumps(theme)
|
||||
response = requests.post(POST_URL, data)
|
||||
response = requests.get(GET_URL)
|
||||
print(response.text)
|
||||
44
dev/scripts/api_docs_gen.py
Normal file
@@ -0,0 +1,44 @@
|
||||
import json
|
||||
|
||||
from mealie.app import app
|
||||
from mealie.core.config import DATA_DIR
|
||||
|
||||
"""Script to export the ReDoc documentation page into a standalone HTML file."""
|
||||
|
||||
HTML_TEMPLATE = """<!-- Custom HTML site displayed as the Home chapter -->
|
||||
{% extends "main.html" %}
|
||||
{% block tabs %}
|
||||
{{ super() }}
|
||||
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div id="redoc-container"></div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js"> </script>
|
||||
<script>
|
||||
var spec = MY_SPECIFIC_TEXT;
|
||||
Redoc.init(spec, {}, document.getElementById("redoc-container"));
|
||||
</script>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% block content %}{% endblock %}
|
||||
{% block footer %}{% endblock %}
|
||||
"""
|
||||
|
||||
HTML_PATH = DATA_DIR.parent.parent.joinpath("docs/docs/overrides/api.html")
|
||||
|
||||
|
||||
def generate_api_docs(my_app):
|
||||
with open(HTML_PATH, "w") as fd:
|
||||
text = HTML_TEMPLATE.replace("MY_SPECIFIC_TEXT", json.dumps(my_app.openapi()))
|
||||
fd.write(text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
generate_api_docs(app)
|
||||
141
dev/scripts/app_routes_gen.py
Normal file
@@ -0,0 +1,141 @@
|
||||
import re
|
||||
from enum import Enum
|
||||
from itertools import groupby
|
||||
from pathlib import Path
|
||||
|
||||
import slugify
|
||||
from fastapi import FastAPI
|
||||
from humps import camelize
|
||||
from jinja2 import Template
|
||||
from mealie.app import app
|
||||
from pydantic import BaseModel
|
||||
|
||||
CWD = Path(__file__).parent
|
||||
OUT_DIR = CWD / "output"
|
||||
OUT_FILE = OUT_DIR / "app_routes.py"
|
||||
|
||||
JS_DIR = OUT_DIR / "javascriptAPI"
|
||||
JS_OUT_FILE = JS_DIR / "apiRoutes.js"
|
||||
TEMPLATES_DIR = CWD / "templates"
|
||||
|
||||
PYTEST_TEMPLATE = TEMPLATES_DIR / "pytest_routes.j2"
|
||||
JS_REQUESTS = TEMPLATES_DIR / "js_requests.j2"
|
||||
JS_ROUTES = TEMPLATES_DIR / "js_routes.j2"
|
||||
JS_INDEX = TEMPLATES_DIR / "js_index.j2"
|
||||
|
||||
JS_DIR.mkdir(exist_ok=True, parents=True)
|
||||
|
||||
|
||||
class RouteObject:
|
||||
def __init__(self, route_string) -> None:
|
||||
self.prefix = "/" + route_string.split("/")[1]
|
||||
self.route = "/" + route_string.split("/", 2)[2]
|
||||
self.js_route = self.route.replace("{", "${")
|
||||
self.parts = route_string.split("/")[1:]
|
||||
self.var = re.findall(r"\{(.*?)\}", route_string)
|
||||
self.is_function = "{" in self.route
|
||||
self.router_slug = slugify.slugify("_".join(self.parts[1:]), separator="_")
|
||||
self.router_camel = camelize(self.router_slug)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"""Route: {self.route}
|
||||
Parts: {self.parts}
|
||||
Function: {self.is_function}
|
||||
Var: {self.var}
|
||||
Slug: {self.router_slug}
|
||||
"""
|
||||
|
||||
|
||||
class RequestType(str, Enum):
|
||||
get = "get"
|
||||
put = "put"
|
||||
post = "post"
|
||||
patch = "patch"
|
||||
delete = "delete"
|
||||
|
||||
|
||||
class HTTPRequest(BaseModel):
|
||||
request_type: RequestType
|
||||
description: str = ""
|
||||
summary: str
|
||||
tags: list[str]
|
||||
|
||||
@property
|
||||
def summary_camel(self):
|
||||
return camelize(self.summary)
|
||||
|
||||
@property
|
||||
def js_docs(self):
|
||||
return self.description.replace("\n", " \n * ")
|
||||
|
||||
|
||||
class PathObject(BaseModel):
|
||||
route_object: RouteObject
|
||||
http_verbs: list[HTTPRequest]
|
||||
|
||||
class Config:
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
|
||||
def get_path_objects(app: FastAPI):
|
||||
paths = []
|
||||
|
||||
for key, value in app.openapi().items():
|
||||
if key == "paths":
|
||||
for key, value in value.items():
|
||||
|
||||
paths.append(
|
||||
PathObject(
|
||||
route_object=RouteObject(key),
|
||||
http_verbs=[HTTPRequest(request_type=k, **v) for k, v in value.items()],
|
||||
)
|
||||
)
|
||||
|
||||
return paths
|
||||
|
||||
|
||||
def read_template(file: Path):
|
||||
with open(file, "r") as f:
|
||||
return f.read()
|
||||
|
||||
|
||||
def generate_template(app):
|
||||
paths = get_path_objects(app)
|
||||
|
||||
static_paths = [x.route_object for x in paths if not x.route_object.is_function]
|
||||
function_paths = [x.route_object for x in paths if x.route_object.is_function]
|
||||
|
||||
static_paths.sort(key=lambda x: x.router_slug)
|
||||
function_paths.sort(key=lambda x: x.router_slug)
|
||||
|
||||
template = Template(read_template(PYTEST_TEMPLATE))
|
||||
content = template.render(paths={"prefix": "/api", "static_paths": static_paths, "function_paths": function_paths})
|
||||
with open(OUT_FILE, "w") as f:
|
||||
f.write(content)
|
||||
|
||||
template = Template(read_template(JS_ROUTES))
|
||||
content = template.render(
|
||||
paths={"prefix": "/api", "static_paths": static_paths, "function_paths": function_paths, "all_paths": paths}
|
||||
)
|
||||
with open(JS_OUT_FILE, "w") as f:
|
||||
f.write(content)
|
||||
|
||||
all_tags = []
|
||||
for k, g in groupby(paths, lambda x: x.http_verbs[0].tags[0]):
|
||||
template = Template(read_template(JS_REQUESTS))
|
||||
content = template.render(paths={"all_paths": list(g), "export_name": camelize(k)})
|
||||
|
||||
all_tags.append(camelize(k))
|
||||
|
||||
with open(JS_DIR.joinpath(camelize(k) + ".js"), "w") as f:
|
||||
f.write(content)
|
||||
|
||||
template = Template(read_template(JS_INDEX))
|
||||
content = template.render(files={"files": all_tags})
|
||||
|
||||
with open(JS_DIR.joinpath("index.js"), "w") as f:
|
||||
f.write(content)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
generate_template(app)
|
||||
@@ -1 +0,0 @@
|
||||
docker-compose -f docker-compose.dev.yml -p dev-mealie up --build
|
||||
@@ -1 +0,0 @@
|
||||
docker-compose -p mealie up --build
|
||||
156
dev/scripts/output/app_routes.py
Normal file
@@ -0,0 +1,156 @@
|
||||
# This Content is Auto Generated for Pytest
|
||||
|
||||
|
||||
class AppRoutes:
|
||||
def __init__(self) -> None:
|
||||
self.prefix = '/api'
|
||||
|
||||
self.about_events = "/api/about/events"
|
||||
self.about_events_notifications = "/api/about/events/notifications"
|
||||
self.about_events_notifications_test = "/api/about/events/notifications/test"
|
||||
self.about_recipes_defaults = "/api/about/recipes/defaults"
|
||||
self.auth_refresh = "/api/auth/refresh"
|
||||
self.auth_token = "/api/auth/token"
|
||||
self.auth_token_long = "/api/auth/token/long"
|
||||
self.backups_available = "/api/backups/available"
|
||||
self.backups_export_database = "/api/backups/export/database"
|
||||
self.backups_upload = "/api/backups/upload"
|
||||
self.categories = "/api/categories"
|
||||
self.categories_empty = "/api/categories/empty"
|
||||
self.debug = "/api/debug"
|
||||
self.debug_last_recipe_json = "/api/debug/last-recipe-json"
|
||||
self.debug_log = "/api/debug/log"
|
||||
self.debug_statistics = "/api/debug/statistics"
|
||||
self.debug_version = "/api/debug/version"
|
||||
self.groups = "/api/groups"
|
||||
self.groups_self = "/api/groups/self"
|
||||
self.meal_plans_all = "/api/meal-plans/all"
|
||||
self.meal_plans_create = "/api/meal-plans/create"
|
||||
self.meal_plans_this_week = "/api/meal-plans/this-week"
|
||||
self.meal_plans_today = "/api/meal-plans/today"
|
||||
self.meal_plans_today_image = "/api/meal-plans/today/image"
|
||||
self.migrations = "/api/migrations"
|
||||
self.recipes_category = "/api/recipes/category"
|
||||
self.recipes_create = "/api/recipes/create"
|
||||
self.recipes_create_from_zip = "/api/recipes/create-from-zip"
|
||||
self.recipes_create_url = "/api/recipes/create-url"
|
||||
self.recipes_summary = "/api/recipes/summary"
|
||||
self.recipes_summary_uncategorized = "/api/recipes/summary/uncategorized"
|
||||
self.recipes_summary_untagged = "/api/recipes/summary/untagged"
|
||||
self.recipes_tag = "/api/recipes/tag"
|
||||
self.recipes_test_scrape_url = "/api/recipes/test-scrape-url"
|
||||
self.shopping_lists = "/api/shopping-lists"
|
||||
self.site_settings = "/api/site-settings"
|
||||
self.site_settings_custom_pages = "/api/site-settings/custom-pages"
|
||||
self.site_settings_webhooks_test = "/api/site-settings/webhooks/test"
|
||||
self.tags = "/api/tags"
|
||||
self.tags_empty = "/api/tags/empty"
|
||||
self.themes = "/api/themes"
|
||||
self.themes_create = "/api/themes/create"
|
||||
self.users = "/api/users"
|
||||
self.users_api_tokens = "/api/users/api-tokens"
|
||||
self.users_self = "/api/users/self"
|
||||
self.users_sign_ups = "/api/users/sign-ups"
|
||||
self.utils_download = "/api/utils/download"
|
||||
|
||||
def about_events_id(self, id):
|
||||
return f"{self.prefix}/about/events/{id}"
|
||||
|
||||
def about_events_notifications_id(self, id):
|
||||
return f"{self.prefix}/about/events/notifications/{id}"
|
||||
|
||||
def backups_file_name_delete(self, file_name):
|
||||
return f"{self.prefix}/backups/{file_name}/delete"
|
||||
|
||||
def backups_file_name_download(self, file_name):
|
||||
return f"{self.prefix}/backups/{file_name}/download"
|
||||
|
||||
def backups_file_name_import(self, file_name):
|
||||
return f"{self.prefix}/backups/{file_name}/import"
|
||||
|
||||
def categories_category(self, category):
|
||||
return f"{self.prefix}/categories/{category}"
|
||||
|
||||
def debug_log_num(self, num):
|
||||
return f"{self.prefix}/debug/log/{num}"
|
||||
|
||||
def groups_id(self, id):
|
||||
return f"{self.prefix}/groups/{id}"
|
||||
|
||||
def meal_plans_id(self, id):
|
||||
return f"{self.prefix}/meal-plans/{id}"
|
||||
|
||||
def meal_plans_id_shopping_list(self, id):
|
||||
return f"{self.prefix}/meal-plans/{id}/shopping-list"
|
||||
|
||||
def meal_plans_plan_id(self, plan_id):
|
||||
return f"{self.prefix}/meal-plans/{plan_id}"
|
||||
|
||||
def media_recipes_recipe_slug_assets_file_name(self, recipe_slug, file_name):
|
||||
return f"{self.prefix}/media/recipes/{recipe_slug}/assets/{file_name}"
|
||||
|
||||
def media_recipes_recipe_slug_images_file_name(self, recipe_slug, file_name):
|
||||
return f"{self.prefix}/media/recipes/{recipe_slug}/images/{file_name}"
|
||||
|
||||
def migrations_import_type_file_name_delete(self, import_type, file_name):
|
||||
return f"{self.prefix}/migrations/{import_type}/{file_name}/delete"
|
||||
|
||||
def migrations_import_type_file_name_import(self, import_type, file_name):
|
||||
return f"{self.prefix}/migrations/{import_type}/{file_name}/import"
|
||||
|
||||
def migrations_import_type_upload(self, import_type):
|
||||
return f"{self.prefix}/migrations/{import_type}/upload"
|
||||
|
||||
def recipes_recipe_slug(self, recipe_slug):
|
||||
return f"{self.prefix}/recipes/{recipe_slug}"
|
||||
|
||||
def recipes_recipe_slug_assets(self, recipe_slug):
|
||||
return f"{self.prefix}/recipes/{recipe_slug}/assets"
|
||||
|
||||
def recipes_recipe_slug_image(self, recipe_slug):
|
||||
return f"{self.prefix}/recipes/{recipe_slug}/image"
|
||||
|
||||
def recipes_recipe_slug_zip(self, recipe_slug):
|
||||
return f"{self.prefix}/recipes/{recipe_slug}/zip"
|
||||
|
||||
def recipes_slug_comments(self, slug):
|
||||
return f"{self.prefix}/recipes/{slug}/comments"
|
||||
|
||||
def recipes_slug_comments_id(self, slug, id):
|
||||
return f"{self.prefix}/recipes/{slug}/comments/{id}"
|
||||
|
||||
def shopping_lists_id(self, id):
|
||||
return f"{self.prefix}/shopping-lists/{id}"
|
||||
|
||||
def site_settings_custom_pages_id(self, id):
|
||||
return f"{self.prefix}/site-settings/custom-pages/{id}"
|
||||
|
||||
def tags_tag(self, tag):
|
||||
return f"{self.prefix}/tags/{tag}"
|
||||
|
||||
def themes_id(self, id):
|
||||
return f"{self.prefix}/themes/{id}"
|
||||
|
||||
def users_api_tokens_token_id(self, token_id):
|
||||
return f"{self.prefix}/users/api-tokens/{token_id}"
|
||||
|
||||
def users_id(self, id):
|
||||
return f"{self.prefix}/users/{id}"
|
||||
|
||||
def users_id_favorites(self, id):
|
||||
return f"{self.prefix}/users/{id}/favorites"
|
||||
|
||||
def users_id_favorites_slug(self, id, slug):
|
||||
return f"{self.prefix}/users/{id}/favorites/{slug}"
|
||||
|
||||
def users_id_image(self, id):
|
||||
return f"{self.prefix}/users/{id}/image"
|
||||
|
||||
def users_id_password(self, id):
|
||||
return f"{self.prefix}/users/{id}/password"
|
||||
|
||||
def users_id_reset_password(self, id):
|
||||
return f"{self.prefix}/users/{id}/reset-password"
|
||||
|
||||
def users_sign_ups_token(self, token):
|
||||
return f"{self.prefix}/users/sign-ups/{token}"
|
||||
11
dev/scripts/publish-release-branch.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
git checkout dev
|
||||
git merge --strategy=ours master # keep the content of this branch, but record a merge
|
||||
git checkout master
|
||||
git merge dev # fast-forward master up to the merge
|
||||
|
||||
|
||||
## TODOs
|
||||
|
||||
# Create New Branch v0.x.x
|
||||
# Push Branch Version to Github
|
||||
# Create Pull Request
|
||||
@@ -1,18 +0,0 @@
|
||||
"""
|
||||
Helper script to download raw recipe data from a URL and dump it to disk.
|
||||
The resulting files can be used as test input data.
|
||||
"""
|
||||
|
||||
import sys, json
|
||||
from scrape_schema_recipe import scrape_url
|
||||
|
||||
for url in sys.argv[1:]:
|
||||
try:
|
||||
data = scrape_url(url)[0]
|
||||
slug = list(filter(None, url.split("/")))[-1]
|
||||
filename = f"{slug}.json"
|
||||
with open(filename, "w") as f:
|
||||
json.dump(data, f, indent=4, default=str)
|
||||
print(f"Saved {filename}")
|
||||
except Exception as e:
|
||||
print(f"Error for {url}: {e}")
|
||||
@@ -1,17 +0,0 @@
|
||||
$CWD = Get-Location
|
||||
|
||||
$pyFolder = Join-Path -Path $CWD -ChildPath "mealie"
|
||||
$pyVenv = Join-Path -Path $CWD -ChildPath "/venv/Scripts/python.exe"
|
||||
$pyScript = Join-Path -Path $CWD -ChildPath "/mealie/app.py"
|
||||
|
||||
$pythonCommand = "powershell.exe -NoExit -Command $pyVenv $pyScript"
|
||||
|
||||
$vuePath = Join-Path -Path $CWD -ChildPath "/frontend"
|
||||
$npmCommand = "powershell.exe -NoExit -Command npm run serve"
|
||||
|
||||
wt -d $pyFolder "powershell.exe" $pythonCommand `; split-pane -d $vuePath "powershell.exe" $npmCommand
|
||||
|
||||
Start-Process chrome "http://127.0.0.1:8000/docs"
|
||||
Start-Process chrome "http://127.0.0.1:8080
|
||||
"
|
||||
|
||||
7
dev/scripts/templates/js_index.j2
Normal file
@@ -0,0 +1,7 @@
|
||||
{% for api in files.files %}
|
||||
import { {{ api }}API } from "./{{api}}.js" {% endfor %}
|
||||
|
||||
export const api = {
|
||||
{% for api in files.files %}
|
||||
{{api}}: {{api}}API, {% endfor %}
|
||||
}
|
||||
19
dev/scripts/templates/js_requests.j2
Normal file
@@ -0,0 +1,19 @@
|
||||
// This Content is Auto Generated
|
||||
import { API_ROUTES } from "./apiRoutes"
|
||||
|
||||
export const {{paths.export_name}}API = { {% for path in paths.all_paths %} {% for verb in path.http_verbs %} {% if path.route_object.is_function %}
|
||||
/** {{ verb.js_docs }} {% for v in path.route_object.var %}
|
||||
* @param {{ v }} {% endfor %}
|
||||
*/
|
||||
{{ verb.summary_camel }}({{path.route_object.var|join(", ")}}) {
|
||||
const response = await apiReq.{{ verb.request_type.value }}(API_ROUTES.{{ path.route_object.router_camel }}({{path.route_object.var|join(", ")}}))
|
||||
return response.data
|
||||
}, {% else %}
|
||||
/** {{ verb.js_docs }} {% for v in path.route_object.var %}
|
||||
* @param {{ v }} {% endfor %}
|
||||
*/
|
||||
{{ verb.summary_camel }}() {
|
||||
const response = await apiReq.{{ verb.request_type.value }}(API_ROUTES.{{ path.route_object.router_camel }})
|
||||
return response.data
|
||||
},{% endif %} {% endfor %} {% endfor %}
|
||||
}
|
||||
7
dev/scripts/templates/js_routes.j2
Normal file
@@ -0,0 +1,7 @@
|
||||
// This Content is Auto Generated
|
||||
const prefix = '{{paths.prefix}}'
|
||||
export const API_ROUTES = { {% for path in paths.static_paths %}
|
||||
{{ path.router_camel }}: `${prefix}{{ path.route }}`,{% endfor %}
|
||||
{% for path in paths.function_paths %}
|
||||
{{path.router_camel}}: ({{path.var|join(", ")}}) => `${prefix}{{ path.js_route }}`,{% endfor %}
|
||||
}
|
||||
12
dev/scripts/templates/pytest_routes.j2
Normal file
@@ -0,0 +1,12 @@
|
||||
# This Content is Auto Generated for Pytest
|
||||
|
||||
|
||||
class AppRoutes:
|
||||
def __init__(self) -> None:
|
||||
self.prefix = '{{paths.prefix}}'
|
||||
{% for path in paths.static_paths %}
|
||||
self.{{ path.router_slug }} = "{{path.prefix}}{{ path.route }}"{% endfor %}
|
||||
{% for path in paths.function_paths %}
|
||||
def {{path.router_slug}}(self, {{path.var|join(", ")}}):
|
||||
return f"{self.prefix}{{ path.route }}"
|
||||
{% endfor %}
|
||||
@@ -3,6 +3,7 @@ version: "3.1"
|
||||
services:
|
||||
# Vue Frontend
|
||||
mealie-frontend:
|
||||
container_name: mealie-frontend
|
||||
image: mealie-frontend:dev
|
||||
build:
|
||||
context: ./frontend
|
||||
@@ -18,39 +19,27 @@ services:
|
||||
|
||||
# Fast API
|
||||
mealie-api:
|
||||
container_name: mealie-api
|
||||
image: mealie-api:dev
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile.dev
|
||||
target: development
|
||||
dockerfile: Dockerfile
|
||||
restart: always
|
||||
ports:
|
||||
- 9921:9000
|
||||
environment:
|
||||
TZ: America/Anchorage # Specify Correct Timezone for Date/Time to line up correctly.
|
||||
db_username: root
|
||||
db_password: example
|
||||
db_host: mongo
|
||||
db_port: 27017
|
||||
volumes:
|
||||
- ./mealie:/app
|
||||
- ./dev/data:/app/dev/data
|
||||
- ./mealie:/app/mealie
|
||||
|
||||
# Database
|
||||
mongo:
|
||||
image: mongo
|
||||
# Mkdocs
|
||||
mealie-docs:
|
||||
container_name: mealie-docs
|
||||
image: squidfunk/mkdocs-material
|
||||
restart: always
|
||||
ports:
|
||||
- 9923:27017
|
||||
environment:
|
||||
TZ: America/Anchorage # Specify Correct Timezone for Date/Time to line up correctly.
|
||||
MONGO_INITDB_ROOT_USERNAME: root
|
||||
MONGO_INITDB_ROOT_PASSWORD: example
|
||||
|
||||
# Database UI
|
||||
mongo-express:
|
||||
image: mongo-express
|
||||
restart: always
|
||||
ports:
|
||||
- 9922:8081
|
||||
environment:
|
||||
ME_CONFIG_MONGODB_ADMINUSERNAME: root
|
||||
ME_CONFIG_MONGODB_ADMINPASSWORD: example
|
||||
- 9922:8000
|
||||
volumes:
|
||||
- ./docs:/docs
|
||||
|
||||
@@ -1,33 +1,30 @@
|
||||
# Use root/example as user/password credentials
|
||||
# Frontend/Backend Served via the same Uvicorn Server
|
||||
version: "3.1"
|
||||
services:
|
||||
mealie:
|
||||
build:
|
||||
context: ./
|
||||
target: production
|
||||
dockerfile: Dockerfile
|
||||
container_name: mealie
|
||||
restart: always
|
||||
depends_on:
|
||||
- "postgres"
|
||||
ports:
|
||||
- 9090:9000
|
||||
- 9090:80
|
||||
environment:
|
||||
db_username: root
|
||||
db_password: example
|
||||
db_host: mongo
|
||||
db_port: 27017
|
||||
volumes:
|
||||
- ./mealie/data/:/app/data
|
||||
mongo:
|
||||
image: mongo
|
||||
DB_ENGINE: postgres # Optional: 'sqlite', 'postgres'
|
||||
POSTGRES_USER: mealie
|
||||
POSTGRES_PASSWORD: mealie
|
||||
POSTGRES_SERVER: postgres
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_DB: mealie
|
||||
# WORKERS_PER_CORE: 0.5
|
||||
# MAX_WORKERS: 8
|
||||
WEB_CONCURRENCY: 2
|
||||
postgres:
|
||||
container_name: postgres
|
||||
image: postgres
|
||||
restart: always
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: root
|
||||
MONGO_INITDB_ROOT_PASSWORD: example
|
||||
mongo-express: # Optional Mongo GUI
|
||||
image: mongo-express
|
||||
restart: always
|
||||
ports:
|
||||
- 9091:8081
|
||||
environment:
|
||||
ME_CONFIG_MONGODB_ADMINUSERNAME: root
|
||||
ME_CONFIG_MONGODB_ADMINPASSWORD: example
|
||||
POSTGRES_PASSWORD: mealie
|
||||
POSTGRES_USER: mealie
|
||||
|
||||
15
docs/Caddyfile
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
auto_https off
|
||||
}
|
||||
|
||||
:80 {
|
||||
root * /srv
|
||||
encode gzip
|
||||
uri strip_suffix /
|
||||
|
||||
handle {
|
||||
try_files {path} {path}/ /index.html
|
||||
file_server
|
||||
}
|
||||
|
||||
}
|
||||
10
docs/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM python:3.8-slim as build-stage
|
||||
WORKDIR /app
|
||||
RUN pip install --no-cache-dir mkdocs mkdocs-material
|
||||
COPY . .
|
||||
RUN mkdocs build
|
||||
|
||||
FROM caddy:alpine
|
||||
WORKDIR /app
|
||||
COPY ./Caddyfile /etc/caddy/Caddyfile
|
||||
COPY --from=build-stage /app/site /srv
|
||||
11
docs/docker-compose.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
version: "3"
|
||||
services:
|
||||
wiki:
|
||||
container_name: mealie-docs
|
||||
image: mealie-docs
|
||||
ports:
|
||||
- 8888:80
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
restart: always
|
||||
@@ -1,14 +0,0 @@
|
||||
# Usage
|
||||
|
||||
## Key Components
|
||||
### Recipe Extras
|
||||
Recipes extras are a key feature of the Mealie API. They allow you to create custom json key/value pairs within a recipe to reference from 3rd part applications. You can use these keys to contain information to trigger automation or custom messages to relay to your desired device.
|
||||
|
||||
For example you could add `{"message": "Remember to thaw the chicken"}` to a recipe and use the webhooks built into mealie to send that message payload to a destination to be processed.
|
||||
|
||||

|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
Have Ideas? Submit a PR!
|
||||
4
docs/docs/api/redoc.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: API
|
||||
template: api.html
|
||||
---
|
||||
|
Before Width: | Height: | Size: 14 MiB After Width: | Height: | Size: 11 MiB |
|
Before Width: | Height: | Size: 14 MiB After Width: | Height: | Size: 14 MiB |
BIN
docs/docs/assets/gifs/backup-demo-v1.gif
Normal file
|
After Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 2.9 MiB |
BIN
docs/docs/assets/gifs/create-custom-page-demo.gif
Normal file
|
After Width: | Height: | Size: 2.1 MiB |
BIN
docs/docs/assets/gifs/homepage-settings-v1.gif
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
BIN
docs/docs/assets/gifs/meal-planner-demoV3.gif
Normal file
|
After Width: | Height: | Size: 5.4 MiB |
BIN
docs/docs/assets/gifs/theme-demo-v3.gif
Normal file
|
After Width: | Height: | Size: 4.6 MiB |
BIN
docs/docs/assets/img/Toolbox-Categories.webp
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
docs/docs/assets/img/Toolbox-Organize.webp
Normal file
|
After Width: | Height: | Size: 334 KiB |
BIN
docs/docs/assets/img/add-notification.webp
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
docs/docs/assets/img/add-user.webp
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
docs/docs/assets/img/admin-backup.webp
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
docs/docs/assets/img/api-key-image-v1.webp
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
docs/docs/assets/img/custom-page.webp
Normal file
|
After Width: | Height: | Size: 187 KiB |
BIN
docs/docs/assets/img/dashboard.webp
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
docs/docs/assets/img/discord-notification-example.webp
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
docs/docs/assets/img/edit-recipe.webp
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
docs/docs/assets/img/favicon.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
docs/docs/assets/img/gotify-notification-example.webp
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docs/docs/assets/img/group-manager.png
Normal file
|
After Width: | Height: | Size: 619 KiB |
BIN
docs/docs/assets/img/home-assistant-card.png
Normal file
|
After Width: | Height: | Size: 802 KiB |
BIN
docs/docs/assets/img/home_screenshot.png
Executable file
|
After Width: | Height: | Size: 533 KiB |
BIN
docs/docs/assets/img/ios-shortcut-image.jpg
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
docs/docs/assets/img/iphone-image.png
Normal file
|
After Width: | Height: | Size: 350 KiB |
BIN
docs/docs/assets/img/mealie-diagram.webp
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
docs/docs/assets/img/sign-up-links.webp
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
docs/docs/assets/img/site-settings.webp
Normal file
|
After Width: | Height: | Size: 71 KiB |
11
docs/docs/assets/js/extra.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/* Add target="_blank" to external links */
|
||||
/* Source: https://html.com/attributes/a-target/#:~:text=browser */
|
||||
function externalLinks() {
|
||||
for (var c = document.getElementsByTagName("a"), a = 0; a < c.length; a++) {
|
||||
var b = c[a];
|
||||
b.getAttribute("href") &&
|
||||
b.hostname !== location.hostname &&
|
||||
(b.target = "_blank");
|
||||
}
|
||||
}
|
||||
externalLinks();
|
||||
53
docs/docs/assets/stylesheets/custom.css
Normal file
@@ -0,0 +1,53 @@
|
||||
[data-md-color-scheme="mealie"] {
|
||||
--md-primary-fg-color: #e58325;
|
||||
--md-primary-fg-color--light: #e58325;
|
||||
--md-accent-fg-color: #e58325;
|
||||
--md-custom-h2-color: #333;
|
||||
--md-accent-fg-color--light: #e58325;
|
||||
--md-default-accent-bg-color: #f7fafc;
|
||||
}
|
||||
|
||||
[data-md-color-scheme="slate"] {
|
||||
--md-primary-fg-color: #e58325;
|
||||
--md-primary-fg-color--dark: #e58325;
|
||||
--md-accent-fg-color: #e58325;
|
||||
--md-accent-fg-color--dark: #e58325;
|
||||
--md-custom-h2-color: rgb(167, 167, 167);
|
||||
--md-default-bg-color: #1a1b1b;
|
||||
--md-default-accent-bg-color: #1f1e1e;
|
||||
}
|
||||
|
||||
/* frontpage elements */
|
||||
.tx-hero h1 {
|
||||
font-size: 2.41rem !important;
|
||||
}
|
||||
a.md-button.md-button--primary {
|
||||
background-color: var(--md-accent-fg-color);
|
||||
border-color: var(--md-accent-fg-color);
|
||||
color: #ffffff;
|
||||
}
|
||||
a.md-button.md-button--primary:hover {
|
||||
color: #000000;
|
||||
}
|
||||
a.md-button.md-button:hover {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* Add icon after external links */
|
||||
/* Ignore auto-generated material theme links */
|
||||
a[target="_blank"]:not([class*="md-"]):after {
|
||||
content: " " url("../svg/open-in-new.svg");
|
||||
}
|
||||
|
||||
/* Site width etc.*/
|
||||
.md-grid {
|
||||
max-width: 64rem !important;
|
||||
}
|
||||
|
||||
.md-typeset table:not([class]) th {
|
||||
background-color: #e58325;
|
||||
}
|
||||
|
||||
th {
|
||||
font-weight: bold;
|
||||
}
|
||||
3
docs/docs/assets/svg/open-in-new.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24">
|
||||
<path fill="rgb(229,131,37)" d="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 259 B |
30
docs/docs/changelog/.template.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# vx.x.x COOL TITLE GOES HERE
|
||||
|
||||
**App Version: vx.x.x**
|
||||
|
||||
**Database Version: vx.x.x**
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
|
||||
#### Database
|
||||
|
||||
#### ENV Variables
|
||||
|
||||
|
||||
## Bug Fixes
|
||||
- Fixed ...
|
||||
|
||||
## Features and Improvements
|
||||
|
||||
### General
|
||||
- New Thing 1
|
||||
|
||||
|
||||
### UI Improvements
|
||||
-
|
||||
|
||||
|
||||
### Behind the Scenes
|
||||
- Refactoring...
|
||||
@@ -1,13 +1,44 @@
|
||||
# Release Notes
|
||||
# v0.1.0 - Initial Beta
|
||||
|
||||
### Bug Fixes
|
||||
- Fixed Can't delete recipe after changing name - Closes Closes #67
|
||||
- Fixed No image when added by URL, and can't add an image - Closes Closes #66
|
||||
- Fixed Images saved with no way to delete when add recipe via URL fails - Closes Closes #43
|
||||
|
||||
### Features
|
||||
- Additional Language Support
|
||||
- Improved deployment documentation
|
||||
- Additional database! SQlite is now supported! - Closes #48
|
||||
- All site data is now backed up.
|
||||
- Support for Prep Time, Total Time, and Cook Time field - Closes #63
|
||||
- New backup import process with support for themes and site settings
|
||||
- **BETA** ARM support! - Closes #69
|
||||
|
||||
### Code / Developer Improvements
|
||||
- Unified Database Access Layers
|
||||
- Poetry / pyproject.toml support over requirements.txt
|
||||
- Local development without database is now possible!
|
||||
- Local mkdocs server added to docker-compose.dev.yml
|
||||
- Major code refactoring to support new database layer
|
||||
- Global variable refactor
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- Internal docker port is now 80 instead of 9000. You MUST remap the internal port to connect to the UI.
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
As I've adopted the SQL database model I find that using 2 different types of databases will inevitably hinder development. As such after release v0.1.0 support for mongoDB will no longer be available. Prior to upgrading to v0.2.0 you will need to export your site and import after updating. This should be a painless process and require minimal intervention on the users part. Moving forward we will do our best to minimize changes that require user intervention like this and make updates a smooth process.
|
||||
|
||||
|
||||
## v0.0.2 - Pre-release Second Patch
|
||||
A quality update with major props to [zackbcom](https://github.com/zackbcom) for working hard on making the theming just that much better!
|
||||
|
||||
### Bug Fixes
|
||||
- Fixed empty backup failure without markdown template
|
||||
- Fixed opacity issues with marked steps - [mtoohey31](https://github.com/mtoohey31)
|
||||
- Fixed hot-reloading development environment - [grssmnn](https://github.com/grssmnn)
|
||||
- Fixed recipe not saving without image
|
||||
- Fixed parsing error on image property null
|
||||
- Fixed recipe not saving without image - Closes #7 + Closes #54
|
||||
- Fixed parsing error on image property null - Closes #43
|
||||
|
||||
### General Improvements
|
||||
- Added Confirmation component to deleting recipes - [zackbcom](https://github.com/zackbcom)
|
||||
@@ -20,7 +51,7 @@ A quality update with major props to [zackbcom](https://github.com/zackbcom) for
|
||||
- Users can now add custom json key/value pairs to all recipes via the editor for access in 3rd part applications. For example users can add a "message" field in the extras that can be accessed on API calls to play a message over google home.
|
||||
- Improved image rendering (nearly x2 speed)
|
||||
- Improved documentation + API Documentation
|
||||
- Improved recipe parsing
|
||||
- Improved recipe parsing - Closes #51
|
||||
- User feedback on backup importing
|
||||
|
||||
## v0.0.1 - Pre-release Patch
|
||||
@@ -31,8 +62,8 @@ A quality update with major props to [zackbcom](https://github.com/zackbcom) for
|
||||
|
||||
### Recipes
|
||||
- Added user feedback on bad URL
|
||||
- Better backend data validation for updating recipes, avoid small syntax errors corrupting database entry. [Issue #8](https://github.com/hay-kot/mealie/issues/8)
|
||||
- Fixed spacing issue while editing new recipes in JSON
|
||||
- Better backend data validation for updating recipes, avoid small syntax errors corrupting database entry. [Closes #8](https://github.com/hay-kot/mealie/issues/8)
|
||||
- Fixed spacing Closes while editing new recipes in JSON
|
||||
|
||||
## v0.0.0 - Initial Pre-release
|
||||
The initial pre-release. It should be semi-functional but does not include a lot of user feedback You may notice errors that have no user feedback and have no idea what went wrong.
|
||||
72
docs/docs/changelog/v0.2.0.md
Normal file
@@ -0,0 +1,72 @@
|
||||
# v0.2.1 - Hot Fixes!
|
||||
|
||||
### Features and Improvements
|
||||
- Fixes upload image error when no photo was scrapped
|
||||
- Fixes no last_recipe.json not updating
|
||||
- Added markdown rendering for notes
|
||||
- New notifications
|
||||
- Minor UI improvements
|
||||
- Recipe editor refactor
|
||||
- Settings/Theme models refactor
|
||||
|
||||
### Development / Misc
|
||||
- Added async file response for images, downloading files.
|
||||
- Breakup recipe view component
|
||||
|
||||
# v0.2.0 - Now with Test!
|
||||
This is, what I think, is a big release! Tons of new features and some great quality of life improvements with some additional features. You may find that I made promises to include some fixes/features in v0.2.0. The short of is I greatly underestimated the work needed to refactor the database to a usable state and integrate categories in a way that is useful for users. This shouldn't be taken as a sign that I'm dropping those feature requests or ignoring them. I felt it was better to push a release in the current state rather than drag on development to try and fulfil all of the promises I made.
|
||||
|
||||
!!! warning "Upgrade Process"
|
||||
Database Breaks! I have not yet implemented a database migration service. As such, upgrades cannot be done by simply pulling the image. You must first export your recipes, update your deployment, and then import your recipes. This pattern is likely to be how upgrades take place prior to v1.0. After v1.0 migrations will be done automatically.
|
||||
|
||||
### Bug Fixes
|
||||
- Remove ability to save recipe with no name
|
||||
- Fixed data validation error on missing parameters
|
||||
- Fixed failed database initialization at startup - Closes #98
|
||||
- Fixed misaligned text on various cards
|
||||
- Fixed bug that blocked opening links in new tabs - Closes #122
|
||||
- Fixed router link bugs - Closes #122
|
||||
- Fixed navigation on keyboard selection - Closes #139
|
||||
|
||||
### Features and Improvements
|
||||
- 🐳 Dockerfile now 1/5 of the size!
|
||||
- 🌎 UI Language Selection + Additional Supported Language
|
||||
- **Home Page**
|
||||
- By default your homepage will display only the recently added recipes. You can configured sections to show on the home-screen based of categories on the settings page.
|
||||
- A new sidebar is now shown on the main page that lists all the categories in the database. Clicking on them navigates into a page that shows only recipes.
|
||||
- Basic Sort functionality has been added. More options are on the way!
|
||||
- **Meal Planner**
|
||||
- Improved Search (Fuzzy Search)
|
||||
- New Scheduled card support
|
||||
- **Recipe Editor**
|
||||
- Ingredients are now sortable via drag-and-drop
|
||||
- Known categories now show up in the dropdown - Closes 83
|
||||
- Initial code for data validation to prevent errors
|
||||
- **Migrations**
|
||||
- Card based redesign
|
||||
- Upload from the UI
|
||||
- Unified Chowdown / Nextcloud import process. (Removed Git as a dependency)
|
||||
- **API**
|
||||
- Category and Tag endpoints added
|
||||
- Major Endpoint refactor
|
||||
- Improved API documentation
|
||||
- Link to your Local API is now on your `/settings/site`. You can use it to explore your API.
|
||||
|
||||
- **Style**
|
||||
- Continued work on button/style unification
|
||||
- Adding icons to buttons
|
||||
- New Color Theme Picker UI
|
||||
|
||||
### Development
|
||||
- Fixed Vetur config file. Autocomplete in VSCode works!
|
||||
- File/Folder restructuring
|
||||
- Added Prettier config
|
||||
- Fixed incorrect layout code
|
||||
- FastAPI Route tests for major operations - WIP (shallow testing)
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
- API endpoints have been refactored to adhear to a more consistent standard. This is a WIP and more changes are likely to occur.
|
||||
- Officially Dropped MongoDB Support
|
||||
- Database Breaks! We have not yet implemented a database migration service. As such, upgrades cannot be done by simply pulling the image. You must first export your recipes, update your deployment, and then import your recipes. This pattern is likely to be how upgrades take place prior to v1.0. After v1.0 migrations will be done automatically.
|
||||
29
docs/docs/changelog/v0.3.0.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# v0.3.0
|
||||
|
||||
### Bug Fixes
|
||||
- Fixed open search on `/` when in input. - Closes #174
|
||||
- Error when importing recipe: KeyError: '@type' - Closes #145
|
||||
- Fixed Import Issue - bhg.com - Closes #138
|
||||
- Scraper not working with recipe containing HowToSection - Closes #73
|
||||
|
||||
### Features and Improvements
|
||||
- Improved Nextcloud Imports
|
||||
- Improved Recipe Parser!
|
||||
- Open search with `/` hotkey!
|
||||
- Database and App version are now split
|
||||
- Unified and improved snackbar notifications
|
||||
- New Category/Tag endpoints to filter all recipes by Category or Tag
|
||||
- Category sidebar now has show/hide behavior on mobile
|
||||
- Settings menu on mobile is improved
|
||||
- **Meal Planner**
|
||||
- You can now restrict recipe categories used for random meal-plan creation in the settings menu
|
||||
- Recipe picker dialog will now display recipes when the search bar is empty
|
||||
- Minor UI improvements
|
||||
- **Shopping lists!** Shopping list can now be generated from a meal plan. Currently ingredients are split by recipes or there is a beta feature that attempts to sort them by similarity.
|
||||
- **Recipe Viewer**
|
||||
- Categories, Tags, and Notes will now be displayed below the steps on smaller screens
|
||||
- **Recipe Editor**
|
||||
- Text areas now auto grow to fit content
|
||||
- Description, Steps, and Notes support Markdown! This includes inline html in Markdown.
|
||||
- **Imports**
|
||||
- A revamped dialog has been created to provide more information on restoring backups. Exceptions on the backend are now sent to the frontend and are easily viewable to see what went wrong when you restored a backup. This functionality will be ported over to the migrations in a future release.
|
||||
86
docs/docs/changelog/v0.4.0.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# v0.4.0 Whoa, What a Release!
|
||||
|
||||
**App Version: v0.4.0**
|
||||
|
||||
**Database Version: v0.4.0**
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
|
||||
#### Database
|
||||
A new database will be created. You must export your data and then import it after upgrading.
|
||||
|
||||
#### Site Settings
|
||||
With the addition of group settings and a re-write of the database layer of the application backend, there is no migration path for your current site settings. Webhooks Settings, Meal Plan Categories are now managed by groups. Site settings, mainly homepage settings, are now site specific and managed by administrators. When upgrading be sure to uncheck the settings when importing your old data.
|
||||
|
||||
#### ENV Variables
|
||||
Names have been changed to be more consistent with industry standards. See the [Installation Page](/mealie/getting-started/install/) for new parameters.
|
||||
|
||||
## Bug Fixes
|
||||
- Fixed Search Results Limited to 100 - #198
|
||||
- Fixed recipes from marmiton.org not fully scrapped - #196
|
||||
- Fixed Unable to get a page to load - #194
|
||||
- Fixed Recipe's from Epicurious don't upload. - #193
|
||||
- Fixed Edited blank recipe in meal plan is not saved - #184
|
||||
- Fixed Create a new meal plan allows selection of an end date that is prior to the start date - #183
|
||||
- Fixed Original URL not saved to imported recipe in 0.3.0-dev - #183
|
||||
- Fixed "IndexError: list index out of range" when viewing shopping list for meal plan containing days without a recipe selected - #178
|
||||
|
||||
## Features and Improvements
|
||||
|
||||
### General
|
||||
- Documentation Rewrite
|
||||
- [New Demo Site!](https://mealie-demo.hay-kot.dev/)
|
||||
- New Documentation
|
||||
- Landing Page
|
||||
- Custom Caddy Configuration
|
||||
- User Management
|
||||
- Introduction
|
||||
- Updated Documentation
|
||||
- Everything!
|
||||
- The API Reference is now better embedded inside of the docs
|
||||
- New default external port in documentation (Port 9000 -> 9925). This is only the port exposed by the host to the docker image. It doesn't change any existing functionality.
|
||||
|
||||
### User Authentication
|
||||
- Authentication! Tons of stuff went into creating a flexible authentication platform for a lot of different use cases. Review the documentation for more information on how to use the authentication, and how everything works together. More complex management of recipes and user restrictions are in the works, but this is a great start! Some key features include
|
||||
- Sign Up Links
|
||||
- Admin and User Roles
|
||||
- Password Change
|
||||
- Group Management
|
||||
- Create/Edit/Delete Restrictions
|
||||
|
||||
### Custom Pages
|
||||
- You can now create custom pages that are displayed on the homepage sidebar to organize categories of recipes into pages. For example, if you have several categories that encompass "Entrée" you can group all those categories together under the "Entrée" page. See [Building Pages](/mealie/site-administration/building-pages/) for more information.
|
||||
!!! tip
|
||||
Note that this replaces the behavior of automatically adding categories to the sidebar.
|
||||
|
||||
### UI Improvements
|
||||
- Completed Redesign of the Admin Panel
|
||||
- Profile Pages
|
||||
- Side Panel Menu
|
||||
- Improved UI for Recipe Search
|
||||
- Language selector is now displayed on all pages and does not require an account
|
||||
|
||||
### Recipe Data
|
||||
- Recipe Database Refactoring. Tons of new information is now stored for recipes in the database. Not all is accessible via the UI, but it's coming.
|
||||
- Nutrition Information
|
||||
- calories
|
||||
- fatContent
|
||||
- fiberContent
|
||||
- proteinContent
|
||||
- sodiumContent
|
||||
- sugarContent
|
||||
- recipeCuisine has been added
|
||||
- "categories" has been migrated to "recipeCategory" to adhere closer to the standard schema
|
||||
- "tool" - a list of tools used for the recipe
|
||||
|
||||
### Behind the Scenes
|
||||
- Removed CDN dependencies
|
||||
- Database Model Refactoring
|
||||
- Import/Export refactoring
|
||||
- File/Folder Name Refactoring
|
||||
- Development is now easier with a makefile
|
||||
- Mealie is now a proper package using poetry
|
||||
- Test refactoring
|
||||
- Test Coverage 83% up from 75%!
|
||||
35
docs/docs/changelog/v0.4.1.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# v0.4.1
|
||||
|
||||
**App Version: v0.4.1**
|
||||
|
||||
**Database Version: v0.4.0**
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
|
||||
#### Recipe Images
|
||||
While it *shouldn't* be a breaking change, I feel it is important to note that you may experience issues with the new image migration. Recipe images are now minified, this is done on start-up, import, migration, and when a new recipe is created. The initial boot or load may be a bit slow if you have lots of recipes but you likely won't notice. What you may notice is that if your recipe slug and the image name do not match, you will encounter issues with your images showing up. This can be resolved by finding the image directory and rename it to the appropriate slug. I did fix multiple edge cases, but it is likely more exists. As always make a backup before you update!
|
||||
|
||||
On the plus side, this comes with a huge performance increase! 🎉
|
||||
|
||||
- Add markdown support for ingredients - Resolves #32
|
||||
- Ingredients editor improvements
|
||||
- Fix Tags/Categories render problems on recipes
|
||||
- Tags redirect to new tag pages
|
||||
- Categories redirect to category pages
|
||||
- Fix Backup download blocked by authentication
|
||||
- Random meal-planner will no longer duplicate recipes unless no other options
|
||||
- New Quick Week button to generate next 5 day week of recipe slots.
|
||||
- Minor UI tweaks
|
||||
- Recipe Cards now display 2 recipe tags
|
||||
- Recipe images are now minified. This comes with a serious performance improvement. On initial startup you may experience some delays. Images are migrated to the new structure on startup, depending on the size of your database this can take some time.
|
||||
- Note that original images are still kept for large displays like on the individual recipe pages.
|
||||
- A smaller image is used for recipe cards
|
||||
- A 'tiny' image is used for search images.
|
||||
- Advanced Search Page. You can now use the search page to filter recipes to include/exclude tags and categories as well as select And/Or matching criteria.
|
||||
- Added link to advanced search on quick search
|
||||
- Better support for NextCloud imports
|
||||
- Translate keywords to tags
|
||||
- Fix rollback on failure
|
||||
- Recipe Tag/Category Input components have been unified and now share a single way to interact. To add a new category in the recipe editor you need to click to '+' icon next to the input and fill out the form. This is the same for adding a Tag.
|
||||
|
||||
|
||||
34
docs/docs/changelog/v0.4.2.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# v0.4.2
|
||||
|
||||
**App Version: v0.4.2**
|
||||
|
||||
**Database Version: v0.4.0**
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
1. With a recent refactor some users been experiencing issues with an environmental variable not being set correct. If you are experiencing issues, please provide your comments [Here](https://github.com/hay-kot/mealie/issues/281).
|
||||
|
||||
2. If you are a developer, you may experience issues with development as a new environmental variable has been introduced. Setting `PRODUCTION=false` will allow you to develop as normal.
|
||||
|
||||
## Bug Fixes
|
||||
- Fixed Initialization script (v0.4.1a Hot Fix) - Closes #274
|
||||
- Fixed nested list error on recipe scrape - Closes #306
|
||||
- Fixed ingredient checkboxes - Closes #304
|
||||
- Removed link on recent - Closes #297
|
||||
- Categories sidebar is auto generated if no pages are created - Closes #291
|
||||
- Fix tag issues on creating custom pages - Closes #290
|
||||
- Validate paths on export - Closes #275
|
||||
- Walk Nextcloud import directory - Closes #254
|
||||
|
||||
## General Improvements
|
||||
- Improved Nextcloud Migration. Mealie will now walk the directories in a zip file looking for directories that match the pattern of a Nextcloud Recipe. Closes #254
|
||||
- Rewrite Keywords to Tag Fields
|
||||
- Rewrite url to orgURL
|
||||
- Improved Chowdown Migration
|
||||
- Migration report is now similar to the Backup report
|
||||
- Tags/Categories are now title cased on import "dinner" -> "Dinner"
|
||||
- Depreciate `ENV` variable to `PRODUCTION`
|
||||
- Set `PRODUCTION` env variable to default to true
|
||||
- Unify Logger across the backend
|
||||
- mealie.log and last_recipe.json are now downloadable from the frontend from the /admin/about
|
||||
- New download schema where you request a token and then use that token to hit a single endpoint to download a file. This is a notable change if you are using the API to download backups.
|
||||
- Recipe images can now be added directly from a URL - [See #117 for details](https://github.com/hay-kot/mealie/issues/117)
|
||||
14
docs/docs/changelog/v0.4.3.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# v0.4.3
|
||||
|
||||
**App Version: v0.4.3**
|
||||
|
||||
**Database Version: v0.4.0**
|
||||
|
||||
## Bug Fixes
|
||||
- Fix Upload error for Migrations
|
||||
- Fixes #315 - Cannot select another language
|
||||
- Fixes #314 - case-sensitive emails
|
||||
- Fixes #312 - Profile Image Reload
|
||||
|
||||
## Improvements
|
||||
- New TOKEN_TIME and DEFAULT_EMAIL env variables
|
||||
129
docs/docs/changelog/v0.5.0.md
Normal file
@@ -0,0 +1,129 @@
|
||||
# v0.5.0 Too Many Changes!
|
||||
|
||||
**App Version: v0.5.0**
|
||||
|
||||
**Database Version: v0.5.0**
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
|
||||
#### Database
|
||||
Database version has been bumped from v0.4.x -> v0.5.0. You will need to export and import your data. Moving forward, we will be using database migrations (BETA) to do this automatically. Note that you still must backup your data. If you don't, it's entirely possible something may go wrong and you could lose your data on upgrade.
|
||||
|
||||
#### Image Directory
|
||||
the /data/img directory has been depreciated. All images are now stored in the /recipes/{slug}/image directory. Images should be migrated automatically, but you may experience issues related to this change.
|
||||
|
||||
#### API Usage
|
||||
If you have been using the API directly, many of the routes and status codes have changed. You may experience issues with directly consuming the API.
|
||||
|
||||
#### Arm/v7 Support
|
||||
Mealie will no longer build in CI/CD due to a issue with the rust compiler on 32 bit devices. You can reference [this issue on the matrix-org/synapse](https://github.com/matrix-org/synapse/issues/9403) Github page that are facing a similar issue. You may still be able to build the docker image you-self.
|
||||
|
||||
!!! warning "Potential Data Loss"
|
||||
With this release comes a major rework of how files are stored on disk and where things belong. Migration of files should be done automatically. We have tested extensively with many different backups and user bases and have found that no one experienced data-loss. HOWEVER, with all the major changes that have occurred, it is vital that to prevent any data-loss you must create a backup and store that backup outside of your mealie instance. If you do not do this, you may lose your data.
|
||||
|
||||
## Bug Fixes
|
||||
- Fixed #25 - Allow changing rating without going into edit
|
||||
- Fixed #475 - trim whitespace on login
|
||||
- Fixes #435 - Better Email Regex
|
||||
- Fixed #428 - Meal Planner now works on iOS devices
|
||||
- Fixed #419 - Typos
|
||||
- Fixed #418 - You can now "export" shopping lists
|
||||
- Fixed #356 - Shopping List items are now grouped
|
||||
- Fixed #329 - Fixed profile image not loading
|
||||
- Fixed #461 - Proper JSON serialization on webhooks
|
||||
- Fixed #332 - Language settings are saved for one browser
|
||||
- Fixes #281 - Slow Handling of Large Sets of Recipes
|
||||
- Fixed #356 - Shopping lists generate duplicate items
|
||||
- Fixed #271 - Slow handling of larger data sets
|
||||
- Fixed #472, #469, #458, #456 - Improve Recipe Parser
|
||||
|
||||
## Features and Improvements
|
||||
|
||||
### Highlights
|
||||
- Recipe Parser
|
||||
- Recipes can now be imported with a bookmarklet!
|
||||
- Significant improvement in supported sites with the new [Recipe Scraper Library](https://github.com/hhursev/recipe-scrapers)
|
||||
- UI Debugging now available at `/recipes/debugger`
|
||||
- Better error messages on failure
|
||||
- ⚠️ last_recipe.json is now depreciated
|
||||
- Beta Support for Postgres! 🎉 See the getting started page for details
|
||||
- Recipe Features
|
||||
- New button bar for editors with improved accessibility and performance
|
||||
- Step Sections now supported
|
||||
- Recipe Assets
|
||||
- Add Asset image to recipe step
|
||||
- Additional View Settings.
|
||||
- Better print support
|
||||
- New Toolbox Page!
|
||||
- Bulk assign categories and tags by keyword search
|
||||
- Title case all Categories or Tags with 1 click
|
||||
- Create/Rename/Delete Operations for Tags/Categories
|
||||
- Remove Unused Categories or Tags with 1 click
|
||||
- Recipe Cards now have a menu button for quick actions!
|
||||
- Edit
|
||||
- Delete
|
||||
- Integrated Share with supported OS/Browsers
|
||||
- Print
|
||||
- New Profile Dashboard!
|
||||
- Edit Your Profile
|
||||
- Create/Edit Themes
|
||||
- View other users in your Group
|
||||
- See what's for dinner
|
||||
- Manage Long Live API Tokens (New)
|
||||
- New Admin Dashboard! 🎉
|
||||
- Now you can get some insight on your application with application statics and events.
|
||||
- See uncategorized/untagged recipes and organize them!
|
||||
- Backup/Restore right from your dashboard
|
||||
- See server side events. Now you can know who deleted your favorite recipe!
|
||||
- New Event Notifications through the Apprise Library
|
||||
- Get notified when specific server side events occur
|
||||
|
||||
### Meal Planner
|
||||
- Multiple Recipes per day
|
||||
- Supports meals without recipes (Enter title and description)
|
||||
- Generate share-link from created meal-planners
|
||||
- Shopping lists can be directly generated from the meal plan
|
||||
|
||||
### General
|
||||
- User can now favorite recipes
|
||||
- New 'Dark' Color Theme Packaged with Mealie
|
||||
- Updated Recipe Card Sections Toolbar
|
||||
- New Sort Options (They work this time!)
|
||||
- Alphabetical
|
||||
- Rating
|
||||
- Created Date
|
||||
- Updated Date
|
||||
- Shuffle (Random Sort)
|
||||
- New 'Random' Recipe button on recipe sections. Random recipes are selected from the filtered results below. For example, on the "Cakes" category page, you will only get recipes in the "Cakes" category.
|
||||
- Rating can be updated without entering the editor - Closes #25
|
||||
- Updated recipe editor styles and moved notes to below the steps.
|
||||
- Redesigned search bar
|
||||
- 'Dinner this week' shows a warning when no meal is planned yet
|
||||
- 'Dinner today' shows a warning when no meal is planned yet
|
||||
- More localization
|
||||
- Start date for Week is now selectable
|
||||
- Languages are now managed through Crowdin
|
||||
- Application Bar was Rewritten
|
||||
- Sidebar can now be toggled everywhere.
|
||||
- New and improved mobile friendly bottom bar
|
||||
- Improved styling for search bar in desktop
|
||||
- Improved search layout on mobile
|
||||
- Profile image now shown on all sidebars
|
||||
- Switched from Flash Messages to Snackbar (Removed dependency)
|
||||
|
||||
### Performance
|
||||
- Images are now served up by the Caddy increase performance and offloading some loads from the API server
|
||||
- Requesting all recipes from the server has been rewritten to refresh less often and manage client side data better.
|
||||
- All images are now converted to .webp for better compression
|
||||
|
||||
### Behind the Scenes
|
||||
- The database layer has been added for future recipe scaling.
|
||||
- Black and Flake8 now run as CI/CD checks
|
||||
- New debian based docker image
|
||||
- Unified Sidebar Components
|
||||
- Refactor UI components to fit Vue best practices (WIP)
|
||||
- The API returns more consistent status codes
|
||||
- The API returns error code instead of error text when appropriate
|
||||
- ⚠️ May cause side-effects if you were directly consuming the API
|
||||
11
docs/docs/changelog/v0.5.1.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# v0.5.1
|
||||
|
||||
**App Version: v0.5.1**
|
||||
|
||||
**Database Version: v0.5.0**
|
||||
|
||||
|
||||
## Bug Fixes
|
||||
- Fixed #538 - Missing Ingredients on Editor
|
||||
- Fixed error on webhooks for new groups
|
||||
- Fixed various icons references
|
||||
65
docs/docs/changelog/v0.5.2.md
Normal file
@@ -0,0 +1,65 @@
|
||||
# v0.5.2
|
||||
|
||||
**App Version: v0.5.2**
|
||||
|
||||
**Database Version: v0.5.0**
|
||||
|
||||
## Bug Fixes
|
||||
- Fixed #617 - Section behavior when adding a step
|
||||
- Fixed #615 - Recipe Settings are not available when creating new recipe
|
||||
- Fixed #625 - API of today's image returns strange characters
|
||||
- Fixed [#590](https://github.com/hay-kot/mealie/issues/590) - Duplicate Events when using Gunicorn Workers
|
||||
|
||||
## Features and Improvements
|
||||
|
||||
### General
|
||||
- Recipe Instructions now collapse when checked
|
||||
- Default recipe settings can be set through ENV variables
|
||||
- Recipe Ingredient lists can now container ingredient sections.
|
||||
- You can now download and upload individual recipes
|
||||
|
||||
|
||||
### Localization
|
||||
|
||||
Huge thanks to [@sephrat](https://github.com/sephrat) for all his work on the project. He's very consistent in his contributions to the project and nearly every release has had some of his code in it! Here's some highlights from this release
|
||||
|
||||
- Lazy Load Translations (Huge Performance Increase!)
|
||||
- Tons of localization additions all around the site.
|
||||
- All of the work that goes into managing and making Crowdin a great feature the application
|
||||
|
||||
#### Here a list of contributors on Crowding who make Mealie possible in different locals
|
||||
|
||||
| Name | Languages | Translated (Words) | Target Words |
|
||||
| ---------------------------- | ------------------ | :----------------: | :----------: |
|
||||
| retmas-gh | Polish | 550 | 625 |
|
||||
| startos | Italian | 310 | 322 |
|
||||
| CMBoii | Spanish | 256 | 291 |
|
||||
| sephrat | French | 255 | 296 |
|
||||
| Daniel Tildeman (tildeman) | Swedish | 233 | 228 |
|
||||
| Rourke | Dutch | 216 | 214 |
|
||||
| Andreas Waschinski (Wascha) | German | 207 | 202 |
|
||||
| wengtad | Chinese Simplified | 176 | 343 |
|
||||
| Matthias Borremans (MrBorri) | Dutch | 96 | 89 |
|
||||
| Adam Syndoman (pypckompsite) | Polish | 68 | 65 |
|
||||
| JonasSchubert | German | 22 | 23 |
|
||||
| ThrawnJL | Danish | 7 | 7 |
|
||||
| NicholasBrody | Dutch | 7 | 7 |
|
||||
| Giel Janssens (gieljnssns) | Dutch | 4 | 4 |
|
||||
| kentora | Danish | 3 | 2 |
|
||||
|
||||
|
||||
|
||||
### Docker
|
||||
|
||||
#### Huge thanks to [@wengtad](https://github.com/wengtad) for all his work on improving the deployment with docker.
|
||||
|
||||
- Optimize Docker Dev Size (Frontend: from ~1.52GB to ~429MB | API: from ~657MB to ~380MB)
|
||||
- Optimize Docker Prod Size (from ~542MB to ~373MB)
|
||||
- Add Gunicorn
|
||||
- Add Gunicorn and Webworkers to Dockerfile #550
|
||||
- Add Docs for Gunicorn
|
||||
- Add PUID/PGID to Docker. Fixes Initialization scripts fail to run when not executing as root user inside container #350,
|
||||
- Not able to run correctly in docker if user permissions are specified #429
|
||||
- Merge Dockerfile.dev into Dockerfile (dev shared same base together with prod)
|
||||
- Add Docs for PUID/PGID
|
||||
- Add Docker healthcheck (for this is not necessary, I could remove if you want)
|
||||
@@ -1,9 +1,6 @@
|
||||
# Contributing to Mealie
|
||||
|
||||
!!! Warning
|
||||
It should be known going into this that this is my first open source project, and my first public github repo I'm actively managing. If something does not make sense, or is not best practice. PLEASE feel free to reach out and let me know. I'm all about improving workflow and making it easier for contributors.
|
||||
|
||||
[Please Join the Discord](https://discord.gg/R6QDyJgbD2). We are building a community of developers working on the project.
|
||||
[Please Join the Discord](https://discord.gg/QuStdQGSGK). We are building a community of developers working on the project.
|
||||
|
||||
## We Develop with Github
|
||||
We use github to host code, to track issues and feature requests, as well as accept pull requests.
|
||||
@@ -12,11 +9,12 @@ We use github to host code, to track issues and feature requests, as well as acc
|
||||
Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:
|
||||
|
||||
1. Fork the repo and create your branch from `dev`.
|
||||
2. Read the page in in [dev/dev-notes.md](https://github.com/hay-kot/mealie/blob/0.1.0/dev/dev-notes.md) to get an idea on where the project is at.
|
||||
2. Checkout the Discord, the PRs page, or the Projects page to get an idea of what's already being worked on.
|
||||
3. If you're interested on working on major changes please get in touch on discord and coordinate with other developers. No sense in doubling up on work if someones already on it.
|
||||
4. If you've changed APIs, update the documentation.
|
||||
5. Issue that pull request!
|
||||
6. If you make changes to the dev branch reflect those changes in the dev/dev-notes.md to keep track of changes. Don't forget to add your name/handle/identifier!
|
||||
4. Once you've got an idea of what changes you want to make, create a draft PR as soon as you can to let us know what you're working on and how we can help!
|
||||
5. If you've changed APIs, update the documentation.
|
||||
6. Issue that pull request!
|
||||
7. If you make changes to the dev branch reflect those changes in the active changelog to keep track of changes. Don't forget to add your name/handle/identifier!
|
||||
|
||||
## Any contributions you make will be under the MIT Software License
|
||||
In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# Guidelines
|
||||
|
||||
TODO
|
||||
## Python
|
||||
|
||||
## Vue
|
||||
|
||||
[See The Style Guide](../developers-guide/style-guide.md)
|
||||
@@ -1,31 +1,51 @@
|
||||
# Development: Getting Started
|
||||
|
||||
After reading through the [Code Contributions Guide](https://hay-kot.github.io/mealie/contributors/developers-guide/code-contributions/) and forking the repo you can start working. This project is developed with :whale: docker and as such you will be greatly aided by using docker for development. It's not necessary but it is helpful.
|
||||
After reading through the [Code Contributions Guide](../developers-guide/code-contributions.md) and forking the repo you can start working. This project is developed with :whale: docker and as such you will be greatly aided by using docker for development. It's not necessary but it is helpful.
|
||||
|
||||
## With Docker
|
||||
`cd` into frontend directory and run `npm install` to install the node modules.
|
||||
Prerequisites
|
||||
|
||||
There are 2 scripts to help set up the docker containers in dev/scripts/.
|
||||
|
||||
`docker-compose.dev.sh` - Will spin up a docker development server
|
||||
`docker-compose.sh` - Will spin up a docker production server
|
||||
|
||||
There are VSCode tasks created in the .vscode folder. You can use these to quickly execute the scripts above using the command palette.
|
||||
- Docker
|
||||
- docker-compose
|
||||
|
||||
You can easily start the development stack by running `make docker-dev` in the root of the project directory. This will run and build the docker-compose.dev.yml file.
|
||||
|
||||
## Without Docker
|
||||
?? TODO
|
||||
Prerequisites
|
||||
|
||||
## Trouble Shooting
|
||||
- Python 3.9+
|
||||
- Poetry
|
||||
- Nodejs
|
||||
- npm
|
||||
|
||||
!!! Error "Symptom: Vue Development Server Wont Start"
|
||||
**Error:** `TypeError: Cannot read property 'upgrade' of undefined`
|
||||
Once the prerequisites are installed you can cd into the project base directory and run `make setup` to install the python and node dependencies. Once that is complete you can run `make backend` and `make frontend` to start the backend and frontend servers.
|
||||
|
||||
**Solution:** You may be missing the `/frontend/.env.development.` The contents should be `VUE_APP_API_BASE_URL=http://127.0.0.1:9921`. This is a reference to proxy the the API requests from Vue to 127.0.0.1 at port 9921 where FastAPI should be running.
|
||||
## Make File Reference
|
||||
|
||||
!!! Error "Symptom: FastAPI Development Server Wont Start"
|
||||
**Error:** `RuntimeError: Directory '/app/dist' does not exist`
|
||||
Run `make help` for reference
|
||||
|
||||
**Solution:** Create an empty /mealie/dist directory. This directory is served as static content by FastAPI. It is provided during the build process and may be missing in development.
|
||||
```
|
||||
clean-purge ⚠️ Removes All Developer Data for a fresh server start
|
||||
clean 🧹 Remove all build, test, coverage and Python artifacts
|
||||
clean-pyc 🧹 Remove Python file artifacts
|
||||
clean-test 🧹 Remove test and coverage artifacts
|
||||
test-all 🧪 Check Lint Format and Testing
|
||||
test 🧪 Run tests quickly with the default Python
|
||||
lint 🧺 Check style with flake8
|
||||
coverage ☂️ Check code coverage quickly with the default Python
|
||||
setup 🏗 Setup Development Instance
|
||||
backend 🎬 Start Mealie Backend Development Server
|
||||
frontend 🎬 Start Mealie Frontend Development Server
|
||||
frontend-build 🏗 Build Frontend in frontend/dist
|
||||
docs 📄 Start Mkdocs Development Server
|
||||
docker-dev 🐳 Build and Start Docker Development Stack
|
||||
docker-prod 🐳 Build and Start Docker Production Stack
|
||||
code-gen 🤖 Run Code-Gen Scripts
|
||||
|
||||
Run into another issue? [Ask for help on discord](https://discord.gg/R6QDyJgbD2)
|
||||
```
|
||||
|
||||
## Before you Commit!
|
||||
|
||||
Before you commit any changes on the backend/python side you'll want to run `make format` to format all the code with black. `make lint` to check with flake8, and `make test` to run pytests. You can also use `make test-all` to run both `lint` and `test`.
|
||||
|
||||
Run into another issue? [Ask for help on discord](https://discord.gg/QuStdQGSGK)
|
||||
33
docs/docs/contributors/developers-guide/style-guide.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Style Guide
|
||||
|
||||
!!! note
|
||||
Unifying styles across the application is an ongoing process, we are working on making the site more consistent.
|
||||
|
||||
## Button Guidelines
|
||||
|
||||
1. Buttons should follow the general color/icon scheme as outlined.
|
||||
2. All buttons should have an icon on the left side of the button and text on the right.
|
||||
3. Primary action buttons should be the default Vuetify styling.
|
||||
4. Primary action buttons should be right aligned
|
||||
5. Secondary buttons should be `text` or `outlined`. Text is preferred
|
||||
6. Other buttons should generally be "info" or "primary" color and can take any style type depending on context
|
||||
|
||||
### Button Colors and Icons
|
||||
|
||||
| Type | Color | Icon |
|
||||
| ----------- | :------------------ | :------------------------------------------------- |
|
||||
| Default | `info` or `primary` | None |
|
||||
| Create/New | `success` | `mdi-plus` or `$globals.icons.create` |
|
||||
| Update/Save | `success` | `mdi-save-content` or `$globals.icons.save` |
|
||||
| Edit | `info` | `mdi-square-edit-outline` or `$globals.icons.edit` |
|
||||
|
||||
### Example
|
||||
```html
|
||||
<v-btn color="primary">
|
||||
<v-icon left> mdi-plus </v-icon>
|
||||
Primary Button
|
||||
</v-btn>
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -7,8 +7,9 @@ We love your input! We want to make contributing to this project as easy and tra
|
||||
- Submitting a fix
|
||||
- Proposing new features
|
||||
- Becoming a maintainer
|
||||
- Help translate to a new language or improve current translations
|
||||
|
||||
[Remember to join the Discord and stay in touch with other developers working on the project](https://discord.gg/R6QDyJgbD2)!
|
||||
[Remember to join the Discord and stay in touch with other developers working on the project](https://discord.gg/QuStdQGSGK)!
|
||||
|
||||
Additionally, you can buy me a coffee and support the project. When I get financial support it helps me know that there's real interest in the project and that it's worth the time to keep developing.
|
||||
|
||||
|
||||
21
docs/docs/contributors/translating.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Contributing with Translations
|
||||
Translations can be a great way **for non-coders** to contribute to project.
|
||||
We use **[Crowdin](https://crowdin.com/project/mealie)** to allow several contributors to work on translating Mealie.
|
||||
You can simply help by voting for your preferred translations, or even by completely translating Mealie into a new language.
|
||||
|
||||
Translations are regularly pulled from Crowdin and included in each new release.
|
||||
|
||||
Please use Crowdin as much as possible if you have any question/issue regarding a particular string. You can take a look at [Crowdin Knowledge base](https://support.crowdin.com/for-volunteer-translators/) if you want to know more about how to use this tool.
|
||||
|
||||
## My language is missing in Mealie
|
||||
Once your language is translated on Crowdin, we need to manually add it in Mealie. If you believe your language is ready for use, please create an issue on GitHub.
|
||||
|
||||
## I can't find a particular text in Crowdin
|
||||
There can be several reasons:
|
||||
- The text you're looking for is outdated: someone has already changed it or it will be removed/changed in the next release.
|
||||
- It is possible some texts are not translatable (yet) for technical reasons. If you spot one, please reach out to us on [Discord](https://discord.gg/QuStdQGSGK) or raise an issue on GitHub.
|
||||
|
||||
## Technical information
|
||||
We use vue-i18n package for internationalization. Translations are stored in json format located in [frontend/src/locales/messages](https://github.com/hay-kot/mealie/tree/master/frontend/src/locales/messages).
|
||||
|
||||
[i18n Ally for VScode](https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally) is helpful for generating new strings to translate. It also has a nice feature, which shows translations in-place when editing code.
|
||||
@@ -1,14 +1,66 @@
|
||||
# Backup and Export
|
||||

|
||||
# Backup and Imports
|
||||
|
||||
All recipe data can be imported and exported as necessary from the UI. Under the admin page you'll find the section for using Backups and Exports.
|
||||
|
||||
To create an export simple add the tag and the markdown template and click Backup Recipes and your backup will be created on the server. The backup is a standard zipfile containing all the images, json files, and rendered markdown files for each recipe. Markdown files are rendered from jinja2 templates. Adding your own markdown file into the templates folder will automatically show up as an option to select when creating a backup. To view the availible variables, open a recipe in the json editor.
|
||||
!!! danger
|
||||
As this is still a **BETA** it is recommended that you backup your data often and store in more than one place. Adhere to backup best practices with the [3-2-1 Backup Rule](https://en.wikipedia.org/wiki/Backup). Prior to upgrading you **should** perform a backup to limit any data loss.
|
||||
|
||||
To import a backup it must be in your backups folder. If it is in the backup folder it will automatically show up as an source to restore from. Selected the desired backup and import the backup file.
|
||||
!!! tip "Mealie data that is saved on backups"
|
||||
- [x] Recipe Data
|
||||
- [ ] Meal Plan
|
||||
- [x] Site Settings
|
||||
- [x] Custom Pages
|
||||
- [x] User Data
|
||||
- [x] Group Data
|
||||
|
||||
## Custom Templating
|
||||
On export you can select a template to use to render files using the jinja2 syntax. This can be done to export recipes in other formats besides regular .json.Look at this example for rendering a markdown recipe using the jinja2 syntax.
|
||||
To create an export simply add the tag and the markdown template and click "Create" and your backup will be created on the server. The backup is a standard zipfile containing all the images, json files, and rendered jinaj2 templates for each recipe. To view the available variables, open a recipe in the json editor.
|
||||
|
||||
To import a backup it must be in your backups folder. If it is in the backup folder it will automatically show up as a source to restore from. Selected the desired backup and import the backup file. Backups can be uploaded from the UI as well as added on the file system.
|
||||
|
||||
## Demo
|
||||
|
||||

|
||||
|
||||
## API Examples
|
||||
You can use the API to create and retrieve backups remotely from any server that can access the Mealie instance. This is useful for easily managing off-site backups via cron-job or other scheduled tasks. You can find interactive documentation for your API at https://your-mealie-instance.com/docs
|
||||
|
||||
### curl Example
|
||||
Create a backup with curl
|
||||
```bash
|
||||
curl -X 'POST' \
|
||||
'http://localhost:9000/api/backups/export/database' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"tag": "July 23rd 2021",
|
||||
"options": {
|
||||
"recipes": true,
|
||||
"settings": true,
|
||||
"themes": true
|
||||
},
|
||||
"templates": [
|
||||
"recipes.md"
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
### wget Example
|
||||
First request a file token with curl:
|
||||
```bash
|
||||
curl -X 'GET' \
|
||||
'http://localhost:9000/api/backups/{file_name}/download' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Content-Type: application/json'
|
||||
```
|
||||
|
||||
Then download the file with wget:
|
||||
```bash
|
||||
wget http://localhost:9000/api/utils/download?token={fileToken}
|
||||
```
|
||||
|
||||
|
||||
## Jinja2 Templating
|
||||
On export you can select a template to use to render files using the jinja2 syntax. This can be done to export recipes in other formats besides regular .json. Look at this example for rendering a markdown recipe using the jinja2 syntax.
|
||||
|
||||
### Input
|
||||
```jinja2
|
||||
@@ -76,4 +128,4 @@ Categories: []
|
||||
Original URL: https://www.bonappetit.com/recipe/five-spice-popcorn-chicken#intcid=_bon-appetit-recipe-bottom-recirc_3cad5ce9-734a-46f8-b503-78c33d2e7279_similar2-3
|
||||
```
|
||||
|
||||
If you decide you don't like mealie. This is a good way to export into a format that can be imported into another.
|
||||
If you decide you don't like mealie: This is a good way to export into a format that can be imported into another.
|
||||