1. Trang chủ
  2. » Mẫu Slide

Báo cáo phân tích phát triển website menu dinh dưỡng khoa học sử dụng trí tuệ nhân tạo

128 1 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Developing a Scientific Nutrition Menu Website Using Artificial Intelligence
Tác giả Duong Thi Huyen Trang
Người hướng dẫn PhD. Nguyen Dang Khoa
Trường học Vietnam National University, Hanoi International School
Chuyên ngành Informatics and Computer Engineering
Thể loại Graduation Project
Năm xuất bản 2023
Thành phố Hanoi
Định dạng
Số trang 128
Dung lượng 12,91 MB

Cấu trúc

  • CHAPTER I: OVERVIEW OF THE TOPIC (16)
    • 1.1 Background of The Topic (16)
    • 1.2 Problem Statement (16)
    • 1.3 Objectives of The Topic (16)
    • 1.4 Methodology (17)
    • 1.5 Research Objects (17)
    • 1.6 Scope and Limitation (18)
      • 1.5.1. Scope (18)
      • 1.5.2. Limitations (18)
    • 1.7 Conclusion (18)
  • CHAPTER II: LITERATURE REVIEW (20)
    • 2.1. Introduction and Concepts (20)
      • 2.1.1. Definition of Websites (20)
      • 2.1.2. Artificial Intelligence (21)
      • 2.1.3. Nutrition (22)
    • 2.2. Review of Existing Nutrition Websites (34)
      • 2.2.1. Lose It! Website (34)
      • 2.2.2. Nutrino Website (34)
      • 2.2.3. Lifesum Website (35)
    • 2.3. Machine Learning (37)
      • 2.3.1. Machine Learning vs Artificial Intelligence vs Deep Learning (38)
      • 2.3.2. Types of Machine Learning (39)
      • 2.3.3. Applications of Machine Learning (40)
      • 2.3.4. Roles of Artificial Intelligence (AI) in Nutrition (40)
    • 2.4. Conclusion (43)
  • CHAPTER III: SYSTEM ARCHITECTURE AND DEVELOPMENT (44)
    • 3.1. The Problem of Planning a Menu Scientifically (44)
      • 3.1.1. State The Problem (44)
      • 3.1.2. Directions for Solving This Problems (44)
    • 3.2. Software Development and Technologies (46)
      • 3.2.1. Frontend Development (46)
      • 3.2.2. Backend Development (52)
      • 3.2.3. Database management (53)
    • 3.3. Artificial Intelligence Model (67)
      • 3.3.1. Recommendation System (67)
      • 3.3.2. Data Collection and Preprocessing (74)
      • 3.3.3. Training and Validation (84)
      • 3.3.4. Deployment and Integration (90)
    • 3.4. Conclusion (91)
  • CHAPTER IV: SYSTEM DESIGN (92)
    • 4.1. System Model (92)
    • 4.2. Usecase diagram (93)
      • 4.2.1. General use case diagram (93)
      • 4.2.2. Login usecase diagram (94)
      • 4.2.3. Shopping Cart and Order usecase diagram (95)
      • 4.2.4. Meal usecase diagram (96)
      • 4.2.5. Package usecase diagram (96)
      • 4.2.6. Contact management usecase diagram (97)
      • 4.2.7. User management usecase diagram (98)
      • 4.2.8. Meal management usecase diagram (99)
      • 4.2.9. Food management usecase diagram (100)
      • 4.2.10. Order management usecase diagram (100)
      • 4.2.11. Package Management usecase diagram (101)
    • 4.3. Sequence diagram (102)
      • 4.3.1. Sequence Diagram Login (102)
      • 4.3.2. Sequence Diagram Manage Shopping Cart (103)
      • 4.3.3. Sequence Diagram Manage Contact (104)
      • 4.3.4. Sequence Diagram Manage User (105)
      • 4.3.5. Sequence Diagram Manage Order (106)
      • 4.3.6. Sequence Diagram Manage Meal (107)
    • 4.4. System Interface Design (108)
      • 4.4.1. Home Page Interface (108)
      • 4.4.2. About GoodFood (108)
      • 4.4.3. Meal Page Interface (109)
      • 4.4.4. Consult Page Interface (109)
      • 4.4.5. Pricing Page Interface (111)
      • 4.4.6. Shopping Cart Interface (111)
      • 4.4.7. Order Page Interface (112)
      • 4.4.8. Contact Page Interface (113)
      • 4.4.9. Meal Management Interface (113)
      • 4.4.10. Food Management Interface (114)
      • 4.4.11. Order Management Interface (115)
      • 4.4.12. Package Management Interface (115)
      • 4.4.13. Transaction Management Interface (116)
      • 4.4.14. Contact Management Interface (116)
    • 4.5. Conclusion (117)
  • CHAPTER V: INSTALL WEBSITE (118)
    • 5.1. Run Frontend Project Installation and Run Guide using Next.js (118)
      • 5.1.1. Overview (118)
      • 5.1.2. Prerequisites (118)
      • 5.1.3. Additional Commands (119)
    • 5.2. Backend Server Configuration Guide using Nest.js (119)
      • 5.2.1. Prerequisites (119)
      • 5.2.2. Additional Commands (120)
    • 5.3. AI Training Script (120)

Nội dung

