Feature/authentication (#209)

* basic crud NOT SECURE

* refactor/database init on startup

* added scratch.py

* tests/user CRUD routes

* password hashing

* change app_config location

* bump python version

* formatting

* login ui starter

* change import from url design

* move components

* remove old snackbar

* refactor/Componenet folder structure rework

* refactor/remove old code

* refactor/rename componenets/js files

* remove console.logs

* refactor/ models to schema and sql to models

* new header styling for imports

* token request

* fix url scrapper

* refactor/rename schema files

* split routes file

* redesigned admin page

* enable relative imports for vue components

* refactor/switch to pages view

* add CamelCase package

* majors settings rework

* user management second pass

* super user CRUD

* refactor/consistent models names

* refactor/consistent model names

* password reset

* store refactor

* dependency update

* abstract button props

* profile page refactor

* basic password validation

* login form refactor/split v-container

* remo unused code

* hide editor buttons when not logged in

* mkdocs dev dependency

* v0.4.0 docs update

* profile image upload

* additional token routes

* Smaller recipe cards for smaller viewports

* fix admin sidebar

* add users

* change to outlined

* theme card starter

* code cleanup

* signups

* signup pages

* fix #194

* fix #193

* clarify mealie_port

* fix #184

* fixes #178

* fix blank card error on meal-plan creator

* admin signup

* formatting

* improved search bar

* improved search bar

* refresh token on page refresh

* allow mealplan with no categories

* fix card layout

* remove cdn dependencies

* start on groups

* Fixes #196

* recipe databse refactor

* changelog draft

* database refactoring

* refactor recipe schema/model

* site settings refactor

* continued model refactor

* merge docs changes from master

* site-settings work

* cleanup + tag models

* notes

* typo

* user table

* sign up data validation

* package updates

* group store init

* Fix home page settings

* group admin init

* group dashboard init

* update deps

* formatting

* bug / added libffi-dev

* pages refactor

* fix mealplan

* docs update

* multi group supporot for job scheduler

* formatting

* formatting

* home-page redesign

* set background for docs darkmode

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden 2021-03-14 19:06:56 -08:00 committed by GitHub
commit 4bad1a028e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 1025 additions and 507 deletions

View file

@ -1,6 +1,6 @@
{
"python.formatting.provider": "black",
"python.pythonPath": "./.venv/bin/python3.9",
"python.pythonPath": ".venv/bin/python3.9",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.autoComplete.extraPaths": ["mealie", "mealie/mealie"],
@ -15,8 +15,6 @@
"i18n-ally.localesPaths": "frontend/src/locales",
"i18n-ally.enabledFrameworks": ["vue"],
"i18n-ally.keystyle": "nested",
"cSpell.words": [
"performant"
],
"cSpell.words": ["performant"],
"search.mode": "reuseEditor"
}

20
.vscode/tasks.json vendored
View file

@ -6,7 +6,9 @@
"command": "./dev/scripts/docker-compose.dev.sh",
"type": "shell",
"args": [],
"problemMatcher": ["$tsc"],
"problemMatcher": [
"$tsc"
],
"presentation": {
"reveal": "always"
},
@ -17,7 +19,9 @@
"command": "./dev/scripts/docker-compose.sh",
"type": "shell",
"args": [],
"problemMatcher": ["$tsc"],
"problemMatcher": [
"$tsc"
],
"presentation": {
"reveal": "always"
},
@ -26,16 +30,18 @@
{
"label": "Dev: Start local Backend",
"command": "../${config:python.pythonPath}",
"args": ["app.py"],
"args": [
"app.py"
],
"options": {
"cwd": "${workspaceFolder}/mealie/"
},
"type": "shell",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"group": "groupA"
}
},
"problemMatcher": []
},
{
"label": "Dev: Start local Frontend",
@ -44,11 +50,11 @@
"options": {
"cwd": "${workspaceFolder}/frontend/"
},
"problemMatcher": [],
"presentation": {
"reveal": "always",
"group": "groupA"
}
},
"problemMatcher": []
}
]
}

View file

@ -38,3 +38,4 @@ COPY --from=build-stage /app/dist /app/dist
VOLUME [ "/app/data/" ]
RUN chmod +x /app/run.sh
CMD /app/run.sh

File diff suppressed because one or more lines are too long

4
docs/docs/api/redoc.md Normal file
View file

@ -0,0 +1,4 @@
---
title: API
template: api.html
---

View file

@ -1,223 +0,0 @@
# Release Notes
## v0.4.0 Whoa, What a Release! [DRAFT]
### Bug Fixes
### Features and Improvements
- 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. Some key features include
- Sign Up Links
- Admin and User Roles
- Group Management
- Create/Edit/Delete Restrictions
- 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 adhear closer to the standard schema
- "tool" - a list of tools used for the recipe
- Removed CDN dependencies
- Completed Redesign of the Admin Panel
- Profile Pages
- Side Panel Menu
- Language selector is now displayed on all pages and does not require an account
### Development / Misc
- Database Model Refactoring
- File/Folder Name Refactoring
## 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.
## 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.
## 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 - 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)
- 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 - [See Documentation](/api/api-usage/)
- 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 - Closes #51
- User feedback on backup importing
## v0.0.1 - Pre-release Patch
### General
- Updated Favicon
- Renamed Frontend Window
- Added Debug folder to dump scraper data prior to processing.
### Recipes
- Added user feedback on bad URL
- 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.
### 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
- Migration From Other Platforms
- Chowdown
### 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 markdown format for universal access
- Use the default or a custom jinja2 template

