A meals manager built with Next.js and Tailwind CSS.
- Node.js 10 or later
- MacOS, Windows (including WSL), and Linux are supported
- Clone the repo
git clone https://github.com/maelquerre/meals
- Install dependencies
npm install
Start Next.js in development mode:
npm run dev
This starts a development server on http://localhost:3000.
Build the application for production usage:
npm run build
Build and export the app to static HTML, which can be run standalone without the need of a Node.js server:
npm run export
A static version of the app will be built in the out
directory.
On the homepage, add the food groups you already ate for different meals in the different days. Click on the 'Generate meals' button to generate the recommendations. You can choose to not enter any meal before generating the recommendations, it will just generate all the meals for you.
On the settings page (cogwheel button in the top bar), you can set some preferences for the meals that will be generated:
- How much you eat: for setting the minimum or maximum portions you'll want to have.
- What you eat and when: for setting your eating habits for the different meals.
The styles are written in PostCSS to improve development efficiency.
meals/
components/ # JSX components
data/ # Simple js data
model/ # The Meal class
pages/ # The pages of the app
api/ # The API of the app
public/ # Public assets
styles/ # App styles
views/ # Main views of the app
utils.js # Javascript utility functions
The intakes are an array of intake objects. Each intake object is defined with a specific day, meal, foodGroup ID and portions.
intakes: [
{
day: 'monday',
meal: 'breakfast',
foodGroupId: 1,
portions: 1
}
]
Portions preferences are quantities of food groups that are preferred to be eaten within a day or a week.
The Project's API gives recommendations as default portions preferences, based on PNNS.
Recommendations
recommendations: [
{
foodGroupId: 1,
min: 5,
period: 'day'
},
{
foodGroupId: 2,
min: 2,
period: 'week'
},
{
foodGroupId: 3,
min: 1,
period: 'day'
},
{
foodGroupId: 4,
max: 1,
period: 'week'
},
{
foodGroupId: 5,
max: 1,
period: 'week'
},
{
foodGroupId: 6,
min: 1,
max: 2,
period: 'day'
},
{
foodGroupId: 7,
max: 5,
period: 'week'
},
{
foodGroupId: 8,
max: 2,
period: 'week'
},
{
foodGroupId: 9,
min: 2,
period: 'day'
}
]
Included preferences are food groups that are preferred to eat at specific meals.
includedPreferences: [
{
meal: 'breakfast',
foodGroupId: 1
},
{
meal: 'lunch',
foodGroupId: 7
}
]