Current version: v1.6.6-snapshot
FoodPlanner is a Web App for managing your meal plans for the week, your recipes, your shopping list and your pantry ingredients. You can find more screenshots at the bottom of the page.
You need to follow these steps to install FoodPlanner.
.env.local
in the project root folder. Override the db credentials found in .env
. If you want to
install the app on your production server, set APP_ENV=prod
. (See Symfony Documentation.)/public/
. This is the folder where all publically available assets, i.e.
JavaScript files, images, etc. are located.composer install
and npm install
to install dependencies.npm run watch
to build the CSS/JavaScript files. They should appear in /public/build/
. If not, check the
TypeScript and Webpack Encore configurations.composer dump-env prod
, which will produce a file
called .env.local.php
.php bin/console cache:clear
.php bin/console doctrine:migrations:migrate
.symfony server:start
to run the app.There is not much that is left to set up.
https://localhost/install
.Enjoy using FoodPlanner!
If there is a newer version available in the Release section, download the files and override everything in your project
folder. Usually it should be sufficient to build the new CSS/JS files with npm run watch
and to migrate new migrations
with php bin/console doctrine:migrations:migrate
. If there are any issues, try clearing the cache.
When updating from a version lower than v1.6 to v1.6, all image files for recipes will be renamed and reuploaded, so it might be a good idea to create a backup of the image folder beforehand.
Also, note that v1.6.1 introduces a new migration Version20230101000000.php
that replaces the SQL file with the
basic database setup of earlier versions. If there are problems with migrating, consider clearing the database first,
migrating and manually re-inserting the previous data.
FoodPlanner can be used alone or in a household. If you want to use the app with more than one user, note the following:
Apart from that, the app should really be self-explanatory.
Everyone is welcome to contribute to FoodPlanner. If you think of a new feature, feel free to open a new issue to discuss your idea! There is a JIRA board for current open tasks in the project, see https://viseryn.atlassian.net/jira/software/projects/FP/boards/1.
If you have a bug fix or cool new feature and want to merge it, create a pull request into the develop
branch.
A new feature/bugfix/update should be implemented in a corresponding branch from develop
, and ideally be linked to
some JIRA ticket, e.g. ticket/FP-xx/title-of-the-jira-ticket
.
See https://viseryn.atlassian.net/jira/software/projects/FP/boards/1 for all planned features and bugfixes. Among them:
When all tickets for a planned released have been resolved, follow these steps:
master
and develop
branches. On the develop
branch, the version number will be updated to the next snapshot version number.v1.6.3
).develop
branch.
If a hotfix is merged, then a new release (e.g. v1.6.3-hotfix.1
) needs to be built with the same steps as above.FoodPlanner is built with React and Symfony.
FoodPlanner's backend is built on Symfony (https://symfony.com/what-is-symfony) for PHP. All relevant files for that are
located in the src
folder and can basically be divided in Controllers, Entities and Services.
Each controller class represents a collection of APIs for one entity.
For example, the RecipeController
defines RESTful APIs for GET (a list of all recipes), POST (for adding new recipes),
and so on. Each method represents one API endpoint.
One exception is the DefaultController
, whose only task is to route every request (except API requests) to the
React frontend.
Every entity class is linked to a database table and kept sync via Doctrine ORM. If an entity is supposed to be made accessible for an API, there should be a corresponding data transfer object (DTO) that defines in a controlled way what will be visible. Each entity also has a corresponding repository class with standard methods to retrieve data from the database. Some entities might have a form type class; see Symfony documentation.
Service classes provide utility methods for controller classes and therefore contain most of the business logic.
The frontend is built with React. All corresponding files are located in the /assets/
folder, and the entry point of
the app is /assets/app.tsx
, which renders the App
component into the root div container in the default template,
which is loaded by the DefaultController
.
The App
component is the main component of FoodPlanner and is located in /assets/layouts/
. It manages global state,
such as recipes, meals, etc., and fetches the data using the useFetch
hook. It also manages the configurations for the
sidebar (i.e., the navigation bar) and the topbar (the secondary navigation). The most important part however is the
routing. In the BrowserRouter
component, the different page components are displayed depending on the current browser
URL. Each page component is in the folder /assets/pages/
. For example, on the route https://localhost/shoppinglist
,
the component /assets/pages/ShoppingList/ShoppingList.tsx
is rendered. Each page component gets the global state
passed as props.
In the /assets/components/
folder, all shared components, like Buttons, Cards and Form Widgets, are stored.
The /assets/hooks/
folder is for all custom hooks like useFetch
. The /assets/layouts/
folder is for all components
that are related to the actual page layout, like App
, Sidebar
or Topbar
. The /assets/styles/
and /assets/util/
folders are for CSS and other util files.
Note that in the /assets/
folder, there is also a types.d.ts
file which contains all type definitions for more
complex objects.