View file

@ -0,0 +1,88 @@
# 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 - 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)
- 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 - [See Documentation](/api/api-usage/)
- 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 - Closes #51
- User feedback on backup importing
## v0.0.1 - Pre-release Patch
### General
- Updated Favicon
- Renamed Frontend Window
- Added Debug folder to dump scraper data prior to processing.
### Recipes
- Added user feedback on bad URL
- 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.
### 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
- Migration From Other Platforms
- Chowdown
### 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 markdown format for universal access
- Use the default or a custom jinja2 template

View 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.

View 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.

View file

@ -0,0 +1,46 @@
# v0.4.0 Whoa, What a Release! [DRAFT]
### Bug Fixes
- Fixed Search Results Limited to 100 - #198
- Fixed Recette 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
#### 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
#### 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
- File/Folder Name Refactoring

View file

@ -0,0 +1,66 @@
# About The Project
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/R6QDyJgbD2)!
!!! note
In some of the demo gifs the styling may be different than the finale application. demos were done during development prior to finale styling.
!!! warning
This is a **BETA** release and that means things may break and or change down the line. I'll do my best to make sure that any API changes are thoughtful and necessary in order not to break things. Additionally, I'll do my best to provide a migration path if the database schema ever changes. Do not use programs like watchtower to auto update your container. You **WILL** run into issues if you do this,
## Key Features
- 🔍 Powerful fuzzy search
- 🏷️ Tag recipes with categories or tags to flexible sorting
- ⬇️ Import recipes from around the web by URL
- 📱 Beautiful Mobile Views
- 📆 Create meal plans
- 🛒 Generate shopping lists from meal plans
- 🐳 Easy setup with Docker
- 🎨 Customize your interface with color themes layouts
- ✉️ Export and import all your data in any formating with Jinja Tempaltes
- 🌍 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
## FAQ
### 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 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.
## Built With
* [Vue.js](https://vuejs.org/)
* [Vuetify](https://vuetifyjs.com/en/)
* [FastAPI](https://fastapi.tiangolo.com/)
* [Docker](https://www.docker.com/)
<!-- ROADMAP -->
## Road Map
[See Roadmap](/roadmap)
<!-- CONTRIBUTING -->
## Contributing
Contributions are what make the open source community such an amazing place to be learn, develop, and create. Any contributions you make are **greatly appreciated**. See the [Contributors Guide](https://hay-kot.github.io/mealie/contributors/developers-guide/code-contributions/) 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>

View file

@ -1,27 +0,0 @@
# Site Settings Panel
!!! danger
As this is still a **BETA** It is recommended that you backup your data often and store in more than one place. Ad-hear 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.
## General Settings
In your site settings page you can select several options to change the layout of your homepage. You can choose to display the recent recipes, how many cards to show for each section, and which category sections to display. You can additionally select which language to use by default. Note the currently homepage settings are saved in your browser. In the future a database entry will be made for site settings so the homepage is consistent across users.
![](../gifs/homepage-settings-v1.gif)
## Theme Settings
Color themes can be created and set from the UI in the settings page. You can select an existing color theme or create a new one. On creation of a new color theme, the default colors will be used, then you can select and save as you'd like. By default the "default" theme will be loaded for all new users visiting the site. All created color themes are available to all users of the site. Theme Colors will be set for both light and dark modes.
![](../gifs/theme-demo-v2.gif)
!!! tip
Theme data is stored in localstorage in the browser. Calling "Save colors and apply theme will refresh the local storage with the selected theme as well save the theme to the database.
## Backups
Site backups can easily be taken and download from the UI. To import, simply select the backup you'd like to restore and check which items you'd like to import.
## Meal Planner
In the meal planner section you can select categories to be used as apart of the random recipe selector in the meal plan creator.
Meal planner webhooks are post requests sent from Mealie to an external endpoint. The body of the message is the Recipe JSON of the scheduled meal. If no meal is schedule, no request is sent. The webhook functionality can be enabled or disabled as well as scheduled. Note that you must "Save Webhooks" prior to any changes taking affect server side.

View file

@ -0,0 +1,17 @@
# Updating Mealie
!!! warning "Read The Release Notes"
You MUST read the release notes prior to upgrading your container. Currently Mealie provides no database migrations as doing such would slow down development and hinder major changes that may need to happen prior to v1.0.0. Mealie has a robust backup and restore system for managing your data.
### Before Upgrading
- Read The Release Notes
- Identify Breaking Changes
- Create a Backup and Download from the UI
- Upgrade
## Docker
For all setups using Docker the updating process look something like this
- Stop the container using docker-compose down
- Pull the latest image using docker-compose pull
- Start the container again using docker-compose up -d

View file

@ -1,32 +0,0 @@
# User Managemenet
## Overview
The basic relationship and ownership of recipes and meal plans is based on a user and group model where users are owners of recipes and groups are owners of meal plans. By default all users will be added to the default group. If a recipe is added through a migration or through a backup where no user exists ownership will be set to the default Admin, the original user provided by Mealie. To fully understand how to structure your users and groups, you'll need to know how each role is used in the website.
!!! info ":fontawesome-solid-user-cog: Admins"
Mealie admins are super users that have access to all user data (excluding passwords). All admins can perform administrative tasks like adding users, resetting user passwords, backing up the database, migrating data, and managing site settings. Administrators can also access restricted recipes that are marked hidden or with editing disabled by the owner.
!!! info ":fontawesome-solid-users: User Groups"
User groups, or "family" groups are a collection of users that are associated together. Users belonging to groups will have access to their associated meal plans and associated pages. This is currently the only feature of groups.
!!! info ":fontawesome-solid-user: User"
A single user created by an Admin that has basic privileges to edit their profile, create and edit recipes they own. Edit recipes that are not hidden and are marked editable.
## Startup
On the first startup you'll need to login to Mealie using the default username and password `changeme@email.com` and `MyPassword` or the default set through the env variable. On first login you'll be required to reset your password. After resetting your password you should also change your email address as appropriate. This will be used for logins on all future requests.
!!! tip
Your default password environmental variable will be the default password for all new users that are created. This is stored in plain text and should not be used **any where** else.
## Creating and Editing Users
// TODO
## Creating Groups
// TODO
## Password Reset
// TODO
## Examples Use Cases
// TODO

View file

@ -1,116 +1,4 @@
# About The Project
<p align="center">
<a href="https://github.com/hay-kot/mealie">
</a>
<p align="center">
A Place for All Your Recipes
<br />
<a href="https://github.com/hay-kot/mealie"><s>View Demo</s></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://github.com/hay-kot/mealie/issues">
Request Feature
</a>
·
<a href="https://hub.docker.com/repository/docker/hkotel/mealies"> Docker Hub
</a>
</p>
</p>
<!-- ABOUT THE PROJECT -->
![Product Name Screen Shot][product-screenshot]
**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.
**Why does my recipe manager need 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 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.
[Remember to join the Discord](https://discord.gg/R6QDyJgbD2)!
!!! note
In some of the demo gifs the styling may be different than the finale application. demos were done during development prior to finale styling.
!!! warning
Note that this is a **BETA** release and that means things may break and or change down the line. I'll do my best to make sure that any API changes are thoughtful and necessary in order not to break things. Additionally, I'll do my best to provide a migration path if the database schema ever changes. Do not use programs like watchtower to auto update your container. You **WILL** run into issues if you do this,
### Main Features
#### Recipes
- Automatic web scrapping for common recipe platforms
- UI recipe editor
- JSON recipe editor
- Additional recipe data
- custom notes
- ratings
- categories and tags
- total, cook, and prep time indicators
- View recipes by category
- Basic fuzzy search
- Migration from other platforms
- Chowdown
- Nextcloud Cookbook
#### Meal Planner
- Random meal plan generation
#### API
- The entire application is built on a restful API and can be accessed by the user
- Scheduled Webhooks
- Interactive API Documentation thanks to [FastAPI](https://fastapi.tiangolo.com/) and [Swagger](https://petstore.swagger.io/)
- Custom "API Extras" in recipes for custom key/value pairs to extendable API uses
#### Database Import / Export
- Easily import / export your recipes from the UI
- Export recipes in any format for universal access using Jinja2
- Use the default or a custom jinja2 template
### Built With
* [Vue.js](https://vuejs.org/)
* [Vuetify](https://vuetifyjs.com/en/)
* [FastAPI](https://fastapi.tiangolo.com/)
* [Docker](https://www.docker.com/)
<!-- ROADMAP -->
## Road Map
[See Roadmap](roadmap.md)
<!-- 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.
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>
<!-- LICENSE -->
## License
Distributed under the MIT License. See `LICENSE` for more information.
<!-- CONTACT -->
## Contact
Project Link: [https://github.com/hay-kot/mealie](https://github.com/hay-kot/mealie)
<!-- 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 -->
[product-screenshot]: img/home_screenshot.png
---
title: Home
template: home.html
---

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,361 @@
<!-- Custom HTML site displayed as the Home chapter -->
{% extends "main.html" %}
{% block tabs %}
{{ super() }}
<style>
.md-main {
flex-grow: 0
}
.md-main__inner {
display: flex;
height: 100%;
}
.tx-container {
padding-top: .0rem;
background: var(--md-primary-bg-color)
}
.tx-hero {
margin: 12px 2.8rem;
justify-content: center;
}
.tx-hero h1 {
margin-bottom: 1rem;
font-family: "Roboto";
color: #30353a;
font-weight: 500
}
.tx-hero__content {
padding-bottom: 1rem;
margin: 0 auto;
}
.tx-hero__image{
order:1;
padding-right: 2.5rem;
}
.tx-hero .md-button {
margin-top: .5rem;
margin-right: .5rem;
color: var(--md-primary-fg-color)
}
.tx-hero .md-button--primary {
background-color: var(--md-primary--color);
border-color: var(--md-primary-bg-color)
}
.tx-hero .md-button:focus,
.tx-hero .md-button:hover {
background-color: var(--md-accent-fg-color);
color: var(--md-default-bg-color);
border-color: var(--md-accent-fg-color)
}
.feature-item h2 svg {
height: 30px;
float: left;
margin-right: 10px;
transform: translateY(10%);
}
.feature-container {
background-color: #F7FAFC;
}
.top-hr {
margin-top: 42px;
margin-bottom: 42px;
}
.feature-item {
font-family: 'Lato', sans-serif;
font-weight: 300;
box-sizing: border-box;
padding: 0 15px;
word-break: break-word
}
.feature-item h2 {
color: #333;
font-weight: 300;
font-size: 25px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: normal;
margin-top: 20px;
margin-bottom: 10px;
font-family: inherit;
}
.feature-item p {
font-size: 16px;
line-height: 1.8em;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
color: #111;
margin: 0 0 10px;
display: block;
}
@media screen and (max-width:30em) {
.tx-hero h1 {
font-size: 1.4rem
}
}
@media screen and (min-width:60em) {
.md-sidebar--secondary {
display: none
}
.tx-hero {
display: flex;
align-items: center;
justify-content: center;
}
.tx-hero__content {
max-width: 22rem;
margin-top: 3.5rem;
margin-bottom: 3.5rem;
margin-left: 1.0rem;
margin-right: 4.0rem;
align-items: center;
}
}
@media screen and (min-width:76.25em) {
.md-sidebar--primary {
display: none
}
.top-hr {
width: 100%;
display: flex;
max-width: 61rem;
margin-right: auto;
margin-left: auto;
padding: 0 .2rem;
}
.bottom-hr {
margin-top: 10px;
width: 100%;
display: flex;
max-width: 61rem;
margin-right: auto;
margin-left: auto;
padding: 0 .2rem;
}
.feature-item {
flex: 1;
min-width: 0;
}
/* .feature-item:hover {
background-color: #fea55247;
border-radius: 3px;
} */
}
.hr {
border-bottom: 1px solid #eee;
width: 100%;
margin: 20px 0;
}
.text-center {
text-align: center;
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
margin-top: 15px;
font-family: 'Lato', sans-serif;
font-size: 23px;
font-weight: 300;
padding-bottom: 10px;
}
.logos {
display: flex;
align-items: center;
justify-content: center;
flex-flow: row wrap;
margin: 0 auto;
}
.logos img {
flex: 1 1 auto;
padding: 25px;
max-height: 130px;
vertical-align: middle;
}
.hr-logos {
margin-top: 0;
margin-bottom: 30px;
}
.md-footer-meta__inner {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 1.0rem;
}
.md-footer-social {
padding-top: 20px;
}
</style>
<!-- Main site Entry button descriptions -->
<section class="tx-container">
<div class="md-grid md-typeset">
<div class="tx-hero">
<div class="tx-hero__image">
<img src="img/home_screenshot.png" draggable="false">
</div>
<div class="tx-hero__content">
<h1>
Mealie
</h1>
<p>
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.
</p>
<a href="{{ page.next_page.url | url }}" title="{{ page.next_page.title | striptags }}" class="md-button md-button--primary">
Get started
</a>
<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" class="md-button">
Go to GitHub
</a>
</div>
</div>
</div>
</section>
<!-- Main site box descriptions -->
<!-- Row 1 -->
<section class="feature-container">
<div class="top-hr">
<div class="feature-item">
<h2>
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M15.5,14L20.5,19L19,20.5L14,15.5V14.71L13.73,14.43C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.43,13.73L14.71,14H15.5M9.5,4.5L8.95,4.53C8.71,5.05 8.34,5.93 8.07,7H10.93C10.66,5.93 10.29,5.05 10.05,4.53C9.87,4.5 9.69,4.5 9.5,4.5M13.83,7C13.24,5.97 12.29,5.17 11.15,4.78C11.39,5.31 11.7,6.08 11.93,7H13.83M5.17,7H7.07C7.3,6.08 7.61,5.31 7.85,4.78C6.71,5.17 5.76,5.97 5.17,7M4.5,9.5C4.5,10 4.58,10.53 4.73,11H6.87L6.75,9.5L6.87,8H4.73C4.58,8.47 4.5,9 4.5,9.5M14.27,11C14.42,10.53 14.5,10 14.5,9.5C14.5,9 14.42,8.47 14.27,8H12.13C12.21,8.5 12.25,9 12.25,9.5C12.25,10 12.21,10.5 12.13,11H14.27M7.87,8L7.75,9.5L7.87,11H11.13C11.21,10.5 11.25,10 11.25,9.5C11.25,9 11.21,8.5 11.13,8H7.87M9.5,14.5C9.68,14.5 9.86,14.5 10.03,14.47C10.28,13.95 10.66,13.07 10.93,12H8.07C8.34,13.07 8.72,13.95 8.97,14.47L9.5,14.5M13.83,12H11.93C11.7,12.92 11.39,13.69 11.15,14.22C12.29,13.83 13.24,13.03 13.83,12M5.17,12C5.76,13.03 6.71,13.83 7.85,14.22C7.61,13.69 7.3,12.92 7.07,12H5.17Z" />
</svg>
Import Recipes
</h2>
<p>
Quickly and easily import recipes from sites around the web using the built in recipe scrapper.
</p>
</div>
<div class="feature-item">
<h2>
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z" />
</svg>
Automatic Backups
</h2>
<p>
Keep your data safe with automatic backups in any format supported by Jinja2 Templates
</p>
</div>
<div class="feature-item">
<h2>
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M19,4C20.11,4 21,4.9 21,6V18A2,2 0 0,1 19,20H5C3.89,20 3,19.1 3,18V6A2,2 0 0,1 5,4H19M19,18V8H5V18H19Z" />
</svg>
Rich User Interface
</h2>
<p> Use a beautiful and intuitive user interface to create, edit, and delete recipes </p>
</div>
<div class="feature-item">
<h2>
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M9,10V12H7V10H9M13,10V12H11V10H13M17,10V12H15V10H17M19,3A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H6V1H8V3H16V1H18V3H19M19,19V8H5V19H19M9,14V16H7V14H9M13,14V16H11V14H13M17,14V16H15V14H17Z" />
</svg>
Meal Planner
</h2>
<p>Create Meal Plans for the week, month, or year! </p>
</div>
</div>
<!-- Row 2 -->
<div class="top-hr">
<div class="feature-item">
<h2>
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z" />
</svg>
Users
</h2>
<p>
Add new Users with sign-up links or simply create a new user in the admin panel.
</p>
</div>
<div class="feature-item">
<h2>
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M12,5.5A3.5,3.5 0 0,1 15.5,9A3.5,3.5 0 0,1 12,12.5A3.5,3.5 0 0,1 8.5,9A3.5,3.5 0 0,1 12,5.5M5,8C5.56,8 6.08,8.15 6.53,8.42C6.38,9.85 6.8,11.27 7.66,12.38C7.16,13.34 6.16,14 5,14A3,3 0 0,1 2,11A3,3 0 0,1 5,8M19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14C17.84,14 16.84,13.34 16.34,12.38C17.2,11.27 17.62,9.85 17.47,8.42C17.92,8.15 18.44,8 19,8M5.5,18.25C5.5,16.18 8.41,14.5 12,14.5C15.59,14.5 18.5,16.18 18.5,18.25V20H5.5V18.25M0,20V18.5C0,17.11 1.89,15.94 4.45,15.6C3.86,16.28 3.5,17.22 3.5,18.25V20H0M24,20H20.5V18.25C20.5,17.22 20.14,16.28 19.55,15.6C22.11,15.94 24,17.11 24,18.5V20Z" />
</svg>
Groups
</h2>
<p>
Sort users into groups to share recipes with the whole family, but keep your Meal Plans separate
</p>
</div>
<div class="feature-item">
<h2>
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M10.46,19C9,21.07 6.15,21.59 4.09,20.15C2.04,18.71 1.56,15.84 3,13.75C3.87,12.5 5.21,11.83 6.58,11.77L6.63,13.2C5.72,13.27 4.84,13.74 4.27,14.56C3.27,16 3.58,17.94 4.95,18.91C6.33,19.87 8.26,19.5 9.26,18.07C9.57,17.62 9.75,17.13 9.82,16.63V15.62L15.4,15.58L15.47,15.47C16,14.55 17.15,14.23 18.05,14.75C18.95,15.27 19.26,16.43 18.73,17.35C18.2,18.26 17.04,18.58 16.14,18.06C15.73,17.83 15.44,17.46 15.31,17.04L11.24,17.06C11.13,17.73 10.87,18.38 10.46,19M17.74,11.86C20.27,12.17 22.07,14.44 21.76,16.93C21.45,19.43 19.15,21.2 16.62,20.89C15.13,20.71 13.9,19.86 13.19,18.68L14.43,17.96C14.92,18.73 15.75,19.28 16.75,19.41C18.5,19.62 20.05,18.43 20.26,16.76C20.47,15.09 19.23,13.56 17.5,13.35C16.96,13.29 16.44,13.36 15.97,13.53L15.12,13.97L12.54,9.2H12.32C11.26,9.16 10.44,8.29 10.47,7.25C10.5,6.21 11.4,5.4 12.45,5.44C13.5,5.5 14.33,6.35 14.3,7.39C14.28,7.83 14.11,8.23 13.84,8.54L15.74,12.05C16.36,11.85 17.04,11.78 17.74,11.86M8.25,9.14C7.25,6.79 8.31,4.1 10.62,3.12C12.94,2.14 15.62,3.25 16.62,5.6C17.21,6.97 17.09,8.47 16.42,9.67L15.18,8.95C15.6,8.14 15.67,7.15 15.27,6.22C14.59,4.62 12.78,3.85 11.23,4.5C9.67,5.16 8.97,7 9.65,8.6C9.93,9.26 10.4,9.77 10.97,10.11L11.36,10.32L8.29,15.31C8.32,15.36 8.36,15.42 8.39,15.5C8.88,16.41 8.54,17.56 7.62,18.05C6.71,18.54 5.56,18.18 5.06,17.24C4.57,16.31 4.91,15.16 5.83,14.67C6.22,14.46 6.65,14.41 7.06,14.5L9.37,10.73C8.9,10.3 8.5,9.76 8.25,9.14Z" />
</svg>
Webhooks
</h2>
<p> Schedule webhooks to send notifications to 3rd party services with todays Meal Plan </p>
</div>
<div class="feature-item">
<h2>
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M7 7H5A2 2 0 0 0 3 9V17H5V13H7V17H9V9A2 2 0 0 0 7 7M7 11H5V9H7M14 7H10V17H12V13H14A2 2 0 0 0 16 11V9A2 2 0 0 0 14 7M14 11H12V9H14M20 9V15H21V17H17V15H18V9H17V7H21V9Z" />
</svg>
Open API
</h2>
<p> API Driven application gives you full control of the backend server with interactive documentation</p>
</div>
</div>
</section>
<!-- Custom narrow footer -->
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-social">
<a class="md-footer-social__link" href="https://github.com/hay-kot/mealie" rel="noopener" target="_blank" title="github.com">
<svg viewBox="0 0 480 512" xmlns="http://www.w3.org/2000/svg"><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"></path></svg>
</a>
<a class="md-footer-social__link" href="https://twitter.com/kot_hay" rel="noopener" target="_blank" title="twitter.com">
<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg>
</a>
<a class="md-footer-social__link" href="https://www.linkedin.com/in/hay-kot" rel="noopener" target="_blank" title="www.linkedin.com">
<svg viewBox="0 0 448 512" xmlns="http://www.w3.org/2000/svg"><path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"></path></svg>
</a>
</div>
</div>
{% endblock %}
{% block content %}{% endblock %}
{% block footer %}{% endblock %}

View file

@ -1,4 +1,7 @@
# Development Road Map
## Feature Requests
See the [Github META issue for tracking feature requests](https://github.com/hay-kot/mealie/issues/122)
See the [Github META issue for tracking the Road Map](https://github.com/hay-kot/mealie/issues/122)
## Progress
See the [Github Projects](https://github.com/hay-kot/mealie/projects) to see what is currently being worked on

View file

@ -2,13 +2,55 @@
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 available 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. Ad-hear 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] User Data
- [x] Group Data
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
![](../gifs/backup-demo-v1.gif)
## Custom Templating
## 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
},
"template": [
"recipes.md"
]
}'
```
### wget Example
Download a backup with `wget`
```bash
wget http://localhost:9000/api/backups/{file_name}/download
```
## 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

View file

@ -2,6 +2,7 @@
## Chowdown
To migrate recipes from a Chowdown
1. Download the code repository as a .zip file
2. Upload the .zip file in the Chowdown section in Mealie
3. Select import on the newly available migration.

View file

@ -0,0 +1,17 @@
# Site Settings
Your sites settings panel can only be accessed by administrators. This where you can customize your site for all users.
## Home Page Settings
| Option | Description |
| ------------------ | -------------------------------------------------------------- |
| Language | The default site language |
| Show Recent | To display the recent recipes section on the home page |
| Card Per Section | The amount of cards displayed in each section on the home page |
| Home Page Sections | Category sections to include on the home page |

View file

@ -0,0 +1,53 @@
# User Managemenet
As of version v0.4.0 users have limited functionality, but they will offer more permissions and structure as time goes on. To understand the different systems, see each section below. Note, that by default all users will be assigned the default group. If you're only managing one household you won't need to do anything to set up a new group.
!!! summary "Users and Groups"
=== ":fontawesome-solid-user-cog: Admins"
Mealie admins are super users that have access to all user data (excluding passwords). All admins can perform administrative tasks like adding users, resetting user passwords, backing up the database, migrating data, and managing site settings.
=== ":fontawesome-solid-user: Users"
A single user created by an Admin that has basic privileges to edit their profile, create and edit recipes.
=== ":fontawesome-solid-users: Groups"
User groups, or "family" groups are a collection of users that are associated together. Users belonging to the same group will share meal plans and webhook settings. This is currently the only feature of groups.
## Startup
On the first startup you'll need to login to Mealie using the default username and password `changeme@email.com` and `MyPassword` or the default set through the env variable. On first login you'll be required to reset your password. After resetting your password you should also change your email address as appropriate. This will be used for logins on all future requests.
!!! tip
Your default password environmental variable will be the default password for all new users that are created. This is stored in plain text and should not be used **any where** else.
## Creating and Editing Users
There are two ways to create users in Mealie.
### Manually Creating a User
In the Manage Users section you are able to create a user by providing the necessary information in the pop-up dialog.
- User Name
- Email
- User Group
- If they are an Admin
When creating users manually, their password will be set from the default assigned by the ENV variable.
### Sign Up Links
You can generate sign-up links in the Manage Users section. Select the "create link" button and provide the name of the link and if the user will be an administrator. Once a link is created it will populate in the table where you'll be able to see all active links, delete a link, and copy the link as needed.
!!! tip
When a link is used it is automatically removed from the database.
## Creating Groups
You can easily create and manage groups via the frontend in the admin panel under "Manage Users". Navigate to the groups tab and you'll find a "create group" button as well as a list of all groups in your database. To create a group, select the "create group" button and provide a name for the new group. Once created you can now assign users to the new group.
!!! tip
User Groups can only be deleted if no users are apart of the group. If you want to delete a group, you must assign the users to another group before removing.
## Password Reset
// TODO

View file

@ -0,0 +1,25 @@
# User Settings
A user will be able to access 3 sections in their admin panel. The user profile, themes, group/meal-plan settings section.
## Profile Settings
In as users profile they are able to
- Change Display Name
- Change Email
- Update Password
- View Their Group
- Upgrade Profile Picture (Experimental)
## Themes
Color themes can be created and set from the UI in the users settings page. You can select an existing color theme or create a new one. On creation of a new color theme, the default colors will be used, then you can select and save as you'd like. By default the "default" theme will be loaded for all new users visiting the site. All created color themes are available to all users of the site. Theme Colors will be set for both light and dark modes.
![](../gifs/theme-demo-v2.gif)
!!! tip
Theme data is stored in local storage in the browser. Calling "Save colors and apply theme will refresh the local storage with the selected theme as well save the theme to the database.
## Group & Meal Plan
In the meal planner section a user can select categories to be used as apart of the random recipe selector in the meal plan creator. If no categories are selected, all recipes will be used
Meal planner webhooks are post requests sent from Mealie to an external endpoint. The body of the message is the Recipe JSON of the scheduled meal. If no meal is schedule, no request is sent. The webhook functionality can be enabled or disabled as well as scheduled. Note that you must "Save" prior to any changes taking affect server side.

View file

@ -6,3 +6,36 @@
--md-accent-fg-color--light: #e58325;
--md-accent-fg-color--dark: #e58325;
}
body {
background: var(--md-primary-bg-color);
}
/* 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;
}
/* Site width etc.*/
.md-grid {
max-width: 64rem !important;
}
.md-typeset table:not([class]) th {
background-color: #e58325;
}
th {
font-weight: bold;
}

View file

@ -1,8 +1,13 @@
site_name: Mealie Docs
site_name: Mealie
theme:
custom_dir: docs/overrides
features:
- navigation.instant
- navigation.expand
- navigation.sections
- navigation.tabs
- navigation.tabs.sticky
favicon: img/favicon.png
name: material
icon:
@ -18,6 +23,9 @@ markdown_extensions:
- pymdownx.tasklist:
custom_checkbox: true
- admonition
- attr_list
- pymdownx.tabbed
- pymdownx.superfences
extra_css:
- stylesheets/custom.css
@ -25,19 +33,22 @@ repo_url: https://github.com/hay-kot/mealie
repo_name: hay-kot/mealie
nav:
- About The Project: "index.md"
- Home: "index.md"
- Getting Started:
- Introduction: "getting-started/introduction.md"
- Installation: "getting-started/install.md"
- Updating: "getting-started/updating.md"
- Working With Recipes: "getting-started/recipes.md"
- iOS Shortcuts: "getting-started/ios.md"
- User Management: "getting-started/users.md"
- Planning Meals: "getting-started/meal-planner.md"
- Site Settings: "getting-started/site-settings.md"
- Backups and Exports: "getting-started/backups-and-exports.md"
- Recipe Migration: "getting-started/migration-imports.md"
- API Reference:
- API Usage: "api/api-usage.md"
- API Documentation: "api/docs/index.html"
- iOS Shortcuts: "getting-started/ios.md"
- API Usage: "getting-started/api-usage.md"
- Site Administration:
- User Settings: "site-administration/user-settings.md"
- Site Settings: "site-administration/site-settings.md"
- User Management: "site-administration/user-management.md"
- Backups and Restore: "site-administration/backups-and-exports.md"
- Recipe Migration: "site-administration/migration-imports.md"
- API Reference: "api/redoc.md"
- Contributors Guide:
- Non-Code: "contributors/non-coders.md"
- Translating: "contributors/translating.md"
@ -46,4 +57,8 @@ nav:
- Dev Getting Started: "contributors/developers-guide/starting-dev-server.md"
- Guidelines: "contributors/developers-guide/general-guidelines.md"
- Development Road Map: "roadmap.md"
- Change Log: "changelog.md"
- Change Log:
- v0.4.0 Authentication: "changelog/v0.4.0.md"
- v0.3.0 Improvements: "changelog/v0.3.0.md"
- v0.2.0 Now With Tests!: "changelog/v0.2.0.md"
- v0.1.0 Beta: "changelog/v0.1.0.md"

View file

@ -3,9 +3,12 @@ from db.db_setup import generate_session
from fastapi import APIRouter, Depends
from schema.settings import SiteSettings
from schema.snackbar import SnackResponse
from schema.user import GroupInDB, UserInDB
from sqlalchemy.orm.session import Session
from utils.post_webhooks import post_webhooks
from routes.deps import manager
router = APIRouter(prefix="/api/site-settings", tags=["Settings"])
@ -27,7 +30,11 @@ def update_settings(data: SiteSettings, session: Session = Depends(generate_sess
@router.post("/webhooks/test")
def test_webhooks():
def test_webhooks(
current_user: UserInDB = Depends(manager),
session: Session = Depends(generate_session),
):
""" Run the function to test your webhooks """
group_entry: GroupInDB = db.groups.get(session, current_user.group, "name")
return post_webhooks()
return post_webhooks(group_entry.id, session)

View file

@ -27,7 +27,7 @@ class MealPlanIn(BaseModel):
meals: List[MealIn]
@validator("endDate")
def endDate_after_startDate(cls, v, values, **kwargs):
def endDate_after_startDate(v, values, config, field):
if "startDate" in values and v < values["startDate"]:
raise ValueError("EndDate should be greater than StartDate")
return v

View file

@ -0,0 +1,10 @@
from pydantic import BaseModel
class WebhookJob(BaseModel):
webhook_urls: list[str] = []
webhook_time: str = "00:00"
webhook_enable: bool
class Config:
orm_mode = True

View file

@ -1,7 +1,7 @@
from datetime import date, timedelta
from db.database import db
from schema.meal import MealIn, MealOut, MealPlanIn, MealPlanProcessed
from schema.meal import MealIn, MealOut, MealPlanIn, MealPlanInDB, MealPlanProcessed
from schema.recipe import Recipe
from sqlalchemy.orm.session import Session
@ -38,9 +38,9 @@ def process_meals(session: Session, meal_plan_base: MealPlanIn) -> MealPlanProce
def get_todays_meal(session):
meal_plan = db.meals.get_all(session, limit=1, order_by="startDate")
meal_plan: MealPlanInDB = db.groups.get(session, limit=1, order_by="startDate")
for meal in meal_plan:
for meal in meal_plan.meals:
meal: MealOut
if meal.date == date.today():
return meal.slug

View file

@ -1,32 +1,35 @@
from apscheduler.schedulers.background import BackgroundScheduler
from db.database import db
from db.db_setup import create_session
from fastapi.logger import logger
from schema.user import GroupInDB
from services.backups.exports import auto_backup_job
from services.scheduler.global_scheduler import scheduler
from services.scheduler.scheduler_utils import Cron, cron_parser
from fastapi.logger import logger
from schema.settings import SiteSettings
from db.database import db
from utils.post_webhooks import post_webhooks
# TODO Fix Scheduler
@scheduler.scheduled_job(trigger="interval", minutes=15)
@scheduler.scheduled_job(trigger="interval", minutes=30)
def update_webhook_schedule():
"""
A scheduled background job that runs every 15 minutes to
A scheduled background job that runs every 30 minutes to
poll the database for changes and reschedule the webhook time
"""
session = create_session()
settings = db.settings.get(session, "main")
settings = SiteSettings(**settings)
time = cron_parser(settings.webhooks.webhookTime)
job = JOB_STORE.get("webhooks")
all_groups: list[GroupInDB] = db.groups.get_all(session)
scheduler.reschedule_job(
job.scheduled_task.id,
trigger="cron",
hour=time.hours,
minute=time.minutes,
)
for group in all_groups:
time = cron_parser(group.webhook_time)
job = JOB_STORE.get(group.name)
scheduler.reschedule_job(
job.scheduled_task.id,
trigger="cron",
hour=time.hours,
minute=time.minutes,
)
session.close()
logger.info(scheduler.print_jobs())
@ -34,7 +37,12 @@ def update_webhook_schedule():
class ScheduledFunction:
def __init__(
self, scheduler: BackgroundScheduler, function, cron: Cron, name: str
self,
scheduler: BackgroundScheduler,
function,
cron: Cron,
name: str,
args: list = None,
) -> None:
self.scheduled_task = scheduler.add_job(
function,
@ -44,6 +52,7 @@ class ScheduledFunction:
minute=cron.minutes,
max_instances=1,
replace_existing=True,
args=args,
)
logger.info("New Function Scheduled")
@ -56,9 +65,35 @@ JOB_STORE = {
"backup_job": ScheduledFunction(
scheduler, auto_backup_job, Cron(hours=00, minutes=00), "backups"
),
"webhooks": ScheduledFunction(
scheduler, post_webhooks, Cron(hours=00, minutes=00), "webhooks"
),
}
def init_webhook_schedule(scheduler, job_store: dict):
session = create_session()
all_groups: list[GroupInDB] = db.groups.get_all(session)
for group in all_groups:
cron = cron_parser(group.webhook_time)
job_store.update(
{
group.name: ScheduledFunction(
scheduler,
post_webhooks,
cron=cron,
name=group.name,
args=[group.id],
)
}
)
session.close()
logger.info("Init Webhook Schedule \n", scheduler.print_jobs())
return job_store
JOB_STORE = init_webhook_schedule(scheduler=scheduler, job_store=JOB_STORE)
scheduler.start()

View file

@ -1,23 +1,35 @@
import json
from datetime import date
import requests
from db.database import db
from db.db_setup import create_session
from schema.settings import SiteSettings
from services.meal_services import get_todays_meal
from schema.meal import MealOut, MealPlanInDB
from schema.user import GroupInDB
from sqlalchemy.orm.session import Session
def post_webhooks():
session = create_session()
all_settings = db.get(session, 1)
all_settings = SiteSettings(**all_settings)
def post_webhooks(group: int, session: Session = None):
session = session if session else create_session()
group_settings: GroupInDB = db.groups.get(session, group)
if group_settings.webhook_enable:
today_slug = None
for mealplan in group_settings.mealplans:
mealplan: MealPlanInDB
for meal in mealplan.meals:
meal: MealOut
if meal.date == date.today():
today_slug = meal.slug
break
if not today_slug:
return
if all_settings.webhooks.enabled:
today_slug = get_todays_meal(session)
todays_meal = db.recipes.get(session, today_slug)
urls = all_settings.webhooks.webhookURLs
for url in urls:
requests.post(url, json.dumps(todays_meal, default=str))
for url in group_settings.webhook_urls:
requests.post(url, json=todays_meal.json())
session.close()