nyok / mydiet Goto Github PK
View Code? Open in Web Editor NEWDiet tracking site prototype
Diet tracking site prototype
Now: Each meal item is recorded separately.
Example: Buckwheat with chicken breast
meal table
id | product_id | datetime | portion |
---|---|---|---|
56 | 10 | 2022-12-06 19:21:40 | 110 |
57 | 16 | 2022-12-06 19:22:13 | 120 |
products table
id | title | proteins | fats | carbohydrates | calories |
---|---|---|---|---|---|
10 | Chicken breast boiled | 21.00 | 2.50 | 0.00 | 110.00 |
16 | Boiled buckwheat (1 buckwheat + 2 water) | 4.00 | 1.14 | 21.40 | 117.00 |
But what to do with more complex dishes (soups, salads)
Example: Crab salad consisting of 3 ingredients.
List Products
id | title | proteins | fats | carbohydrates | calories |
---|---|---|---|---|---|
14 | Egg | 12.70 | 11.50 | 0.70 | 157.10 |
27 | Crab sticks | 9.50 | 0.10 | 13.30 | 92.00 |
28 | Sweet corn | 2.87 | 0.60 | 9.90 | 57.80 |
Salad ingredients
products | grams | proteins | fats | carbohydrates | calories |
---|---|---|---|---|---|
4 Egg | 280 | 35.56 | 32.2 | 1.96 | 439.88 |
Crab sticks | 250 | 23.75 | 0.25 | 33.25 | 230.00 |
Sweet corn | 140 | 4.02 | 0.84 | 13.86 | 80.92 |
Sum | 670 | 63.33 | 33.29 | 49.07 | 750.80 |
Result
products | grams | proteins | fats | carbohydrates | calories |
---|---|---|---|---|---|
Crab salad | 100 | 9.45 | 4.97 | 7.32 | 112.06 |
Now
The query takes the nutritional value of each meal from the database and
maximum, total (today), balance (load) nutritional value โ contained in the code and converted using php (multiplied, summed, subtracted)
Need to do
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.