The intersection of nutritional science and technology offers a revolutionary possibility in the field of health and wellness. The present topic explores the creation of a novel website that utilizes artificial intelligence (AI) to generate personalized, science-based nutritious menus based on user needs. The innovative platform is designed to revolutionize individuals'''' approaches to their dietary habits. It utilizes AI algorithms to analyze a wide range of data, incorporating personal health metrics, dietary preferences, and the latest findings in nutritional research. The site''''s core functionality is built around an AI engine capable of interpreting complex dietary requirements and generating personalized meal plans. To guarantee that every menu item is nutritionally tailored to each user''''s specific health state Additionally, an interactive interface on the website enables customers to enter information and instantly receive meal recommendations that are high in nutrients. In addition to promoting long-term healthy eating habits, this function aims to inform users about their nutritional needs. Moreover, the platform also offers services through a monthly subscription model. Thorough testing stages were incorporated into the development process to guarantee precision, ease of use, and adherence to nutritional recommendations. In order to make and deliver meals according to planned schedules, the organization also works with restaurants and other culinary partners. In the nexus of artificial intelligence, digital technology, and nutritional research, this website marks a substantial advancement. It offers to provide a technologically advanced, scientifically supported, and user-centric tool for improving nutritional health and well-being. This could prove beneficial to a diverse range of users, catering to individuals with specific dietary requirements as well as those seeking to adopt healthier lifestyles

OVERVIEW OF THE TOPIC

Background of The Topic

In recent years, the integration of nutrition science and technology has become increasingly prominent, driven by a growing awareness of the importance of personalized meal planning for health and wellness It is not simple to create a scientifically sound nutritional plan that meets the individual demands of every person, though However, traditional methods of meal planning often lack the customization needed to cater to individual nutritional requirements, preferences, and health conditions This makes using cutting-edge technology, such as artificial intelligence (AI), necessary to address this issue

That's why the concept of “Developing a scientific nutrition menu website using artificial intelligence” has emerged Leveraging AI technologies presents an opportunity to offer customized dietary recommendations based on individual health profiles, preferences, and goals.

Problem Statement

The problem lies in the complexity of sorting through extensive nutritional data to create personalized scientific nutrition meal plans Without personalized guidance, individuals may struggle to navigate through the abundance of information available Leading to confusion, ineffective dietary choices, or difficulty in achieving their health objectives Moreover, it highlights a common problem faced by many people

- a lack of time for cooking due to their busy lives, which can result in unhealthy dietary habits and long-term health issues

Therefore, the need for an AI-powered platform that can interpret user-specific data, to generate scientifically backed nutrition menus arises.

Objectives of The Topic

The main objective of the project is to create a user-friendly website, that leverages artificial intelligence (AI) algorithms to offer personalized nutrition meal recommendations The aim is to enhance accessibility, accuracy, and customization in the meal of nutrition By tailoring meals to each user's individual health profile Moreover, the website provides a service through a monthly meal subscription model Users have the option to receive meals every day, giving them the freedom to suit their own needs and tastes Essentially, it integrates customized meal planning and delivery Providing customers with easy access to wholesome meals even with hectic schedules.

Methodology

The methods to implement the project “Developing a scientific nutrition menu website using artificial intelligence” are:

• Search and analyze the document related to the topic

• Selected techniques and develop the system

• Data collection and processing method

• User interface and experience design considaration

• Continuos to improve the system

In the thesis report consist of 5 chapters, orgainzed as follows:

• Chapter I introduces an overview of the topic, including: background of the topic, problem statement, objective of the topic, research methods, research objects, scope, and limitations of the topic

• Chapter II introduces the literature review of this topic In this part, the concepts of websites, artificial intelligence, and nutrition are mentioned, along with an overview of existing literature on nutrition websites and what machine learning is

• Chapter III introduces system architecture and development, which consist of the problems of planning a menu scientifically, software development and technologies, and the artificial intelligence model

• Chapter IV introduces system design In this chapter, I presented the system model, use case diagram, sequence diagram, and system interface design

• Finally, Chapter V introduces installed on the website In this chapter, I presented how to run frontend project installation and run guides using Next.js, backend server configuration guides using Nest.js, and an AI training model.

Research Objects

The research objects are individuals who will interact with the website to receive personalized nutritional menu recommendations Specifically, research objects include:

• Healthy Adults: Those who wish to maintain, gain, or lose weight in addition to improving their general health

• Individuals with particular nutritional needs: Those with hectic schedules, little time for cooking, finicky eaters, or health issues who wish to enhance their dietary.

Scope and Limitation

The scope of this project focuses on the development of an AI-driven website that can analyze various parameters, based on a platform for user data input and calorie generation The website will integrate a comprehensive nutritional database containing information on food composition, calorie content Training AI algorithms to analyze user data and generate personalized meal plans based on pre-defined dietary goals and constraints

When implementing the project, I will face some limitations:

Firstly, the accuracy of the AI recommendations heavily relies on the quality and comprehensiveness of the input data There's a need for constant updating of the database to reflect the latest nutritional research

Secondly, ensuring user data privacy and security is also another significant challenge

Thirdly, the effectiveness of the website is also dependent on the users' engagement and their honesty in reporting health and dietary data

Furthermore, the AI model's predictions are only as good as the algorithms and dataset they are trained on, which might not capture the complexity and nuances of human nutrition fully

Finally, technological limitations and the need for continuous updates and improvements to refine AI algorithms for greater accuracy and relevance.

Conclusion

In summary, employing artificial intelligence to create a scientific nutrition menu website presents a viable solution to the issue of tailored dietary recommendations Despite the possible limitations, this project has the potential to transform the way people approach nutritious meals, supporting improved health outcomes through informed nutritional choices even when customers are busy Continuously screening and assessing user feedback will be crucial in improving the platform's effectiveness and relevancy over time.

LITERATURE REVIEW

Introduction and Concepts

A website is a collection of web pages tied to one another within the same domain, including varied information that visitors may access quickly and conveniently as long as they have an internet connection The site is made up of many components such as photographs, text, sound, video, animation, and graphics, depending on the website's purpose [1]

Websites typically have one main page offering general information, known as the homepage When you first open a web page, you will see the homepage From here, you can explore the website's different features [1]

Websites can be divided into two broad categories that:

Each website's objective will guide in deciding what type of website to create To further comprehend the distinction between the two, we'll look at what it means when a website is static or dynamic [2]

A static website is relatively simple in terms of design and operation, often providing a single purpose Static websites provide the same content and appearance for all visitors, regardless of browser, location, or device Static web pages cannot accept visitor input, but they may have animations and clickable components such as hyperlinks or navigation buttons This makes them an attractive option for portfolio and catalog websites [2]

A dynamic website's content and look can change depending on a variety of circumstances, such as the time of day, the visitor's location, language preferences, and previous interactions with the site

This makes the dynamic website type best suited for eCommerce businesses, social media, ticket booking, and forums [2] shopee.vn is a common example of a dynamic website Its front page displays product recommendations based on visitors' locations, purchases, and search history

A website may include both static and dynamic web pages Typically, these websites feature static, unchanging information pages such as About and Contact Us, alongside dynamic sections like the product catalog, news feed, and main page [2]

The definition of Artificial Intelligence (AI) involves the examination of intelligent behavior in humans, animals, and machines, with the goal of engineering such behavior in any form of artifact It stands as one of the most challenging and arguably the most thrilling enterprises ever undertaken by humanity [3]

One intriguing aspect of the artificial intelligence (AI) field is the challenging task of precisely defining its subject matter This challenge involves two interconnected parts: understanding the nature of the artificial and, equally essential, having a suitable comprehension of intelligence The term "artificial" in artificial intelligence is undoubtedly linked to its origins and creation through human contrivance and ingenuity, as opposed to arising naturally, especially through biological or evolutionary processes In essence, artificially intelligent entities differ from naturally intelligent ones, functioning as artifacts endowed with specific properties not typically found in non-artifacts Therefore, these entities possess a certain property (intelligence) as a result of a specific process (creation, design, or manufacturing) [4]

Advantages and disadvantages of Artificial Intelligence (AI)

Artificial intelligence offers numerous advantages, one notable benefit being its ability to make decisions grounded in factual information rather than emotional influences It is widely acknowledged that human decisions are invariably susceptible to emotional biases, even when we strive to make the best choices

Advantages of Artificial Intelligence (AI)

The remarkable advantages of artificial intelligence have the potential to bring about transformative changes for the better, propelling us into a new era in the history of artificial robotics The following are the key benefits of Artificial Intelligence (AI) [5]

• Completed the work quicker than a human,

• Easily finish complex and stressful task,

• Perform difficult work in a short amount of time,

• Numerous tasks can be completed simultaneously,

• A high success percentage, fewer task mistakes and defects overall,

• Increased productivity in a short amount of time,

• Compute long-term and complex problems and find uncharted territory [5]

Disadvantages of Artificial Intelligence (AI)

Here are some of the main disadvantages of artificial intelligence (AI) in our daily lives:

• There is a risk of abuse, potentially leading to widespread devastation

• Program mismatch occurs when actions deviate from the intended commands

• Poses a threat to human employment opportunities

• The issue of unemployment has increasing

• A programmer's creativity is dependent on them

• A younger generation that is more indolent

• Demand a great deal of time and money

Nutrition is a branch of science that studies the nutrients found in foods and their effects on the body Nutrition is also an important aspect of health and wellness Proper nutrition aids in the development and maintenance of healthy bodies, as well as the prevention of future ailments Nutrition and nutritional information are dealt with through several concepts such as calories, kilocalories, essential nutrients, and non-essential nutrients, macronutrients and micronutrients [6]

The energy balance equation summarizes energy consumption and expenditure, as well as any changes in the body's energy storage (e.g., fat, protein, glycogen):

Energy consumed – Energy expended = Change in energy stores

• The elements of the equation are often denoted in units such as kilocalories (kcal), kilojoules (kJ), or megajoules (MJ), typically presented per unit of time, such as kcal per day

• 1 kcal = 4.184 kJ, and 1 kJ = 0.239 kcal

• The International System of Units recommends the use of kJ and MJ as units; nevertheless, kcal, a measure of heat, is commonly employed [7]

As indicated by the above equation, energy requirements are directly related to energy expenditure This is determined by factors influencing basal metabolic rate, including body size, age, gender, and level of physical activity For instance, the estimated average needs (EARs) for energy intake in the United Kingdom (2011) are outlined in Table 2.1 [7]

Table 2.1 Estimated Average Requirement (EAR) values for energy intake among adults in the United Kingdom [7]

* The median physical activity level was employed, with a value of 1.63 The conversion factors used were 1 kcal = 4.184 kJ and 1 kJ = 0.239 kcal

The term "nutrient" refers to any substance derived from food that facilitates growth, development, or homeostasis What sets nutrients apart from medications or other beneficial non-nutrient chemicals is their integration into functional or structural molecules within the body Nutrients are categorized as either essential or non-essential [7]

Essential nutrients are incapable of being synthesized by the body from other substances and must be acquired through dietary sources Examples include essential fatty acids, essential amino acids, vitamins, and specific dietary minerals A nutritionally complete diet provides adequate amounts of each essential component, ensuring normal growth, development, and homeostasis without causing deficiency or toxicity [7]

Review of Existing Nutrition Websites

Today, as society evolves, we face greater problems in maintaining a healthy and balanced lifestyle Calorie management, food selection, and scientific menu planning have all become crucial aspects of daily life, particularly for individuals concerned about their health

In fact, there have been a number of websites on the menu for users to integrate artificial intelligence (AI) Examples of Popular Nutrition Websites:

Best for those who want a structured approach with gamification and strong tracking features May not be suitable for those who need more personalized guidance or those with disordered eating

• Website: https://www.loseit.com/

• Strengths: Easy-to-use interface, large and active community, good for people with specific weight loss goals

• Weaknesses: Less emphasis on nutrition education and overall health, can be gamified to the point of unhealthy competition

Ideal for individuals seeking personalized nutrition plans and detailed nutrient analysis The subscription model might be a barrier for some users

• Website: https://www.nutrinohealth.com/

• Strengths: Science-backed approach, focuses on individual needs, provides detailed nutritional insights

• Weaknesses: Can be expensive, requires genetic testing for full personalization, not as strong on community features

A good choice for those who enjoy social interaction and want a user-friendly meal planning tool Accuracy of calorie information in recipes could be improved [12]

• Strengths: Holistic approach to health, encourages healthy eating habits beyond calorie counting, user-friendly interface

• Weaknesses: Less focus on weight loss than Lose It!, not as personalized as

Feature Lose It! Nutrinohealth Lifesum

Main focus Weight loss and calorie counting

Personalized nutrition and health coaching

Simple and friendly healthy eating

Detailed nutrient breakdowns, food recommendations

Meal plans Yes, custom plans available with premium

Yes, personalized plans for specific goals

Yes, pre-made and custom plans available

Coaching No Yes, paid subscription includes coaching

Community Active community forums and challenges

Pricing Free with ads, premium memberships

Free with ads, premium membership

Well- established, large user base, freemium model with premium features

Emerging platform, focus on personalized nutrition, subscription-based

Growing app, focus on social interaction and meal planning, freemium model

Gamified approach, focus on daily calorie goals and tracking, large food database, progress charts

Personalized meal plans based on health goals and preferences, extensive nutrient breakdown, recipe recommendations

Social features like challenges and recipe sharing, meal planner with grocery list integration, barcode scanner

Studies show significant weight loss and improved health markers with consistent use

Strong emphasis on personalized nutrition, potential for better long- term adherence

Focus on healthy habits and behavior change, may not be as effective for rapid weight loss

Can be overly focused on calorie counting, may not be suitable for everyone (e.g., disordered eating)

Limited user base and data, subscription model may deter some users

Can be distracting with social features, accuracy of calorie information in recipes may vary

Machine Learning

Machine Learning (ML) is a branch of artificial intelligence (AI) dedicated to developing computer algorithms that enhance their performance autonomously through experience and data analysis In essence, machine learning enables computers to learn from data, enabling them to make decisions or predictions without requiring explicit programming for each specific task [13]

TensorFlow and PyTorch are two frameworks commonly employed to expedite the development of machine learning algorithms [13]

2.3.1 Machine Learning vs Artificial Intelligence vs Deep Learning

Artificial intelligence and deep learning are sometimes mistaken with machine learning Let's see how these terms differ from one another Check out comparative guides on AI versus machine learning and machine learning vs deep learning for a more in-depth look [13]

Artificial Intelligence refers to the development of programs that behave intelligently and replicate human intellect using a set of algorithms In order to achieve optimum efficiency, the field concentrates on three skills: learning, reasoning, and self-correction AI can refer to either machine learning-based or specifically written computer programs [13]

Machine learning is a branch of AI that makes predictions using algorithms that learn from data These predictions can be derived using either supervised learning, in which algorithms learn patterns from known data, or unsupervised learning, in which algorithms uncover broad patterns in data Based on previous data, ML models can forecast numerical values, classify events as true or false, and cluster data points based on similarities [13]

Deep learning, in contrast, is a subfield of machine learning that specifically focuses on algorithms predominantly built upon multi-layered artificial neural networks (ANN) These networks draw inspiration from the intricate structure of the human brain [13]

Figure 9 Comparing different industry terms [15]

Machine learning can be broadly categorized into three types based on the architecture of the learning system and the nature of the provided data: supervised learning, unsupervised learning, and reinforcement learning [13]

The most widespread form of machine learning is supervised learning In this approach, the model is trained on a labeled dataset, where the data is accompanied by corresponding labels that the model endeavors to predict These labels can range from category names to real-valued numbers

Common examples of supervised learning algorithms for regression problems include Linear Regression, decision trees, and support vector machines For classification problems, commonly used algorithms include logistic regression, decision trees, and support vector machines [13]

In contrast, unsupervised learning involves training the model on an unlabeled dataset, where the model is tasked with autonomously uncovering patterns and relationships within the data

Commonly used unsupervised learning algorithms include k-means for clustering problems and Principal Component Analysis (PCA) for addressing dimensionality reduction challenges [13]

Figure 10 Comparing supervised and unsupervised learning [15]

Reinforcement learning is a type of machine learning in which an agent learns to make decisions through interaction with its environment The agent's actions result in rewards or penalties (in the form of points), and its objective is to maximize the cumulative reward over time

Game playing, robotics, resource management, and many other applications are common examples of reinforcement learning [13]

Machine learning applications are all around us, often operating in the background to improve our lives Here are some instances from actual life:

One of the most visible applications of machine learning is Recommendation Systems Machine learning is used by companies such as Netflix and Amazon to assess your prior behavior and offer products or movies you might like [13]

Machine learning is used by Voice Assistants such as Siri, Alexa, and Google

Assistant to interpret your voice commands and offer relevant responses They are always learning from your encounters in order to improve their performance [13]

Machine learning is used by banks and credit card firms to detect fraudulent transactions They can detect suspicious activities in real time by evaluating patterns of normal and aberrant behavior [13]

Machine learning is used by Social Media sites for a range of functions, including personalizing your feed and filtering out inappropriate content [13]

2.3.4 Roles of Artificial Intelligence (AI) in Nutrition

The integration of artificial intelligence (AI) in health, biological sciences, and nutrition has witnessed notable growth However, this widespread application has given rise to significant ethical questions across various fields Therefore, the aim of this mini-review is to delineate AI applications in health, with a specific emphasis on nutrition, while also exploring the challenges and ethical considerations associated with its implementation [14]

Artificial intelligence in bioinformatics offers valuable tools and methodologies for the collection, organization, and analysis of extensive biological datasets, including nutritional, genetic, and other pertinent information Using AI algorithms, these datasets can be systematically analyzed and integrated to uncover meaningful patterns and relationships In a more focused application, AI is instrumental in constructing prediction models based on biological data, facilitating the generation of anticipated outcomes or personalized predictions [14]

We live in a world where food and nutrition information are readily available Many celebrities, influencers, and self-described fitness junkies push weight-loss drugs and food ideas without recognizing the negative impacts on overall, long-term health The ten nutrition science principles listed below will provide you with a basic grasp of human diet performance needs: [15]

Principle 1 – Food is a basic human need

We need a variety of foods for optimal health, just as we need air and water to thrive [15]

Principle 2 – Food supplies nutrients, energy, and other substances for growth and overall health

Although our dietary needs alter as we age, our bodies will always require the fundamental elements to stay healthy They are called "essential" because our bodies do not manufacture enough of them and must be obtained from our diet in order for our bodies to function properly Here are a few instances of how our bodies utilize certain nutrients: [15]

• Carbohydrates: Provide immediate energy, while fiber decreases cholesterol and controls blood glucose levels

• Protein: Helps to build muscles and bone, as well as generate healthy red blood cells and maintain a healthy immune system

• Fats: Long-term energy, vitamin A, D, E, and K absorption, brain function

• Vitamins: Protein synthesis, cell repair, illness prevention

• Minerals: Brain development, bone and tooth formation, muscle and nerve activity stimulation

• Water serves: As a temperature regulator and a medium for chemical processes

Principle 3 – Health problems related to nutrition begin in the cells

Conclusion

In summary, I have clarified the concepts of what website, artificial intelligence, and nutrition? Besides, I analyzed the existing nutrition websites, highlighting their features and limitations while emphasizing the necessity of AI-supported platforms Moreover, through researching the knowledges of Machine Learning, I have choosen Linear Regression is AI model for website In the realm of developing a Scientific Nutrition Menu Website with Artificial Intelligence capabilities, the selection of a recommender system is pivotal for providing users with tailored and precise nutritional suggestions While collaborative filtering and neural networks are popular choices, we propose incorporating linear regression as a valuable alternative Linear regression is a powerful statistical method that, when applied thoughtfully, can yield meaningful insights into the relationship between various user attributes and caloric needs.

SYSTEM ARCHITECTURE AND DEVELOPMENT

The Problem of Planning a Menu Scientifically

Posing a complex and multidimensional problem The main problem here is how to combine extensive nutrition knowledge with modern AI technology to develop a website capable of providing and recommending suited meals in a science for users This necessitates the analysis and processing of massive volumes of data on food, nutrition, and individual health and lifestyle aspects

On the website's consultation page, users can:

• Enter their information, including their full name, age, gender, and the number of calories their bodies require

• Save information from a list of popular foods, such as the food code, food name, and food calories

• Users can subscribe to the service through a monthly subscription model Users can choose meals each day, allowing flexibility based on user needs

• Users can choose a suggested meal package analyzed by AI based on the information the user enters

• Users can view a menu of selected foods for a day

3.1.2 Directions for Solving This Problems

To solve this problem, the following steps need to be taken:

Data to be collected includes:

• Information about the nutritional composition of foods

• Information about the nutritional needs of each user group

• Information about each individual's index status

Step 2: Build an AI model

The AI model needs to be built to be able to create menus that meet the following criteria:

• Balanced nutrition, ensuring adequate supply of necessary nutrients for the body

• Diversity of food, avoid repeating dishes

• Delicious, suitable for each individual's information

The website needs to be developed to be user-friendly, easy to use, and meet user needs such as:

• Allows users to enter information about their own indicators, thereby calculating the exact the amounts of calories and suggesting appropriate nutritional meals

• Statistics on nutritional composition of menus

Technologies that need to be used to solve this problem include:

• Database: The database needs to be used to store information about the nutritional composition of foods, the nutritional needs of each user group and the dietary preferences of each individual

• Machine learning: Machine learning is used to build an AI model that can generate menus that meet stated criteria

• Web programming: Web programming is used to develop scientific nutrition menu websites

Software Development and Technologies

JavaScript is a cross-platform, object-oriented programming language primarily employed to enhance the interactivity of webpages It enables the creation of dynamic elements, including animations, clickable buttons, popup menus, and more Additionally, there are robust server-side versions of JavaScript, like Node.js, which extend functionality beyond file downloads, enabling features such as real-time collaboration across multiple devices JavaScript can be linked to objects within its hosting environment, such as a web browser, enabling programmatic control over these objects [16]

Figure 12 Basics of JavaScript Feature of JavaScript:

According to a recent Stack Overflow survey, JavaScript stands out as the most widely used programming language globally The capabilities of JavaScript have expanded significantly, particularly with advancements in browser technology and its incorporation into server-side development through platforms like Node.js and other frameworks Here are some examples of what can be accomplished with JavaScript: [17]

• JavaScript was initially crafted for DOM (Document Object Model) manipulation, transforming predominantly static websites into dynamic ones

• In JavaScript, functions are treated as objects, possessing properties and methods Other functions can accept them as arguments

• JavaScript allows for the handling of date and time

• Despite HTML being the primary medium for creating forms, JavaScript is utilized for form validation

• JavaScript operates without the need for a compiler [17]

• Web Development: JavaScript plays a crucial role in adding interactivity and behavior to static websites Created in 1995 for this purpose, it is particularly effective for achieving this goal, and tools like AngularJS simplify the process

• Web Applications: The need for a programming language became apparent to build more sophisticated web applications JavaScript emerged as a key language for this purpose

• Server Applications: The advent of Node.js facilitated the migration of JavaScript from the client to the server, making it a powerful language for server-side applications

• Games: JavaScript is employed in game development for recreational purposes The combination of JavaScript and HTML5 has contributed to its popularity in the gaming industry

• Smartwatches: JavaScript finds application in various devices and apps, including smartwatches It supports the PebbleJS library, utilized in wearable apps

• Art: JavaScript provides a platform for artists and designers to create diverse content by drawing on an HTML5 canvas

• Machine Learning: JavaScript is not limited to web development; it is also involved in machine learning

• Mobile Applications: JavaScript extends its reach beyond web applications to the realm of mobile applications Leveraging its strengths and applications, JavaScript proves to be a potent tool for mobile app development [17]

• JavaScript is Easy to Learn and Implement

• JavaScript Provides Means of Creating Rich Interfaces [18]

• JavaScript Lacks a Multiple Inheritance Feature

• Slower Rendering Than Other Languages [18]

ReactJS is an open-source JavaScript library designed for building declarative and efficient user interfaces It operates as a front-end component-based framework, specifically focusing on the view layer within a Model-View-Controller (MVC) architecture React is instrumental in constructing modular user interfaces and promotes the development of reusable UI components capable of presenting dynamic data [19]

Figure 13 React framework Advantages of ReactJS:

• ReactJS has a thriving community and a large number of downloadable instructions

• SEO-friendliness: ReactJS is SEO-friendly and prioritizes rendering speed

• Reusable components: ReactJS promotes the creation of reusable components within applications

• Handy Tools Support: ReactJS comes equipped with a variety of development tools and dependencies

• Cross-platform Functionalities: ReactJS has a counterpart called React Native, specifically designed for cross-platform mobile app development

• Scalability: React's modular design enhances scalability, making it easier to scale applications compared to other platforms [20]

• Tempo of development: Some developers consider the development pace to be a drawback

• Documentation Deficiency: There isn't enough time to provide comprehensive documentation

• Incomplete tooling set: Developers must choose a framework to create a quick, elegant, and suitable user interface aftẻ implementing React web app development [20]

We need to set up the ReactJS Development Environment before we can execute any React application The steps below will walk you through installing and configuring a working React development environment: [21]

To begin, we must have NodeJS installed on our computer As a result, the initial step will be to install NodeJS After we've installed NodeJS on our computer, we'll need to install React Boilerplate There are basically two methods for ReactJS environment setup:

Method 1: Using the create-react-app (CRA commond) command [21]

• Step 1: Open the terminal and navigate to the folder where you want to create the project

• Step 2: In the application directory's terminal, enter the following command:

• Step 3: Using the command, navigate to the newly created folder

• Step 4: A default application will be generated with the project structure and dependencies listed below.(See figure 16)

It will install various packages by default, which may be viewed in the package's dependencies.As an example, consider the following json file:

• Step 5: In the terminal, type the following command to run this application npm start

• Step 6: The browser will display the following output

Method 2: Making Use of Webpack and Babel [21]

Setting up a react development environment using webpack and babel is a time- consuming procedure that requires us to import each package and write our own setup files We must first construct the setup with the “npm init -y” command, then import the appropriate packages into the folder, and finally install react with the command npm i react react-dom

Use the command to install the required packages in our project

Next.js is a React framework that allows you to create full-stack online applications You create user interfaces with React Components and then optimize them with Next.js [22]

Under the hood, Next.js abstracts and automatically configures React tooling like as bundling, compilation, and more This allows you to concentrate on developing your application rather than configuring it [22]

Next.js can help you build interactive, dynamic, and quick React applications whether you're an individual developer or part of a larger team

- System requirments: For the installation of Next.js, ensure you have Node.js

18.17 or a later version installed, and your operating system should be either macOS, Windows (including WSL), or Linux

It is recommended to use "create-next-app" for creating a new Next.js app, as it simplifies the process To start a project, run the following command: npx create-next-app@latest

Follow the prompts, and the "create-next-app" tool will generate a project folder with the specified name, installing all necessary dependencies

If you prefer a manual installation approach, install the required packages with: npm install next@latest react@latest react-dom@latest

Then, open your package.json file and include the following scripts:

These scripts allow you to run the development server “npm run dev”, build your

• To start the development server, use “npm run dev”

• To access your application, go to “http://localhost:3000”

• To see the revised result in your browser, edit the “app/page.tsx” (or

“pages/index.tsx”) file and save it [22]

Node.js is an open-source and cross-platform JavaScript runtime environment widely employed for various tasks in a Node.js application, the execution occurs within a single process instead of creating a new thread for each request Node.js incorporates a standard library with asynchronous I/O primitives, preventing JavaScript code from causing blocks Libraries in Node.js are typically designed with non-blocking paradigms, ensuring that blocking behavior is an exception rather than the norm [23]

Figure 15 An Example Node.js Application

The following are some of the functions that Node.js can perform:

• The database's data is added, destroyed, and altered

• Creates dynamic web page content

• Files are generated, read, written, removed, and closed on the server [24]

• High performance: The ability to construct lightning-fast programs that produce results in seconds is one of the most essential characteristics of node.js

• Scalability: Node.js offers the advantage of easy scalability, allowing developers to create applications with both horizontal and vertical scalability orientations

• Simple to Understand: Node.js is easier to learn, and it takes less time to work with

• Extensibility: Node.js is extensible, which means it may be updated and improved to meet specific needs It also includes APIs for building HTTP, TCP, and DNS servers, among other things

• Increases response time and performance

• Using caching, it reduces loading time

• Supports in the formation of cross-functional teams

• Node.js API is unstable: One of the most common issues that most developers confront is that the Application Programming Interface changes frequently and is unreliable

• Model for Asynchronous Programming: If you want to make your programs more scalable, you should employ asynchronous programming

• Lack of library: JavaScript, in comparison to any other programming language, lacks a well-equipped and powerful library system [25]

Some of the areas where Node.js has shown to be a beneficial technology partner are as follows: [26]

• In Single Page Applications (SPA)

• Data-Intensive Applications that run in real time

• Applications based on JSON APIs

Structured Query Language (SQL) is a computer language designed for storing, manipulating, and retrieving data from relational database management systems

(RDBMS) It was created by Donald Chamberlin, Donald C Messerli, and Raymond

F Boyce at IBM in the 1970s [27]

MySQL is an open-source Relational Database Management System (RDBMS) developed by Oracle It is based on structured query language (SQL) and organizes data using rows and columns Compared to other programming languages like C, C++, Java, and others, MySQL is known for its simplicity Learning a few straightforward commands allows users to work, build, and interact with the database effectively [27]

Why do we use the MySQL database system?

• Ease of use: MySQL is known for its ease of installation, taking only minutes for developers to set up, and it offers straightforward database management

• Reliability: Being one of the most established and widely used databases,

MySQL is trusted for handling mission-critical applications

• Scalability: Its built-in replication design allows for scalable systems, making it capable of handling large user bases, as seen in platforms like Facebook

• Performance: MySQL HeatWave demonstrates superior speed and cost- effectiveness in comparison to alternative database services, validated by industry-standard benchmarks such as TPC-H, TPC-DS, and CH- benCHmark

• High availability: Ensures high availability and disaster recovery through a comprehensive set of native, fully integrated replication mechanisms

• Security: MySQL Enterprise Edition includes robust security features such as authentication/authorization, transparent data encryption…

• Flexibility: With the MySQL Document Store, users have significant flexibility in designing both standard SQL and NoSQL schema-free database applications [27]

Combination of Nodejs and MySQL

Node.js and MySQL form a powerful combination in modern web development, allowing developers to create fast, scalable, and secure applications tailored to their business needs By leveraging Node.js on the server side and MySQL as the database management system, several advantages are realized, including: fast and scalable applications, ease of learning and use, flexibility and customization, security and reliability, and cost-effectiveness are all advantages of utilizing Node.js and MySQL together [28]

NULL: Allowed value is empty

AUTO_INCREMENT: Allows values to increase gradually (automatically) UNSIGNED: Must be a positive integer

PRIMARY KEY: Allows it to be the primary key in the table

Syntax to exit the database:

- Create a table in the database:

CREATE TABLE table_name ( column1 datatype, column2 datatype, column3 datatype,

- Create Table Using Another Table:

CREATE TABLE new_table_name AS

- Add columns to the table:

- Add values to the table:

INSERT INTO table_name (column1, column2, column3, )

- Retrieve data and arrange it in sequence:

ORDER BY column1, column2, ASC|DESC;

- Update data in the table:

SET column1 = value1, column2 = value2,

- Delete data in the table:

DELETE FROM table_name WHERE condition;

Figure 16 MySQL String Data Types [33]

Figure 17 MySQL Numeric Data Types [33]

Figure 18 MySQL Date and Time Data Types [33]

- user_account table: To store user information

• user_id: The unique id to identify the user

• packagePackageId: The package id to identify tracking users activities associated with the user account table

• full_name: The full name of the user

• user_name: The username of the user It can be used for login and registration

• email: The email of the user It can be used for login and registration purposes

• isAdmin: The users management part of administrator

• password: The password of the user It can be used for login and registration

• phone: The phone of the user

• created_at: Creating the new user in user management table of Admin

• updated_at: Updating user information in user management table of Admin

Field Type Null Key Default Length user_id int NOT

Primary key full_name varchar NOT

Phone varchar NULL 255 created_at datetime NOT

- package table: To store the user's monthly meal subscription packages

• package_id: The unique id to identify the package pricing

• package_name: Show name of the user’s monthly meal subscription packages

• meal_number-per_day: Number of meals that can be purchased for free per day of each monthly package

• price: The price of the user’s monthly meal subscription packages

• option: The benefits of each monthly meal packages

• created_at: Creating the new package in package management table of Admin

• updated_at: Updating the package information in package management table of Admin

Field Type Null Key Default Length package_id int NOT NULL Primary key package_name varchar NOT NULL 255 meal_number_per_day int NOT NULL price double NOT NULL option varchar NOT NULL 255 description varchar NULL 255 created_at datetime NOT NULL 6 update_at datetime NOT NULL 6

- meal table: To store the scientific nutrition meal packages data

• meal_id: The unique id to identify the meal

• meal_name: The meal title to be displayed on the Meal page

• meal_image: The image of each meal packages to be displayed on the Meal page

• meal_status: Status of meal packages (available or sold out)

• calories: Total calories contained in each meal package

• nutri_score: Nutrition scores of meal packages

• rating: Rating of customer for meal packages

• meal_type: To distinguish between the different meal packages types

• price: The price of meal packages

• description: Show information of meal packages

• isVisible: The mode of meal packages to be displayed in meal management table of Admin (visible or hidden)

• created_at: Creating new meal package in meal management table of Admin

• updated_at: Updating meal package information in the meal management table of Admin

Artificial Intelligence Model

A recommendation system is a machine learning or artificial intelligence (AI) program that utilizes Big Data to suggest or recommend additional products to consumers These recommendations are often based on various factors, including past purchases, search history, demographic data, and other relevant information Recommender systems are highly valuable as they assist users in discovering products and services that they might not have come across otherwise [30]

Recommender systems are trained using data derived from user interactions, aiming to understand individual preferences, past choices, and item characteristics

Content and product producers find recommender systems highly valuable because of their capacity to predict consumer interests and preferences at a highly personalized level These systems can effectively guide users towards a wide range of products or services, spanning from books and movies to fitness classes and clothing, based on their unique preferences and desires [30]

There are various types of personalized recommender systems, each with its own methods and approaches for offering individualized recommendations The majority of them fall into one of three general categories: [30]

Linear Regression Model – Recommendation System

Linear regression is a statistical method employed in data science and machine learning to predict future events by establishing a linear relationship between an independent variable and a dependent variable [31]

Model Representation in Linear Regression

In linear regression, the model equation represents a linear relationship between the input features and the predicted output (nutritional values) The equation takes the following form for a simple linear regression with one independent variable [31] Formula: y = b 0 + b 1 x 1 + e

• y represents the dependent variable, which in this case, could be the predicted nutritional value such as calories, protein, fat, carbohydrate content

• x 1 is the independent variable, such as an ingredient, nutriscore, rating

• b 0 is the intercept term, indicating the value of y where x 1 is zero

• b 1 is the coefficient representing the effect or impact of x 1 on y

• e denotes the error term, accounting for the variability in y that the model doesn’t explain

For multiple linear regression involving multiple independent variables, the equation extends to accommodate multiple predictors: [31] y = b 0 + b 1 x 1 + b 2 x 2 + … + b n x n + e

• Here, x 1 , x 2 , x n represent different independent variables (e.g., various ingredients or serving sizes)

• b 0 ,b 1 , b 2 ,…,b n are the corresponding coefficients for each independent variable, indicating their impact on the predicted nutritional value

• The equation allows the model to estimate the nutritional value by considering the combined effect of multiple features

The coefficients b 0 ,b 1 , b 2 ,…,b n are crucial in understanding how each independent variable influences the predicted nutritional value A positive coefficient suggests a positive relationship between the feature and the nutritional value, while a negative coefficient implies an inverse relationship The magnitude of the coefficient indicates the strength of that relationship [31]

Assumptions and Suitability in Nutritional Prediction

In the context of using linear regression for nutritional prediction in the development of a scientific nutrition menu website using artificial intelligence, it's essential to understand the assumptions underlying linear regression and assess its suitability for predicting nutritional values accurately

• Assumption: Linear regression assumes a linear relationship between the independent variables such as ingredients, portion sizes and the dependent variable such as nutritional values like calories, protein content, etc

• Suitability for Nutritional Prediction: This assumption implies that the nutritional values change linearly with changes in ingredients or portion sizes

• Assumption: The errors or residuals (the differences between predicted and actual values) in linear regression should be independent of each other and have constant variance

• Suitability for Nutritional Prediction: Independence of errors implies that errors in predicting one food item's nutritional values do not influence the errors for another

• Assumption: The variance of errors should remain constant across all levels of the independent variables

• Suitability for Nutritional Prediction: Homoscedasticity indicates that the variability in nutritional values remains consistent regardless of the range or quantity of ingredients or portion sizes used

• Assumption: The independent variables should not be highly correlated with each other

• Suitability for Nutritional Prediction: Multicollinearity occurs when independent variables are strongly correlated In nutritional prediction, highly correlated features might lead to unreliable estimates of the coefficients, making it challenging to identify the precise influence of each ingredient or attribute on nutritional values

Suitability Assessment for Nutritional Prediction

- Strengths of Linear Regression in Nutritional Prediction:

• Interpretability: Linear regression provides interpretable coefficients that show the impact of individual features on nutritional values, offering insights into the importance of different ingredients or portion sizes

• Simple Relationships: Linear regression can effectively model straightforward relationships between certain attributes (like quantities of specific ingredients) and certain nutritional outcomes

• Complex Interactions: Nutrition involves intricate relationships between various components of food Linear regression might struggle to capture complex interactions or non-linear relationships, potentially leading to inaccurate predictions

• Assumption Limitations: If the assumptions of linear regression are violated

(e.g., non-linearity, multicollinearity), the model's predictions might be less reliable and require more sophisticated modeling techniques

Application of Linear Regression in GoodFood Website

Linear regression plays an important role in predicting the nutritional content of foods featured on the website By leveraging historical nutritional data and relevant food attributes such as ingredients and serving sizes, linear regression models can estimate key nutritional values This includes macronutrients such as calories, carbohydrates, proteins, fats

The use of linear regression facilitates intelligent menu planning capabilities By analyzing the predicted nutritional value of different food items, the site uses a linear regression-based algorithm to recommend balanced meal plans tailored to specific dietary goals or user preferences

Linear regression aids in analyzing user preferences by correlating their dietary choices and patterns with the nutritional data available The model can identify correlations between users' preferences and specific nutritional attributes This analysis allows the website to offer tailored recommendations and personalized menu suggestions that align with users' tastes, dietary restrictions, or health objectives

Through continuous analysis of user interactions and feedback, linear regression contributes to optimizing menu offerings on the website By understanding users' choices and nutritional preferences, the model assists in refining the menu selection, highlighting popular or highly-rated items, and introducing new dishes that meet both user preferences and nutritional guidelines

The application of linear regression enables the website to conduct trend analysis of users' dietary habits over time By examining historical data on user preferences, consumption patterns, and changes in nutritional choices, the model identifies emerging trends or shifts in dietary preferences This information allows the website to adapt its menu recommendations and offerings to align with evolving user preferences, ensuring continued relevance and engagement

This section emphasizes the practical implementation of linear regression within the project, showcasing its versatile applications in predicting nutritional values, menu planning, user preference analysis, menu optimization, and trend analysis for the development of a scientific nutrition menu website using artificial intelligence

Artificial Intelligence Applications in Recommendation

AI applications in recommendation systems represent advanced approaches that utilize AI technologies to enhance the performance of recommendation engines AI- powered recommenders can analyze extensive datasets, learning from user behavior, preferences, and interactions to provide highly accurate and personalized content or product recommendations

Commonly employed AI techniques in recommendation systems include machine learning, deep learning, and natural language processing These innovative methods significantly enhance the system's capability to predict user preferences and deliver personalized content with greater accuracy [32]

Conclusion

In summary, in this chapter, I introduced the tools and technologies used to build a complete website such as Front-end (React), Back-end (Nest.js), database (MySQL), AI-model (Sklean)

Besides, the decision to utilize Linear Regression in the development of the scientific nutrition menu website was driven by its interpretability, transparency, ease of implementation, and its role as a foundational tool in understanding relationships between ingredients, portion sizes, and nutritional values While acknowledging its limitations, this choice positions the project to evolve iteratively, incorporating advanced techniques to offer more comprehensive and accurate nutritional insights to users.

SYSTEM DESIGN

System Model

The system is divided into two parts: Users and Administrator

Register Log In View Meal List Calculate Calories Package

Order Meals Shopping Cart Contact

Log in User Management Meal Management Food Management Order Management Package Management Transaction Management Contact Management

Usecase diagram

Table 4.2 General usecase specification table

Summary Login, food management, meal management, order management, user management, shopping cart management, contact management

Main event flow - User and Admin log in to the system and operate the functions under their management

- The system provides functions for users to operate

- Successful case Get into the system

- Failure case The system reports that the username/password is incorrect

- View, update, hidden product information

- The system displays product information

The interface and operations are easy to use for first-time users

Table 4.3 Login use case specification table

Log In Name LogIn to the system

Summary The system grants user permission to log in

Main event flow Users log in to the system to use functions

- The system notifies the username/password incorrectly

- The system reports no account yet

Preconditions Login information (email, password)

The interface and operations are easy to use for first-time users

4.2.3 Shopping Cart and Order usecase diagram

Figure 33 Shopping cart usecase diagram

Table 4.4 Usecase specification Shopping Cart, Order Table

Shopping Cart, Order Name Manage shopping cart and orders

Summary View, update, clear, checkout products in cart and orders

Main event flow Users log in to the system to use functions

Event streams 1 Log in to the system

2 The system displays functions and shopping cart information

Preconditions Login into the system

Interface and operations are easy to use

Table 4.5 Usecase specification Meal Table

Summary View, add meal detail

Main event flow Users log in to the system to use functions

Event streams 1 Log in to the system

2 The system displays functions and meal packages information

Preconditions Login into the system

Interface and operations are easy to use

Table 4.6 Usecase specification Package Table

Pricing Package Name Register monthly package pricing

Summary View and register pricing package

Main event flow Users log in to the system to use functions

Event streams 1 Log in to the system

2 The system displays functions and monthly pricing packages information

Preconditions Login into the system

Interface and operations are easy to use

Table 4.7 Usecase Specification Contact Management Table

Summary View and send contacts

Main event flow Users and Admin log in to the system to use the functions

Event streams 1.Log in to the system

2.The system displays functions and contact information

Preconditions Login into the system

Interface and operations are easy to use

Figure 38 User management usecase diagram

Table 4.8 Usecase Specification User Management Table

Summary View, activate and deactivate user account

Main event flow Admin log in to the system to use the functions

Event streams 1.Log in to the system

2.The system displays functions and user information

Preconditions Login into the system

Interface and operations are easy to use

Figure 39 Meal management usecase diagram

Table 4.9 Usecase Specification Meal Management Table

Summary View, create, update and hidden meals

Main event flow Admin log in to the system to use the functions

Event streams 1.Log in to the system

2.The system displays functions and meal information

Preconditions Login into the system

Interface and operations are easy to use

Figure 40 Food management usecase diagram

Table 4.10 Usecase Specification Food Management Table

Summary View, create, update and hidden foods

Main event flow Admin log in to the system to use the functions

Event streams 1 Log in to the system

2 The system displays functions and food information

Preconditions Login into the system

Interface and operations are easy to use

Figure 41 Order management usecase diagram

Table 4.11 Usecase Specification Order Management Table

Summary View and update orders

Main event flow Admin log in to the system to use the functions

Event streams 1.Log in to the system

2.The system displays functions and order information

Preconditions Login into the system

Interface and operations are easy to use

Figure 42 Package management usecase diagram

Table 4.12 Usecase Specification Package Management Table

Summary View, create and update packages

Main event flow Admin log in to the system to use the functions

Event streams 1.Log in to the system

2.The system displays functions and packages information

Preconditions Login into the system

Requirement specification Interface and operations are easy to use

Sequence diagram

4.3.2 Sequence Diagram Manage Shopping Cart

Figure 44 Shopping Cart management sequence diagram

Figure 45 Contact management sequence diagram

Figure 46 User management sequence diagram

Figure 47 Order management sequence diagram

Figure 48 Meal management sequence diagram

System Interface Design

This page system displays sample image content of sliding dishes, users can know delicious, cheap and healthy dishes as well as express the purpose of the page

The system lists meal packages such as Breakfast Package, Meat-based Meal, Vegetable-based Meal, etc Each meal includes actual images, calorie content, nutritional points, and ratings (ratings provided by experts)

The system creates personalized meal plans based on the user's body index to achieve dietary and nutritional goals using an AI-calorie counting tool Alternatively, users can input their desired calorie intake, and the system will recommend suitable meals accordingly

Figure 53 Input Nutrition Calculator Interface

A form for users to input their body index information; these fields are mandatory for AI to use and calculate accurate calories based on this data

Figure 54 Result Calories Calculate Interface

After calculating the calorie amount based on the user's body index, the system will display a list of food combos that match the recommended calorie intake under the 'Suggested Combo' section

Display combo packages for users to choose (mandatory) Users must purchase a monthly package to be able to order food Each package will have advantages and disadvantages depending on their price, and most users will choose based on their regular food purchasing habits or the healthy eating recommendations by experts associated with each package

Display the list of food items that the user has added to the cart, where the system will calculate the cost of each meal Note: When users purchase a package, a certain number of food items will be free In such cases, the total amount for that free order will be $10 Users will be charged for individual items once they exhaust their free allocations for the day in subsequent orders Additionally, the system allows users to update the quantity of each food item and remove items from the cart at this stage

On this page, users will have information to confirm the food items they are ordering and an additional form for users to fill in the delivery address, including (Name, phone number, house number, district, city, country) After completing the form, users can press 'Order' to confirm the order

Figure 58 Order Derivery Complete Interface

This page indicates that the system has successfully recorded the user's order After this step, the user will wait for the administrator to verify and process the order for delivery of the food to the user

If there are any questions or feedback regarding the quality and service of the system, the system allows users to submit feedback about the system or request advice or assistance Any questions will be addressed by an expert

The system displays a list of menus with food items available in the system The system allows the admin to view this information and has the ability to create and update menus Additionally, if the admin wishes to hide these food items on the interface, they can press 'Hidden,' and to unhide, they can select 'Show'

The system displays a list of the food items available in the system The admin can view this information and is authorized to create and update menus Additionally, if the admin wishes to hide these food items on the interface, they can press 'Hidden,' and to unhide, they can select 'Show.'

The system displays a list of user orders on the platform, showing the status of each order in the 'order status' column on the list, along with the delivery address Additionally, the system allows the admin to view this information and update the status of these orders."

The system displays a list of monthly packages available in the system The admin can view this information and is authorized to create and update these monthly packages Additionally, if the admin wishes to hide these packages on the interface, they can press 'Hidden,' and to unhide, they can select 'Show.'

The system displays a list of transactions coming into the system, including when users purchase packages and place orders

The system displays a list of feedback received, including the sender's name, email address, and the message

Conclusion

In this chapter, I focus on system design, feature design Specifically, the system model, use case diagrams, sequence diagrams, and interfaces of the GoodFood website, these components collectively contribute to shaping a robust, user-centric platform that aligns with the envisioned functionality and user experience goals of the project As the development progresses, these design elements will serve as a roadmap, guiding the implementation and ensuring the successful realization of the GoodFood website's objectives.

INSTALL WEBSITE

Run Frontend Project Installation and Run Guide using Next.js

Next.js is a powerful React framework that simplifies the creation of server- rendered React applications This guide will take through the steps to install and run a frontend project using Next.js

Before getting started, make sure you have the following prerequisites installed on your system:

• Node.js: Next.js is required Node.js Download and install it from nodejs.org

• npm (Node Package Manager): npm is bundled with Node.js Confirm that have a recent version by running npm install -g npm in terminal

Navigate to the frontend project directory and execute the following command to install the project dependencies: npm install

This will install all the required packages specified in project's package.json file

Step 2: Run the Development Server

To start the development server and preview Next.js app, use the following command: npm run dev

Visit http://localhost:3000 in web browser, and should see Next.js application running

Open code editor and explore the project structure Important directories include:

• pages: Next.js automatically generates routes based on files in this directory

• components: Place reusable React components here

Step 4: Stop the Development Server

To stop the development server, press Ctrl + C in the terminal

Next.js provides additional commands for various purposes Here are some useful ones:

• npm run build: Builds the application for production

• npm start: Starts the production server after the build.

Backend Server Configuration Guide using Nest.js

This guide will walk through the steps to configure an existing backend project using Nest.js Additionally, it includes the necessary steps to set up a MySQL database using environment variables

Before you begin, make sure you have the following prerequisites installed on your system:

• MySQL Database: Install and set up a MySQL database on server That can download MySQL from mysql.com

- Copy the env-example file to a new file named env : cp env-example env

- Open the env file in preferred text editor

- Edit the following variables to match MySQL database configuration:

TYPEORM_HOST=your_mysql_host

TYPEORM_PORT=your_mysql_port

TYPEORM_USERNAME=your_mysql_username

TYPEORM_PASSWORD=your_mysql_password

TYPEORM_DATABASE=your_mysql_database

Replace your_mysql_host, your_mysql_port, your_mysql_username, your_mysql_password, and your_mysql_database with your actual MySQL server details

Step 2: Run the Development Server

To start the Nest.js backend server, use the following command: npm run start:dev

Nest.js backend server should now be running

Step 3: Explore Your Backend Project

Open code editor and explore the backend project structure Key directories may include:

• src: Contains your Nest.js application code

• src/modules: Create modules to organize code

Step 4: Stop the Development Server

To stop the development server, please press Ctrl + C in the terminal

Nest.js provides additional commands for various purposes Some useful ones include:

• npm run build: Builds the application for production

• npm start: Starts the production server after the build.

AI Training Script

Explain each step in Colab code for training an AI model to calculate calories based on user age, height, weight, and sex:

In this step, a CSV file named 'sample_datas.csv' is read into a Pandas DataFrame called 'data' It is assumed that the dataset is in the 'sample_data' directory Please adjust the file path accordingly based on the location of your dataset

In this step, the LabelEncoder from scikit-learn is used to encode categorical variables ('sex', 'bodyfat', 'active_level') into numerical values This transformation is necessary because many machine learning models operate more effectively with numerical data rather than categorical data The LabelEncoder assigns a unique numerical label to each distinct category, facilitating the model's understanding of these features

In this step, the input features (X) and the target variable (y) are prepared for training the model The features (X) include ('sex', 'height', 'weight', 'age', 'bodyfat', 'active_level'), and the target variable (y) is 'best_calories' This process involves organizing the data in a way that allows the machine learning model to understand the relationship between the features and the target variable during the training process.

In this step, a Linear Regression model is created using scikit-learn's Linear Regression class, and it is trained on the prepared data ( X and y )

Saving the trained model's coefficients and intercept to a JSON file named

Here, creating a DataFrame named new_user with information about a new user (sex, height, weight, age, bodyfat, active_level) Providing example values; that would replace them with actual data for a new user

In this step, the categorical variables in the new user's data are encoded using the same LabelEncoders that were used during the training of the model

In the final step, the trained machine learning model is utilized to make predictions for the new user's data The predicted calorie value is then printed to the console, providing an estimate of the best calories for the new user based on the input features This prediction leverages the learned patterns and relationships from the training data, allowing the model to generalize and make informed predictions for new instances

In conclusion, I have completed the project "Developing a scientific nutrition website using artificial intelligence." Throughout the development process, there have been significant discoveries and achievements The project has successfully integrated advanced AI algorithms with specialized knowledge of nutrition, reaching pinnacle as a platform that provides and suggests personalized nutritional meals tailored to the individual needs, dietary preferences, and health goals of the users By intergrating machine learning technology, the website continuously evolves its suggestions, and by adjusting based on user feedback and incorporating the latest nutritional research Specifically, when users input their individual metrics, the system calculates the calorie amounts and suggests suitable nutritional meals for each person The user-friendly interface ensures accessibility, provides reliable information, and empowers users to make informed dietary choices

The potential impact of this website on nutrition planning and dietary habits is substantial By offering personalized meal plans based on scientifically driven data and detailed information controlled by AI, the website can contribute to improving users' eating habits significantly, thereby notably enhancing their health Furthermore, this platform has the capability to address the nutritional needs of individuals more accurately, promoting healthier eating habits and facilitating better management of dietary restrictions or health conditions Moreover, its accessibility and user-centric design can enhance nutritional education and empower individuals to take proactive steps towards a healthier lifestyle

“Developing a scientific nutrition menu website using artificial intelligence” utilizing artificial intelligence represents a pivotal advancement in the intersection of technology and nutrition The ability to provide personalized meal plans, revolutionizing how individuals approach diets and their overall health However, the journey does not end here Continuous refinement and enhancement of AI algorithms, coupled with ongoing research confirmation, are essential to further optimize accuracy and effectiveness

Looking ahead, the future prospects of this project are promising As AI technology continues to advance, this website serves as a beacon for personalized nutrition, assisting individuals in making informed decisions about their dietary choices Its significance lies in the fusion of scientific knowledge with technological innovation, aiming to empower individuals towards a healthier life through sensible dietary selections

[1] H Tukunang, "Website: Definition, Types, Elements, and Benefits," Blankontech, 2023

[2] A K, "What Is a Website? Understanding the Components and Different Categories," www.hostinger.in, 2023

[3] B Whitby, "What is AI?," in Artificial Intelligence, New York, The

[4] J H Fetzer, " What is Artificial Intelligence?," in Studies in Cognitive

Systems, vol 4, USA, Springer, Dordrecht, 1990, pp 3-5

[5] K C A Khanzode, "ADVANTAGES AND DISADVANTAGES OF ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING: A LITERATURE REVIEW," International Journal of Library & Information

[6] D DeCooman, "Nutritional Concepts | Terms, Definition & Food Guidelines," Biology 202L: Anatomy & Physiology II with Lab, 2023

[7] Measurement-toolkit, "Nutrients, foods, and diets," Nutrients, foods, and diets, p 1, 2023

[8] Measurement-toolkit, "Dietary adequacy and nutritional requirements,"

Dietary adequacy and nutritional requirements, p 2, 2023

[9] Measurement-toolkit, "Diet variation, quantification, and misreporting,"

Diet variation, quantification, and misreporting, p 3, 2023

[10] ifitness, "ifitness.vn," 14 November 2019 [Online] Available: https://ifitness.vn/blogs/kien-thuc-the-hinh/calo-la-gi [Accessed 30 December 2023]

[11] M Đ Anh, "Xây dựng ứng dụng hỗ trợ lên thực đơn khoa học theo lượng calo.," TRƯỜNG ĐẠI HỌC QUẢN LÝ VÀ CÔNG NGHỆ HẢI PHÒNG, 2020

[12] Lifesum, "Lifesum," [Online] Available: https://lifesum.com/ [Accessed 30 December 2023]

[13] Datacamp.com, "What is Machine Learning? Definition, Types, Tools

[14] P Detopoulou, "Artificial intelligence, nutrition, and ethical issues: A mini-review," Clinical Nutrition Open Science, pp 46-56, 2023

[15] S Armstrong, "10 PRINCIPLES OF NUTRITION SCIENCE,"

[16] "MDN web docs," 22 June 2023 [Online] Available: https://developer.mozilla.org/en-

US/docs/Web/JavaScript/Guide/Introduction [Accessed 20 December 2023]

[17] "Geeksforgeeks," 20 December 2023 [Online] Available: https://www.geeksforgeeks.org/introduction-to-javascript/ [Accessed 30 December 2023]

[18] M Neville, "The Advantages and Disadvantages of JavaScript," p 1,

[19] "Geeksforgeeks," [Online] Available: https://www.geeksforgeeks.org/reactjs-introduction/ [Accessed 20 December 2023]

[20] Joseph, "What Are The Advantages and Disadvantages of React JS," 9

June 2019 [Online] Available: https://www.fastcomet.com/blog/advantages-and-disadvantages-of-react- js#h-what-is-react [Accessed 20 December 2023]

[21] "Geeksforgeeks," [Online] Available: https://www.geeksforgeeks.org/reactjs-environment-setup/?ref=lbp

[22] "Nextjs.org," [Online] Available: https://nextjs.org/docs/getting- started/installation#run-the-development-server [Accessed 20 December 2023]

[23] "Nodejs.org," [Online] Available: https://nodejs.org/en/learn/getting- started/introduction-to-nodejs [Accessed 30 December 2023]

[24] "Geeksforgeeks," [Online] Available: https://www.geeksforgeeks.org/what-are-the-key-features-of-node-js/ [Accessed 30 December 2023]

[25] V Agarwal, "Codingninjas," 24 September 2023 [Online] Available: https://www.codingninjas.com/studio/library/advantages-and- disadvantages-of-nodejs [Accessed 30 December 2023]

[26] "Geeksforgeeks," [Online] Available: https://www.geeksforgeeks.org/what-are-the-key-features-of-node-js/ [Accessed 31 December 2023]

[27] "Oracle.com," [Online] Available: https://www.oracle.com/mysql/what-is-mysql/ [Accessed 31 December 2023]

[28] l jorge, "Node.js MySQL: A Powerful Combination for Modern Web Development," 4 Apr 2023 [Online] Available: https://medium.com/@livajorge7/node-js-mysql-a-powerful-combination- for-modern-web-development-832b0a60aa2 - :~:text=modern web development.-,By combining Node.,applications that exceed your expectations [Accessed 31 December 2023]

[29] "w3schools.com," [Online] Available: https://www.w3schools.com/mysql/mysql_sql.asp [Accessed 31 December 2023]

[30] "Nvidia.com," [Online] Available: https://www.nvidia.com/en- us/glossary/data-science/recommendation-system/ [Accessed 31 December 2023]

[31] A Vidhya, "Understanding The Linear Regression!!!!," p 1, 2020 [32] "Thingsolver.com," [Online] Available: https://thingsolver.com/blog/introduction-to-recommender-systems/ [Accessed 1 Feb 2024]

[33] "BMR Calculator," [Online] Available: https://www.calculator.net/bmr-calculator.html [Accessed 1 Feb 2024].

Ngày đăng: 13/06/2024, 09:44

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w