diff --git a/bin/bot.js b/bin/bot.js index 03298e4..8e0e670 100644 --- a/bin/bot.js +++ b/bin/bot.js @@ -1,6 +1,10 @@ import { Bot } from 'grammy'; +import * as fs from 'fs'; import { getIntroMessage, provideMenuWithGroceryList } from '../src/index.js'; -import { basicCookBook } from '../src/basicCookBook.js'; + +const basicRecipes = JSON + .parse(fs.readFileSync('./src/basicCookbook.json', 'utf-8')) + .recipes; const bot = new Bot(process.env.BOT_TOKEN); @@ -10,7 +14,7 @@ bot.command('start', async (ctx) => { }); bot.command('menu', async (ctx) => { - const menuWithGroceryList = provideMenuWithGroceryList(basicCookBook); + const menuWithGroceryList = provideMenuWithGroceryList(basicRecipes); await ctx.reply(menuWithGroceryList.menuText); await ctx.reply(menuWithGroceryList.groceryListText); diff --git a/src/basicCookBook.js b/src/basicCookBook.js deleted file mode 100644 index c8d458f..0000000 --- a/src/basicCookBook.js +++ /dev/null @@ -1,359 +0,0 @@ -// Basic meal list -const mealTypes = ['breakfast', 'snack', 'lunch', 'afternoonSnack', 'dinner']; -// Recipe: Less than 7 ingredients, less than 20 minutes cooking, wide-spread products -// Breakfasts -const peanutOvernightOatsBreakfast = { - name: 'Peanut Butter & Jelly Overnight Oats', - meal: ['breakfast'], - ingredients: [ - { name: 'rolled oats', amount: 50, unit: 'g' }, - { name: 'milk', amount: 100, unit: 'ml' }, - { name: 'greek yogurt', amount: 50, unit: 'g' }, - { name: 'cha seeds', amount: 5, unit: 'g' }, - { name: 'date syrup', amount: 15, unit: 'ml' }, - { name: 'vanilla extract', amount: 3, unit: 'ml' }, // Base ingredients - { name: 'strawberry jam', amount: 15, unit: 'ml' }, - { name: 'creamy peanut butter', amount: 15, unit: 'g' }, - { name: 'strawberry', amount: 50, unit: 'g' }, - { name: 'peanuts', amount: 40, unit: 'g' }, - ], - recipe: [ - 'Combine old fashioned oats, seeds, yoghurt and vanilla extract, sweetener and milk (it is convenient to make it in a glass) with all basic ingredients', - 'Cover it with a lid and chill in the fridge for at least two hours (better overnight)', - 'Grab a spoon, add you toppings and dig in!', - ], - cookingTimeInMinutes: 10, - nutrients: { - calories: 378, - carbohydrates: 54, - protein: 17, - fat: 11, - sodium: 0.08, - }, - storageTimeInHours: 120, -}; - -const appleOvernightOatsBreakfast = { - name: 'Apple pie Overnight Oats', - meal: ['breakfast'], - ingredients: [ - { name: 'rolled oats', amount: 50, unit: 'g' }, - { name: 'milk', amount: 100, unit: 'ml' }, - { name: 'greek yogurt', amount: 50, unit: 'g' }, - { name: 'cha seeds', amount: 5, unit: 'g' }, - { name: 'date syrup', amount: 15, unit: 'ml' }, - { name: 'vanilla extract', amount: 3, unit: 'ml' }, - { name: 'apple', amount: 100, unit: 'g' }, - { name: 'pecan', amount: 20, unit: 'g' }, - { name: 'maple syrup', amount: 40, unit: 'ml' }, - { name: 'cinnamon', amount: 5, unit: 'g' }, - ], - recipe: [ - 'Combine old fashioned oats, seeds, yoghurt and vanilla extract, sweetener and milk (it is convenient to make it in a glass) with all basic ingredients', - 'Cover it with a lid and chill in the fridge for at least two hours (better overnight)', - 'Grab a spoon, add you toppings and dig in!', - ], - cookingTimeInMinutes: 10, - nutrients: { - calories: 378, - carbohydrates: 54, - protein: 17, - fat: 11, - sodium: 0.08, - }, - storageTimeInHours: 120, -}; - -const bananaOvernightOatsBreakfast = { - name: 'Banana & Nutella Overnight Oats', - meal: ['breakfast'], - ingredients: [ - { name: 'rolled oats', amount: 50, unit: 'g' }, - { name: 'milk', amount: 100, unit: 'ml' }, - { name: 'greek yogurt', amount: 50, unit: 'g' }, - { name: 'cha seeds', amount: 5, unit: 'g' }, - { name: 'date syrup', amount: 15, unit: 'ml' }, - { name: 'vanilla extract', amount: 3, unit: 'ml' }, - { name: 'banana', amount: 60, unit: 'g' }, - { name: 'nutella', amount: 20, unit: 'g' }, - { name: 'hazelnuts', amount: 20, unit: 'g' }, - { name: 'chocolate', amount: 20, unit: 'g' }, - ], - cookingTimeInMinutes: 10, - nutrients: { - calories: 378, - carbohydrates: 54, - protein: 17, - fat: 11, - sodium: 0.08, - }, - recipe: [ - 'Combine old fashioned oats, seeds, yoghurt and vanilla extract, sweetener and milk (it is convenient to make it in a glass) with all basic ingredients', - 'Cover it with a lid and chill in the fridge for at least two hours (better overnight)', - 'Grab a spoon, add you toppings and dig in!', - ], - storageTimeInHours: 120, -}; - -// Snacks -const bambaSnack = { - name: 'Bamba', - meal: ['snack'], - ingredients: [ - { name: 'bamba', amount: 80, unit: 'g' }, - ], - nutrients: { - calories: 427, - carbohydrates: 39.2, - protein: 13.6, - fat: 24, - sodium: 0.03, - }, - cookingTimeInMinutes: 0, - recipe: [], - storageTimeInHours: 1200, -}; - -const peanutsSnack = { - name: 'Fried Peanuts', - meal: ['snack'], - ingredients: [ - { name: 'peanuts', amount: 44, unit: 'g' }, - ], - nutrients: { - calories: 237, - carbohydrates: 7.1, - protein: 9.7, - fat: 21, - sodium: 0.04, - }, - cookingTimeInMinutes: 0, - recipe: [], - storageTimeInHours: 1200, -}; - -// Lunch -const chickenSaladLunch = { - name: 'Light Chicken Salad', - meal: ['lunch'], - ingredients: [ - { name: 'cooked chicken breast', amount: 200, unit: 'g' }, - { name: 'mixed greens (spinach, lettuce, arugula)', amount: 150, unit: 'g' }, - { name: 'cherry tomatoes, halved', amount: 100, unit: 'g' }, - { name: 'cucumber, sliced', amount: 80, unit: 'g' }, - { name: 'red onion, thinly sliced', amount: 50, unit: 'g' }, - { name: 'olive oil', amount: 15, unit: 'ml' }, - { name: 'lemon juice', amount: 10, unit: 'ml' }, - { name: 'salt and pepper, to taste', amount: undefined }, // Поскольку не указано количество, оно будет undefined - ], - cookingTimeInMinutes: 15, - nutrients: { - calories: 320, - carbohydrates: 10, - protein: 35, - fat: 15, - sodium: 0.2, - }, - recipe: [ - 'In a large bowl, combine cooked chicken breast, mixed greens, cherry tomatoes, cucumber, and red onion.', - 'Drizzle olive oil and lemon juice over the salad. Season with salt and pepper according to your taste.', - 'Toss the salad gently to combine all the ingredients. Serve immediately or refrigerate for later use.', - ], - storageTimeInHours: 48, -}; - -const chickenAvocadoToastLunch = { - name: 'Chicken Avocado Toast', - meal: ['lunch'], - ingredients: [ - { name: 'cooked chicken breast, shredded', amount: 150, unit: 'g' }, - { name: 'avocado, mashed', amount: 1, unit: 'unit' }, - { name: 'whole grain bread slices', amount: 2, unit: 'unit' }, - { name: 'cherry tomatoes, sliced', amount: 50, unit: 'g' }, - { name: 'fresh basil leaves', amount: 10, unit: 'g' }, - { name: 'olive oil', amount: 10, unit: 'ml' }, - { name: 'salt and pepper, to taste', amount: undefined }, // Поскольку не указано количество, оно будет undefined - ], - cookingTimeInMinutes: 15, - nutrients: { - calories: 380, - carbohydrates: 25, - protein: 30, - fat: 18, - sodium: 0.3, - }, - recipe: [ - 'Toast the whole grain bread slices until they are crispy and golden brown.', - 'Spread mashed avocado evenly on the toasted bread slices.', - 'Top with shredded chicken, sliced cherry tomatoes, and fresh basil leaves.', - 'Drizzle with olive oil and season with salt and pepper according to your taste.', - 'Serve immediately or refrigerate for later consumption.', - ], - storageTimeInHours: 24, -}; - -// Afternoon snack -const lemonPossetAfternoonSnack = { - name: 'Lemon Posset', - meal: ['afternoonSnack'], - ingredients: [ - { name: 'lemon', amount: 1, unit: 'unit' }, - { name: 'sugar', amount: 50, unit: 'g' }, - { name: 'heavy cream (33%)', amount: 200, unit: 'ml' }, - ], - nutrients: { - calories: 215.8, - carbohydrates: 15, - protein: 1.6, - fat: 16.7, - }, - recipe: [ - "For this dessert, you'll need lemons. More specifically, lemon juice. One lemon should yield about 70ml of juice.", - "You'll also need heavy cream and sugar. The higher the quality and fat content of the cream (I used 33%), the thicker your posset will be.", - 'Pour the cream into a saucepan, add sugar, bring to a boil, and keep it on the heat for 3 minutes, stirring continuously.', - 'Now turn off the heat, pour in the lemon juice, vigorously stirring the mixture. The cream will start to thicken. Taste it, and if necessary, add more lemon juice or sugar. The posset should be sweet, creamy, with a distinct lemon flavor.', - 'Let the mixture cool for about 5 minutes, then chill for at least 3-5 hours, preferably overnight. If you plan to serve it as a standalone dessert, divide it into individual molds, cover with plastic wrap, and refrigerate. Serve with crispy cookies or wafers. If serving as ice cream, freeze it.', - 'Posset is also used as a filling for cakes; in that case, chill it in the refrigerator for several hours.', - ], - storageTimeInHours: 78, -}; - -// Dinner -const grilledSalmonDinner = { - name: 'Grilled Salmon with Vegetables', - meal: ['dinner'], - ingredients: [ - { name: 'salmon fillet', amount: 150, unit: 'g' }, - { name: 'asparagus spears', amount: 100, unit: 'g' }, - { name: 'bell peppers (assorted colors), sliced', amount: 150, unit: 'g' }, - { name: 'zucchini, sliced', amount: 100, unit: 'g' }, - { name: 'olive oil', amount: 15, unit: 'ml' }, - { name: 'garlic powder', amount: 5, unit: 'g' }, - { name: 'lemon zest', amount: 5, unit: 'g' }, - { name: 'salt', amount: 2, unit: 'g' }, - { name: 'pepper', amount: 2, unit: 'g' }, - ], - cookingTimeInMinutes: 20, - nutrients: { - calories: 380, - carbohydrates: 12, - protein: 35, - fat: 22, - sodium: 0.2, - }, - recipe: [ - 'Preheat the grill to medium-high heat. Season salmon fillet with garlic powder, lemon zest, salt, and pepper.', - 'In a bowl, toss asparagus, bell peppers, and zucchini with olive oil, salt, and pepper.', - 'Grill salmon fillet for 4-5 minutes per side, or until it flakes easily with a fork. At the same time, grill the vegetables until tender and slightly charred, about 3-4 minutes per side.', - 'Remove salmon and vegetables from the grill. Serve hot with a side of your choice or refrigerate for later consumption.', - ], - storageTimeInHours: 48, -}; - -const onePotChickenAndRice = { - name: 'One Pot Chicken and Rice', - meal: ['dinner'], - ingredients: [ - { name: 'paprika', amount: 0.5, unit: 'tsp' }, - { name: 'dried oregano', amount: 0.25, unit: 'tsp' }, - { name: 'dried thyme', amount: 0.25, unit: 'tsp' }, - { name: 'garlic powder', amount: 0.13, unit: 'tsp' }, - { name: 'onion powder', amount: 0.13, unit: 'tsp' }, - { name: 'salt', amount: 0.06, unit: 'tsp' }, - { name: 'pepper', amount: 0.06, unit: 'tsp' }, - { name: 'boneless, skinless chicken thighs', amount: 0.31, unit: 'lbs' }, - { - name: 'cooking oil', amount: 0.5, unit: 'Tbsp', divided: true, - }, - { - name: 'yellow onion', amount: 0.25, unit: 'unit', diced: true, - }, - { - name: 'long-grain white rice', amount: 0.25, unit: 'cup', uncooked: true, - }, - { name: 'vegetable broth', amount: 0.44, unit: 'cups' }, - { - name: 'chopped parsley', amount: 0.25, unit: 'Tbsp', optional: true, garnish: true, - }, - ], - instructions: [ - 'Combine the paprika, oregano, thyme, garlic powder, onion powder, salt, and pepper in a small bowl.', - 'Coat both sides of the chicken thighs in the seasoning mix.', - 'Add 0.5 Tbsp cooking oil to a deep skillet and heat over medium. Once hot, swirl to coat the surface of the skillet, then add the chicken thighs.', - 'Cook the thighs for a few minutes on each side, or until well browned. The chicken does not need to be cooked through at this point.', - 'Remove the browned chicken to a clean plate.', - 'Reduce the heat to medium-low, add an additional 0.5 Tbsp cooking oil to the skillet, then add the diced onion. Sauté the onion for about 5 minutes, or until softened. Allow the moisture from the onion to dissolve the browned bits from the skillet as you stir.', - 'Add the uncooked rice to the skillet and continue to sauté for 1-2 minutes more to toast the rice.', - 'Add the vegetable broth to the skillet and briefly stir to dissolve any remaining brown bits from the bottom of the skillet.', - 'Return the chicken to the skillet, setting it on top of the rice. Place a lid on the skillet, turn the heat up to medium-high, and allow the broth to come up to a full boil.', - 'Once boiling, turn the heat down to low and let the chicken and rice continue to simmer over low, without lifting the lid or stirring, for 20 minutes.', - 'After 20 minutes, turn off the heat and let it rest, without lifting the lid, for an additional 5 minutes.', - 'Finally, remove the lid and fluff the rice around the chicken. Garnish with chopped parsley, if desired, then serve and enjoy!', - ], - cookingTimeInMinutes: 40, - nutrients: { - servingSize: '1 serving', - calories: 421, - carbohydrates: 42, - protein: 31, - fat: 13, - sodium: 688, - fiber: 2, - }, - storageTimeInHours: 72, -}; - -const tunaPastaDinner = { - name: 'Tuna Pasta with Tomato Sauce', - meal: ['dinner'], - ingredients: [ - { name: 'canned tuna in water, drained', amount: 200, unit: 'g' }, - { name: 'spaghetti or your favorite pasta', amount: 150, unit: 'g' }, - { name: 'olive oil', amount: 15, unit: 'ml' }, - { name: 'garlic clove, minced', amount: 1, unit: 'unit' }, - { name: 'canned crushed tomatoes', amount: 200, unit: 'g' }, - { name: 'dried basil', amount: 3, unit: 'g' }, - { name: 'dried oregano', amount: 3, unit: 'g' }, - { name: 'red pepper flakes, optional', amount: 2, unit: 'g' }, - { name: 'salt and black pepper', amount: 2, unit: 'g' }, - { name: 'fresh parsley, chopped (for garnish)', amount: 30, unit: 'g' }, - { name: 'grated Parmesan cheese (optional, for serving)', amount: 30, unit: 'g' }, - ], - cookingTimeInMinutes: 20, - nutrients: { - calories: 380, - carbohydrates: 50, - protein: 25, - fat: 10, - sodium: 1, - }, - recipe: [ - 'Cook the pasta according to the package instructions. Drain and set aside.', - 'In a large skillet, heat olive oil over medium heat. Add minced garlic and sauté until fragrant.', - 'Add canned crushed tomatoes, dried basil, dried oregano, red pepper flakes (if using), salt, and black pepper. Simmer the sauce for 10-12 minutes, stirring occasionally.', - 'Add the drained canned tuna to the tomato sauce. Stir gently to combine and let it simmer for an additional 2-3 minutes until the tuna is heated through.', - 'Toss the cooked pasta in the skillet with the tuna and tomato sauce until well coated.', - 'Serve hot, garnished with chopped fresh parsley and grated Parmesan cheese if desired.', - ], - storageTimeInHours: 48, -}; - -// Export menu -const basicCookBook = [ - peanutOvernightOatsBreakfast, - appleOvernightOatsBreakfast, - bananaOvernightOatsBreakfast, - bambaSnack, - peanutsSnack, - lemonPossetAfternoonSnack, - chickenSaladLunch, - grilledSalmonDinner, - onePotChickenAndRice, - chickenAvocadoToastLunch, - tunaPastaDinner, -]; - -export { - mealTypes, - basicCookBook, -}; diff --git a/src/basicCookbook.json b/src/basicCookbook.json new file mode 100644 index 0000000..368c585 --- /dev/null +++ b/src/basicCookbook.json @@ -0,0 +1,682 @@ +{ + "mealTypes": [ + "breakfast", + "snack", + "lunch", + "afternoonSnack", + "dinner" + ], + "recipes": [ + { + "name": "Peanut Butter & Jelly Overnight Oats", + "meal": [ + "breakfast" + ], + "ingredients": [ + { + "name": "rolled oats", + "amount": 50, + "unit": "g" + }, + { + "name": "milk", + "amount": 100, + "unit": "ml" + }, + { + "name": "greek yogurt", + "amount": 50, + "unit": "g" + }, + { + "name": "cha seeds", + "amount": 5, + "unit": "g" + }, + { + "name": "date syrup", + "amount": 15, + "unit": "ml" + }, + { + "name": "vanilla extract", + "amount": 3, + "unit": "ml" + }, + { + "name": "strawberry jam", + "amount": 15, + "unit": "ml" + }, + { + "name": "creamy peanut butter", + "amount": 15, + "unit": "g" + }, + { + "name": "strawberry", + "amount": 50, + "unit": "g" + }, + { + "name": "peanuts", + "amount": 40, + "unit": "g" + } + ], + "recipe": [ + "Combine old fashioned oats, seeds, yoghurt and vanilla extract, sweetener and milk (it is convenient to make it in a glass) with all basic ingredients", + "Cover it with a lid and chill in the fridge for at least two hours (better overnight)", + "Grab a spoon, add your toppings and dig in!" + ], + "cookingTimeInMinutes": 10, + "nutrients": { + "calories": 378, + "carbohydrates": 54, + "protein": 17, + "fat": 11, + "sodium": 0.08 + }, + "storageTimeInHours": 120 + }, + { + "name": "Apple Pie Overnight Oats", + "meal": [ + "breakfast" + ], + "ingredients": [ + { + "name": "rolled oats", + "amount": 50, + "unit": "g" + }, + { + "name": "milk", + "amount": 100, + "unit": "ml" + }, + { + "name": "greek yogurt", + "amount": 50, + "unit": "g" + }, + { + "name": "cha seeds", + "amount": 5, + "unit": "g" + }, + { + "name": "date syrup", + "amount": 15, + "unit": "ml" + }, + { + "name": "vanilla extract", + "amount": 3, + "unit": "ml" + }, + { + "name": "apple", + "amount": 100, + "unit": "g" + }, + { + "name": "pecan", + "amount": 20, + "unit": "g" + }, + { + "name": "maple syrup", + "amount": 40, + "unit": "ml" + }, + { + "name": "cinnamon", + "amount": 5, + "unit": "g" + } + ], + "recipe": [ + "Combine old fashioned oats, seeds, yoghurt and vanilla extract, sweetener and milk (it is convenient to make it in a glass) with all basic ingredients", + "Cover it with a lid and chill in the fridge for at least two hours (better overnight)", + "Grab a spoon, add your toppings and dig in!" + ], + "cookingTimeInMinutes": 10, + "nutrients": { + "calories": 378, + "carbohydrates": 54, + "protein": 17, + "fat": 11, + "sodium": 0.08 + }, + "storageTimeInHours": 120 + }, + { + "name": "Banana & Nutella Overnight Oats", + "meal": [ + "breakfast" + ], + "ingredients": [ + { + "name": "rolled oats", + "amount": 50, + "unit": "g" + }, + { + "name": "milk", + "amount": 100, + "unit": "ml" + }, + { + "name": "greek yogurt", + "amount": 50, + "unit": "g" + }, + { + "name": "cha seeds", + "amount": 5, + "unit": "g" + }, + { + "name": "date syrup", + "amount": 15, + "unit": "ml" + }, + { + "name": "vanilla extract", + "amount": 3, + "unit": "ml" + }, + { + "name": "banana", + "amount": 60, + "unit": "g" + }, + { + "name": "nutella", + "amount": 20, + "unit": "g" + }, + { + "name": "hazelnuts", + "amount": 20, + "unit": "g" + }, + { + "name": "chocolate", + "amount": 20, + "unit": "g" + } + ], + "cookingTimeInMinutes": 10, + "nutrients": { + "calories": 378, + "carbohydrates": 54, + "protein": 17, + "fat": 11, + "sodium": 0.08 + }, + "recipe": [ + "Combine old fashioned oats, seeds, yoghurt and vanilla extract, sweetener and milk (it is convenient to make it in a glass) with all basic ingredients", + "Cover it with a lid and chill in the fridge for at least two hours (better overnight)", + "Grab a spoon, add your toppings and dig in!" + ], + "storageTimeInHours": 120 + }, + { + "name": "Bamba", + "meal": [ + "snack" + ], + "ingredients": [ + { + "name": "bamba", + "amount": 80, + "unit": "g" + } + ], + "nutrients": { + "calories": 427, + "carbohydrates": 39.2, + "protein": 13.6, + "fat": 24, + "sodium": 0.03 + }, + "cookingTimeInMinutes": 0, + "recipe": [], + "storageTimeInHours": 1200 + }, + { + "name": "Fried Peanuts", + "meal": [ + "snack" + ], + "ingredients": [ + { + "name": "peanuts", + "amount": 44, + "unit": "g" + } + ], + "nutrients": { + "calories": 237, + "carbohydrates": 7.1, + "protein": 9.7, + "fat": 21, + "sodium": 0.04 + }, + "cookingTimeInMinutes": 0, + "recipe": [], + "storageTimeInHours": 1200 + }, + { + "name": "Lemon Posset", + "meal": [ + "afternoonSnack" + ], + "ingredients": [ + { + "name": "lemon", + "amount": 1, + "unit": "unit" + }, + { + "name": "sugar", + "amount": 50, + "unit": "g" + }, + { + "name": "heavy cream (33%)", + "amount": 200, + "unit": "ml" + } + ], + "nutrients": { + "calories": 215.8, + "carbohydrates": 15, + "protein": 1.6, + "fat": 16.7 + }, + "recipe": [ + "For this dessert, you'll need lemons. More specifically, lemon juice. One lemon should yield about 70ml of juice.", + "You'll also need heavy cream and sugar. The higher the quality and fat content of the cream (I used 33%), the thicker your posset will be.", + "Pour the cream into a saucepan, add sugar, bring to a boil, and keep it on the heat for 3 minutes, stirring continuously.", + "Now turn off the heat, pour in the lemon juice, vigorously stirring the mixture. The cream will start to thicken. Taste it, and if necessary, add more lemon juice or sugar. The posset should be sweet, creamy, with a distinct lemon flavor.", + "Let the mixture cool for about 5 minutes, then chill for at least 3-5 hours, preferably overnight. If you plan to serve it as a standalone dessert, divide it into individual molds, cover with plastic wrap, and refrigerate. Serve with crispy cookies or wafers. If serving as ice cream, freeze it.", + "Posset is also used as a filling for cakes; in that case, chill it in the refrigerator for several hours." + ], + "storageTimeInHours": 78 + }, + { + "name": "Light Chicken Salad", + "meal": [ + "lunch" + ], + "ingredients": [ + { + "name": "cooked chicken breast", + "amount": 200, + "unit": "g" + }, + { + "name": "mixed greens (spinach, lettuce, arugula)", + "amount": 150, + "unit": "g" + }, + { + "name": "cherry tomatoes, halved", + "amount": 100, + "unit": "g" + }, + { + "name": "cucumber, sliced", + "amount": 80, + "unit": "g" + }, + { + "name": "red onion, thinly sliced", + "amount": 50, + "unit": "g" + }, + { + "name": "olive oil", + "amount": 15, + "unit": "ml" + }, + { + "name": "lemon juice", + "amount": 10, + "unit": "ml" + }, + { + "name": "salt and pepper, to taste", + "amount": "undefined" + } + ], + "cookingTimeInMinutes": 15, + "nutrients": { + "calories": 320, + "carbohydrates": 10, + "protein": 35, + "fat": 15, + "sodium": 0.2 + }, + "recipe": [ + "In a large bowl, combine cooked chicken breast, mixed greens, cherry tomatoes, cucumber, and red onion.", + "Drizzle olive oil and lemon juice over the salad. Season with salt and pepper according to your taste.", + "Toss the salad gently to combine all the ingredients. Serve immediately or refrigerate for later use." + ], + "storageTimeInHours": 48 + }, + { + "name": "Chicken Avocado Toast", + "meal": [ + "lunch" + ], + "ingredients": [ + { + "name": "cooked chicken breast, shredded", + "amount": 150, + "unit": "g" + }, + { + "name": "avocado, mashed", + "amount": 1, + "unit": "unit" + }, + { + "name": "whole grain bread slices", + "amount": 2, + "unit": "unit" + }, + { + "name": "cherry tomatoes, sliced", + "amount": 50, + "unit": "g" + }, + { + "name": "fresh basil leaves", + "amount": 10, + "unit": "g" + }, + { + "name": "olive oil", + "amount": 10, + "unit": "ml" + }, + { + "name": "salt and pepper, to taste", + "amount": "undefined" + } + ], + "cookingTimeInMinutes": 15, + "nutrients": { + "calories": 380, + "carbohydrates": 25, + "protein": 30, + "fat": 18, + "sodium": 0.3 + }, + "recipe": [ + "Toast the whole grain bread slices until they are crispy and golden brown.", + "Spread mashed avocado evenly on the toasted bread slices.", + "Top with shredded chicken, sliced cherry tomatoes, and fresh basil leaves.", + "Drizzle with olive oil and season with salt and pepper according to your taste.", + "Serve immediately or refrigerate for later consumption." + ], + "storageTimeInHours": 24 + }, + { + "name": "Grilled Salmon with Vegetables", + "meal": [ + "dinner" + ], + "ingredients": [ + { + "name": "salmon fillet", + "amount": 150, + "unit": "g" + }, + { + "name": "asparagus spears", + "amount": 100, + "unit": "g" + }, + { + "name": "bell peppers (assorted colors), sliced", + "amount": 150, + "unit": "g" + }, + { + "name": "zucchini, sliced", + "amount": 100, + "unit": "g" + }, + { + "name": "olive oil", + "amount": 15, + "unit": "ml" + }, + { + "name": "garlic powder", + "amount": 5, + "unit": "g" + }, + { + "name": "lemon zest", + "amount": 5, + "unit": "g" + }, + { + "name": "salt", + "amount": 2, + "unit": "g" + }, + { + "name": "pepper", + "amount": 2, + "unit": "g" + } + ], + "cookingTimeInMinutes": 20, + "nutrients": { + "calories": 380, + "carbohydrates": 12, + "protein": 35, + "fat": 22, + "sodium": 0.2 + }, + "recipe": [ + "Preheat the grill to medium-high heat. Season salmon fillet with garlic powder, lemon zest, salt, and pepper.", + "In a bowl, toss asparagus, bell peppers, and zucchini with olive oil, salt, and pepper.", + "Grill salmon fillet for 4-5 minutes per side, or until it flakes easily with a fork. At the same time, grill the vegetables until tender and slightly charred, about 3-4 minutes per side.", + "Remove salmon and vegetables from the grill. Serve hot with a side of your choice or refrigerate for later consumption." + ], + "storageTimeInHours": 48 + }, + { + "name": "One Pot Chicken and Rice", + "meal": [ + "dinner" + ], + "ingredients": [ + { + "name": "paprika", + "amount": 0.5, + "unit": "tsp" + }, + { + "name": "dried oregano", + "amount": 0.25, + "unit": "tsp" + }, + { + "name": "dried thyme", + "amount": 0.25, + "unit": "tsp" + }, + { + "name": "garlic powder", + "amount": 0.13, + "unit": "tsp" + }, + { + "name": "onion powder", + "amount": 0.13, + "unit": "tsp" + }, + { + "name": "salt", + "amount": 0.06, + "unit": "tsp" + }, + { + "name": "pepper", + "amount": 0.06, + "unit": "tsp" + }, + { + "name": "boneless, skinless chicken thighs", + "amount": 0.31, + "unit": "lbs" + }, + { + "name": "cooking oil", + "amount": 0.5, + "unit": "Tbsp", + "divided": true + }, + { + "name": "yellow onion", + "amount": 0.25, + "unit": "unit", + "diced": true + }, + { + "name": "long-grain white rice", + "amount": 0.25, + "unit": "cup", + "uncooked": true + }, + { + "name": "vegetable broth", + "amount": 0.44, + "unit": "cups" + }, + { + "name": "chopped parsley", + "amount": 0.25, + "unit": "Tbsp", + "optional": true, + "garnish": true + } + ], + "instructions": [ + "Combine the paprika, oregano, thyme, garlic powder, onion powder, salt, and pepper in a small bowl.", + "Coat both sides of the chicken thighs in the seasoning mix.", + "Add 0.5 Tbsp cooking oil to a deep skillet and heat over medium. Once hot, swirl to coat the surface of the skillet, then add the chicken thighs.", + "Cook the thighs for a few minutes on each side, or until well browned. The chicken does not need to be cooked through at this point.", + "Remove the browned chicken to a clean plate.", + "Reduce the heat to medium-low, add an additional 0.5 Tbsp cooking oil to the skillet, then add the diced onion. Sauté the onion for about 5 minutes, or until softened. Allow the moisture from the onion to dissolve the browned bits from the skillet as you stir.", + "Add the uncooked rice to the skillet and continue to sauté for 1-2 minutes more to toast the rice.", + "Add the vegetable broth to the skillet and briefly stir to dissolve any remaining brown bits from the bottom of the skillet.", + "Return the chicken to the skillet, setting it on top of the rice. Place a lid on the skillet, turn the heat up to medium-high, and allow the broth to come up to a full boil.", + "Once boiling, turn the heat down to low and let the chicken and rice continue to simmer over low, without lifting the lid or stirring, for 20 minutes.", + "After 20 minutes, turn off the heat and let it rest, without lifting the lid, for an additional 5 minutes.", + "Finally, remove the lid and fluff the rice around the chicken. Garnish with chopped parsley, if desired, then serve and enjoy!" + ], + "cookingTimeInMinutes": 40, + "nutrients": { + "servingSize": "1 serving", + "calories": 421, + "carbohydrates": 42, + "protein": 31, + "fat": 13, + "sodium": 688, + "fiber": 2 + }, + "storageTimeInHours": 72 + }, + { + "name": "Tuna Pasta with Tomato Sauce", + "meal": [ + "dinner" + ], + "ingredients": [ + { + "name": "canned tuna in water, drained", + "amount": 200, + "unit": "g" + }, + { + "name": "spaghetti or your favorite pasta", + "amount": 150, + "unit": "g" + }, + { + "name": "olive oil", + "amount": 15, + "unit": "ml" + }, + { + "name": "garlic clove, minced", + "amount": 1, + "unit": "unit" + }, + { + "name": "canned crushed tomatoes", + "amount": 200, + "unit": "g" + }, + { + "name": "dried basil", + "amount": 3, + "unit": "g" + }, + { + "name": "dried oregano", + "amount": 3, + "unit": "g" + }, + { + "name": "red pepper flakes, optional", + "amount": 2, + "unit": "g" + }, + { + "name": "salt and black pepper", + "amount": 2, + "unit": "g" + }, + { + "name": "fresh parsley, chopped (for garnish)", + "amount": 30, + "unit": "g" + }, + { + "name": "grated Parmesan cheese (optional, for serving)", + "amount": 30, + "unit": "g" + } + ], + "cookingTimeInMinutes": 20, + "nutrients": { + "calories": 380, + "carbohydrates": 50, + "protein": 25, + "fat": 10, + "sodium": 1 + }, + "recipe": [ + "Cook the pasta according to the package instructions. Drain and set aside.", + "In a large skillet, heat olive oil over medium heat. Add minced garlic and sauté until fragrant.", + "Add canned crushed tomatoes, dried basil, dried oregano, red pepper flakes (if using), salt, and black pepper. Simmer the sauce for 10-12 minutes, stirring occasionally.", + "Add the drained canned tuna to the tomato sauce. Stir gently to combine and let it simmer for an additional 2-3 minutes until the tuna is heated through.", + "Toss the cooked pasta in the skillet with the tuna and tomato sauce until well coated.", + "Serve hot, garnished with chopped fresh parsley and grated Parmesan cheese if desired." + ], + "storageTimeInHours": 48 + } + ] +} + diff --git a/src/index.js b/src/index.js index 7ba314c..2040ca9 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,9 @@ -import { mealTypes } from './basicCookBook.js'; +import * as fs from 'fs'; import capitalize from './utils.js'; +// +const { mealTypes } = JSON + .parse(fs.readFileSync('./src/basicCookbook.json', 'utf-8')); + // Get welcome messages const getIntroMessage = (type) => { const welcomeMessage = "Hi! Let me introduce you 'Bity Smarty' – a special bot that can provide a healthy diet and a grocery list for your next shopping.\n\n";