From c8284eaeee6d992ad8f5767f13c0ab6be5975a2b Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Tue, 30 Mar 2021 18:12:48 -0800 Subject: [PATCH] General Frontend Bug Fixes for v0.4.0 RC (#233) * comment * add frontend-build command * address #211 * fix margins * fix import bug * await user updates * fix meal-plan filter * meal-plan search redesign * improve mobile search * fix sidebar update * fix category auto-completes * draft new pages * fix tag auto completes * refactor export const * dispatch evens for CRUD operations * recipe loaders screen * create category dialog Co-authored-by: hay-kot --- .gitignore | 36 +++++++++ docs/docs/getting-started/install.md | 30 ++++++- .../getting-started/organizing-recipes.md | 4 + .../site-administration/building-pages.md | 3 + docs/mkdocs.yml | 1 + frontend/src/App.vue | 12 ++- frontend/src/api/api-utils.js | 2 + frontend/src/api/backup.js | 4 +- frontend/src/api/category.js | 35 ++++++++- frontend/src/api/groups.js | 2 +- frontend/src/api/index.js | 53 ++++++------- frontend/src/api/mealplan.js | 2 +- frontend/src/api/meta.js | 2 +- frontend/src/api/migration.js | 2 +- frontend/src/api/recipe.js | 9 +-- frontend/src/api/settings.js | 2 +- frontend/src/api/signUps.js | 2 +- frontend/src/api/siteSettings.js | 2 +- frontend/src/api/themes.js | 2 +- frontend/src/api/upload.js | 2 +- frontend/src/api/users.js | 2 +- .../Admin/General/HomePageSettings.vue | 3 + .../Admin/General/NewCategoryDialog.vue | 78 +++++++++++++++++++ .../Admin/ManageUsers/TheSignUpTable.vue | 25 +++--- .../Admin/ManageUsers/TheUserTable.vue | 4 +- .../src/components/MealPlan/MealPlanNew.vue | 35 +++++---- .../components/Recipe/RecipeEditor/index.vue | 31 ++++---- .../Recipe/RecipeViewer/RecipeChips.vue | 17 ++++ .../src/components/UI/Search/SearchBar.vue | 51 +++++++++--- .../src/components/UI/Search/SearchDialog.vue | 59 +++++--------- .../src/pages/Admin/MealPlanner/index.vue | 2 +- frontend/src/pages/Admin/Profile/index.vue | 1 + frontend/src/pages/HomePage.vue | 2 +- frontend/src/pages/Recipe/ViewRecipe.vue | 20 ++++- frontend/src/pages/Recipes/CategoryPage.vue | 2 +- frontend/src/pages/Recipes/CustomPage.vue | 2 +- frontend/src/store/index.js | 14 +++- frontend/src/store/modules/userSettings.js | 5 ++ makefile | 5 +- mealie/db/models/recipe/category.py | 4 +- mealie/routes/backup_routes.py | 2 +- mealie/routes/recipe/all_recipe_routes.py | 6 +- mealie/routes/recipe/category_routes.py | 11 ++- mealie/routes/recipe/tag_routes.py | 6 +- mealie/schema/category.py | 8 +- template.env | 3 +- 46 files changed, 440 insertions(+), 165 deletions(-) create mode 100644 docs/docs/getting-started/organizing-recipes.md create mode 100644 frontend/src/components/Admin/General/NewCategoryDialog.vue diff --git a/.gitignore b/.gitignore index 8eadb1fb9..e222af271 100644 --- a/.gitignore +++ b/.gitignore @@ -156,3 +156,39 @@ mealie/data/debug/last_recipe.json *.sqlite dev/data/db/test.db scratch.py +frontend/dist/favicon.ico +frontend/dist/index.html +frontend/dist/css/app.29fe0155.css +frontend/dist/css/chunk-vendors.db944396.css +frontend/dist/fonts/materialdesignicons-webfont.7a44ea19.woff2 +frontend/dist/fonts/materialdesignicons-webfont.64d4cf64.eot +frontend/dist/fonts/materialdesignicons-webfont.147e3378.woff +frontend/dist/fonts/materialdesignicons-webfont.174c02fc.ttf +frontend/dist/fonts/roboto-latin-100.5cb7edfc.woff +frontend/dist/fonts/roboto-latin-100.7370c367.woff2 +frontend/dist/fonts/roboto-latin-100italic.f8b1df51.woff2 +frontend/dist/fonts/roboto-latin-100italic.f9e8e590.woff +frontend/dist/fonts/roboto-latin-300.b00849e0.woff +frontend/dist/fonts/roboto-latin-300.ef7c6637.woff2 +frontend/dist/fonts/roboto-latin-300italic.4df32891.woff +frontend/dist/fonts/roboto-latin-300italic.14286f3b.woff2 +frontend/dist/fonts/roboto-latin-400.60fa3c06.woff +frontend/dist/fonts/roboto-latin-400.479970ff.woff2 +frontend/dist/fonts/roboto-latin-400italic.51521a2a.woff2 +frontend/dist/fonts/roboto-latin-400italic.fe65b833.woff +frontend/dist/fonts/roboto-latin-500.020c97dc.woff2 +frontend/dist/fonts/roboto-latin-500.87284894.woff +frontend/dist/fonts/roboto-latin-500italic.288ad9c6.woff +frontend/dist/fonts/roboto-latin-500italic.db4a2a23.woff2 +frontend/dist/fonts/roboto-latin-700.2735a3a6.woff2 +frontend/dist/fonts/roboto-latin-700.adcde98f.woff +frontend/dist/fonts/roboto-latin-700italic.81f57861.woff +frontend/dist/fonts/roboto-latin-700italic.da0e7178.woff2 +frontend/dist/fonts/roboto-latin-900.9b3766ef.woff2 +frontend/dist/fonts/roboto-latin-900.bb1e4dc6.woff +frontend/dist/fonts/roboto-latin-900italic.28f91510.woff +frontend/dist/fonts/roboto-latin-900italic.ebf6d164.woff2 +frontend/dist/js/app.36f2760c.js +frontend/dist/js/app.36f2760c.js.map +frontend/dist/js/chunk-vendors.c93761e4.js +frontend/dist/js/chunk-vendors.c93761e4.js.map diff --git a/docs/docs/getting-started/install.md b/docs/docs/getting-started/install.md index 0b2378aa7..3f2aaf113 100644 --- a/docs/docs/getting-started/install.md +++ b/docs/docs/getting-started/install.md @@ -55,8 +55,7 @@ services: | TZ | UTC | Must be set to get correct date/time on the server | -## Deployed as a Python Application -Alternatively, this project is built on Python and SQLite. If you are dead set on deploying on a linux machine you can run this in an python virtual env. Provided that you know thats how you want to host the application, I'll assume you know how to do that. I may or may not get around to writing this guide. I'm open to pull requests if anyone has a good guide on it. + ## Advanced !!! warning "Not Required" @@ -88,4 +87,29 @@ The Docker image provided by Mealie contains both the API and the html bundle in } } -``` \ No newline at end of file +``` + +## Deployed without Docker +!!! error "Unsupported Deployment" + If you are experiencing a problem with manual deployment, please do not submit a github issue unless it is related to an aspect of the application. For deployment help, the [discord server](https://discord.gg/R6QDyJgbD2) is a better place to find support. + +Alternatively, this project is built on Python and SQLite so you may run it as a python application on your server. This is not a supported options for deployment and is only here as a reference for those who would like to do this on their own. To get started you can clone this repository into a directory of your choice and use the instructions below as a reference for how to get started. + +There are three parts to the Mealie application + +- Frontend/Static Files +- Backend API +- Proxy Server + +### Frontend/ Static Files +The frontend static files are generated with `npm run build`. This is done during the build process with docker. If you choose to deploy this as a system application you must do this process yourself. In the project directory run `cd frontend` to change directories into the frontend directory and run `npm install` and then `npm run build`. This will generate the static files in a `dist` folder in the frontend directory. + +### Backend API +The backend API is build with Python, FastAPI, and SQLite and requires Python 3.9, and Poetry. Once the requirements are installed, in the project directory you can run the command `poetry install` to create a python virtual environment and install the python dependencies. + +Once the dependencies are installed you should be ready to run the server. To initialize that database you need to first run `python mealie/db/init_db.py`. Then to start The web server, you run the command `uvicorn mealie.app:app --host 0.0.0.0 --port 9000` + + +### Proxy Server +You must use a proxy server to server up the static files created with `npm run build` and proxy requests to the API. In the docker build this is done with Caddy. You can use the CaddyFile in the section above as a reference. One important thing to keep in mind is that you should drop any trailing `/` in the url. Not doing this may result in failed API requests. + diff --git a/docs/docs/getting-started/organizing-recipes.md b/docs/docs/getting-started/organizing-recipes.md new file mode 100644 index 000000000..9a4090743 --- /dev/null +++ b/docs/docs/getting-started/organizing-recipes.md @@ -0,0 +1,4 @@ +# Organizing Recipes + +!!! tip + Below is a suggestion of guidelines my wife and I use for organizing our recipes within Mealie. Mealie is fairly flexible, so feel free to utilize how you'd like! 👍 \ No newline at end of file diff --git a/docs/docs/site-administration/building-pages.md b/docs/docs/site-administration/building-pages.md index 77c525ad4..269423ab8 100644 --- a/docs/docs/site-administration/building-pages.md +++ b/docs/docs/site-administration/building-pages.md @@ -1,5 +1,8 @@ # Building Pages +!!! warning + The page building is still experimental and may change. You can provide feedback on any changes you'd like to see on [github](https://github.com/hay-kot/mealie/discussions/229) + Custom pages can be created to organize multiple categories into a single page. Links to your custom pages are displayed on the home page sidebar and accessible by all users, however only Administrators can create or update pages. To create a new page. Navigate to the settings page at `/admin/settings` and scroll down to the custom pages section. Here you can create, view, and edit your custom pages. To reorder how they are displayed on the sidebar you can drag and drop the pages into the preferred order. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index e61268a5e..a61eb1e0a 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -39,6 +39,7 @@ nav: - Installation: "getting-started/install.md" - Updating: "getting-started/updating.md" - Working With Recipes: "getting-started/recipes.md" + - Organizing Recipes: "getting-started/organizing-recipes.md" - Planning Meals: "getting-started/meal-planner.md" - iOS Shortcuts: "getting-started/ios.md" - API Usage: "getting-started/api-usage.md" diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 7169d457b..a186c07f3 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,13 +1,13 @@