0% found this document useful (0 votes)
16 views51 pages

PTTKHT

Uploaded by

Nguyễn An
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views51 pages

PTTKHT

Uploaded by

Nguyễn An
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

IT3120E
SCHOOL OF INFORMATION AND COMMUNICATION TECHNOLOGY
CYBER SECURITY K67 SYSTEM ANALYSIS AND
DESIGN

COOK HANDBOOK - RECIPES SHARING


AND MANAGEMENT APP

SYSTEM ANALYSIS AND DESIGN


PROJECT REPORT

MEMBER LIST
Nguyen Thanh An 20225541 [email protected]
Pham Tuan Anh 20225542 [email protected]
Le Tien Dat 20225543 [email protected]
Pham Doan Phuc Lam 20225546 [email protected]
Pham Hong Quan 20225551 [email protected]
Le Hai Nhat 20225583 [email protected]
Lecturer: Nguyen Duc Anh, PhD

Hà Nội — 2024
CONTENTS

C ONTENTS

1 Introduction 5

2 Stage 1 - Planning 6
2.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Initial System Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 Business need . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.2 Business requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.3 Business values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Feasibility Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.1 Technical feasibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.2 Economic feasibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.3 Organizational feasibility . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4 Project Plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4.1 Methodologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4.2 Estimate project scope (size) and time . . . . . . . . . . . . . . . . . . . 9
2.4.3 Staffing plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4.4 Case tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3 Stage 2 - Analysis 11
3.1 Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Non-Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.3 Use Case Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4 Activity Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.5 Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

4 Stage 3: Design 32
4.1 Design Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.1.1 View (Front-end) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.1.2 Controller (Back-end) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.1.3 Model (Back-end) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.2 Detailed Package Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

5 Stage 4: Implementation 47

System Analysis And Design 2


LIST OF FIGURES

6 Conclusion 51

L IST OF F IGURES
1 Use Case Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2 Manage Recipe Activity Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3 Manage Restaurant Activity Diagram . . . . . . . . . . . . . . . . . . . . . . . 21
4 Manage User Activity Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5 Login Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6 Register Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7 Manage Recipe Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . 24
8 Manage Restaurant Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . 25
9 Manage User Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 26
10 Search Recipe Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 27
11 Search Restaurant Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . 29
12 Request Handle Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . 31
13 View and Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
14 Model package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
15 User class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
16 RestaurantOwner class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
17 Admin class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
18 Recipe class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
19 Restaurant class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
20 Assessment class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
21 UserDao class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
22 RecipeDao class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
23 RestaurantDao class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
24 AssessmentDao class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
25 RecipeAssessment class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
26 RestaurantAssessment class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
27 AppDb class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
28 Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
29 Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
30 Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

System Analysis And Design 3


LIST OF FIGURES

31 Recipe details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

System Analysis And Design 4


1 I NTRODUCTION
Cook Handbook is a revolutionary culinary platform that redefines the way we engage with
food in the digital age. Beyond being a mere repository of recipes, it fosters a vibrant com-
munity of food enthusiasts, encouraging them to share their culinary experiences, experi-
ment with flavors, and discover unique dishes from around the world.
Unlike traditional recipe app that offer static content, the Cook Handbook empowers users
to actively contribute to the platform. This collaborative approach creates a dynamic and
ever-evolving space where users can learn from each other, share tips and tricks, and inspire
one another to explore new culinary horizons. By combining the power of technology with
the passion of food lovers, the Cook Handbook aims to create a truly unique and engaging
culinary experience.
Whether you’re a seasoned chef or a budding home cook, the Cook Handbook offers a
wealth of features to inspire, guide, and connect you with a global community of food en-
thusiasts. Discover a vast collection of recipes, from classic comfort food to exotic inter-
national cuisine. Customize your culinary experience by filtering recipes based on dietary
restrictions, cuisine type, or cooking time. Share your own creations with the community,
inspiring others and building a network of like-minded food lovers.

System Analysis And Design 5


2 S TAGE 1 - P LANNING

2.1 Motivation

Cook Handbook project is an interactive and community-driven platform that fills a gap in
the current market of cooking resources. Unlike traditional recipe app, the project focuses
not only on providing users with access to recipes but also on encouraging them to share
their personal culinary experiences, experiments, and specialty dishes. This project is ex-
citing because it combines the creativity of food enthusiasts with the power of technology,
fostering a sense of community around a shared love for cooking. The concept of users con-
tributing their own content, engaging in cooking experiments, and sharing unique dishes
offers a level of interaction that other platforms lack. This level of innovation aligns with
current trends in social media and user-generated content, making it a forward-thinking
project that has the potential to stand out.
The decision to pursue the Cook Handbook project is also driven by its alignment with
broader business strategies focused on customer engagement and brand loyalty. In an in-
creasingly digital world, creating a platform that allows users to connect over food provides
an opportunity to tap into a large and passionate audience. This project supports the busi-
ness by creating a space where users can engage with the brand, interact with one another,
and potentially drive traffic through features like user-generated content and cooking ex-
periments. Moreover, the platform offers multiple monetization possibilities, such as adver-
tising, premium subscriptions, or partnerships with food brands and restaurants, making it
not only a community-building tool but also a revenue-generating initiative.
There are many notable websites and apps contributing to cooking platforms, most notable
Yummly - providing personalized recipe recommendations based on user preferences and
dietary restrictions with AI assistant or Tasty – video centric platform that simplifies cook-
ing by offering short, visually appealing recipe tutorials. However, most of them lack of is
a collaborative and interactive experience between users or experiment and innovate cook-
ings. Therefore, selecting the Cook Handbook project is a strategic choice that combines
innovation, customer engagement, and business growth potential in one cohesive platform.

2.2 Initial System Request

2.2.1 Business need

Cooking enthusiasts, whether seasoned food lovers or apprentice cooks eager to learn, often
face challenges in discovering and mastering unique recipes. Existing platforms primarily
focus on generic or popular dishes, leaving little room for personalized guidance or explo-
ration of creative culinary techniques. Additionally, aspiring cooks may lack the confidence
to experiment in the kitchen without a supportive environment. This app addresses the
need for a comprehensive platform that not only provides access to diverse and unique
recipes but also fosters a community of like-minded individuals. By offering step-by-step
guidance, interactive features, and a space to share culinary successes and challenges, this
app empowers users to expand their cooking skills, explore new cuisines, and confidently
create standout dishes. It bridges the gap between learning, sharing, and enjoying the art of
cooking, making it an essential tool for any food lover or aspiring chef.

System Analysis And Design 6


2.2 Initial System Request

2.2.2 Business requirement

The application is designed to create a win-win scenario for both restaurants and users,
providing value to each stakeholder in unique ways. Below are the detailed business re-
quirements:

For restaurants:

• Increased Visibility: Restaurants can achieve a higher appearance rate on the app’s rec-
ommendation system by providing quality content, such as high-resolution images,
detailed menu descriptions, and engaging promotions. The app will use algorithms to
prioritize restaurants based on user preferences, location, and popularity.
• Targeted Marketing: Restaurants can promote special deals, seasonal menus, or events
to users in their vicinity, ensuring their marketing efforts reach the right audience at
the right time.
• Integration of Reviews and Ratings: Restaurants will benefit from user-generated reviews
and ratings, which help build credibility and attract more customers.

For users:

• Personalized Recommendations: Normal users will receive tailored restaurant recommen-


dations based on their preferences, dietary restrictions, location, and previous interac-
tions on the app.
• Nearby Restaurant Discovery: The app will leverage geolocation to provide users with a
list of nearby restaurants, complete with directions, contact details, and live wait times,
if available.
• User-Friendly Search: Allow users to easily search for restaurants by cuisine, price
range, ratings, and other attributes.
• Interactive Features: Users can save their favorite restaurants, create wish lists, or share
experiences with others. The app will also allow users to participate in polls, leave
detailed reviews, and upload recipes.
• Community Engagement: Users can engage with the app’s community by sharing their
dining experiences, exchanging tips on hidden gems restaurants that are not popular.

Mutual features:

• Feedback and Suggestions System: Both restaurants and users will have a voice in shaping
the platform. Restaurants can respond to user reviews, and users can suggest features
or share feedback about the app’s recommendations.
• Trust and Transparency: The app will ensure transparency by displaying accurate rat-
ings, real reviews, and up-to-date information about restaurants. This builds trust and
fosters long-term engagement with the platform.

System Analysis And Design 7


2.3 Feasibility Analysis

2.2.3 Business values

The app will improve efficiency by automating restaurant recommendations and discovery,
reducing the need for manual searches. It enhances accuracy by providing tailored sugges-
tions based on user preferences and location. Transparency is ensured through real reviews,
ratings, and up-to-date restaurant information, fostering trust. By increasing visibility for
restaurants and offering personalized experiences for users, the app creates mutual benefits,
driving engagement and satisfaction for both parties.

2.3 Feasibility Analysis

2.3.1 Technical feasibility

The project can be developed for app platforms to maximize accessibility and user reach.
Key technical considerations include:

• Interface: The interface will be designed to support either a web or mobile environment,
depending on user preferences.
• Object-Oriented Design: The project will utilize object-oriented programming to ensure
maintainable and scalable code.
• Database and Web Server: A robust database is required to manage user information,
recipes, and restaurant details, along with a reliable web server for hosting the appli-
cation and supporting concurrent users.

2.3.2 Economic feasibility

The platform is expected to attract a large user base, leveraging the widespread interest
in cooking, sharing recipes, and exploring local restaurants. Revenue generation strategies
include:

• Freemium Model: The app will offer free basic features, with premium features such as
advanced search filters, recipe suggestions based on available ingredients, or exclusive
content available for a subscription fee.
• Advertising Opportunities: Partnerships with restaurants or food brands can provide an
additional revenue stream through targeted advertisements.

2.3.3 Organizational feasibility

The app has broad potential for adoption, serving a diverse audience with varying needs:

• General Appeal: Suitable for all age groups, genders, and cultural backgrounds, foster-
ing inclusivity.
• Tourism: A helpful resource for tourists seeking local cuisine recommendations and
authentic dining experiences.

System Analysis And Design 8


2.4 Project Plan

• Beginner Cooks: Provides easy-to-follow recipes, tips, and a supportive community for
sharing culinary experiments.
• Creative Features: Users can explore diverse recipes, get meal ideas based on available
ingredients, and share cooking tips and techniques.

2.4 Project Plan

2.4.1 Methodologies

The top two models considered were system prototyping and throwaway prototyping. Sys-
tem prototyping was chosen for its balance of visibility, flexibility, and efficient task distribu-
tion. It leverages team skills, accommodates schedules, and allows continuous refinement
for cohesive collaboration.

2.4.2 Estimate project scope (size) and time

The project is estimated to be finished within 6 months of development.

2.4.3 Staffing plan

Member Task Assigned Contribution


Dat Drawing Usecase Diagram 100%
Dat Drawing Sequence Diagram 40%
Quan Drawing Sequence Diagram 30%
Nhat Drawing Sequence Diagram 30%
Lam Making slides and report 55%
An Making slides and report 25%
Quan Making slides and report 20%
Tuan Anh Code 40%
Dat Code 30%
Nhat Code 30%
Tuan Anh Describe Usecase 40%
An Describe Usecase 40%
Quan Describe Usecase 20%

Table 1: Task Assignment for Team Members

System Analysis And Design 9


2.4 Project Plan

2.4.4 Case tool

For system modeling, tools like astahUML and drawIO tools are used. For version control,
we implement the project at GitHub for collaborative development and version control.

System Analysis And Design 10


3 S TAGE 2 - A NALYSIS

3.1 Functional Requirements

The application encompasses several process-oriented and information-oriented functional


requirements to ensure smooth operations and user engagement. For user account manage-
ment, the system must allow users to register and store their account information, as well
as update personal details as needed. In terms of recipe and restaurant management, users
will have the ability to search for, upload, and share recipes with other users, enhancing the
platform’s collaborative nature. Additionally, users can search for nearby restaurants, add
comments, and leave star ratings for both recipes and restaurants to provide feedback and
enhance content visibility. Admins play a crucial role in maintaining content quality; they
must be able to review and censor inappropriate or irrelevant recipes. The application also
incorporates social interaction features, enabling users to comment on shared recipes and
restaurant details, like or share recipes, and engage with content posted by others. From
an information management perspective, admins must have the ability to add or remove
recipes and restaurants in the database, as well as moderate user-generated content to main-
tain platform standards. Users can save their favorite recipes and restaurants for future
reference, enhancing usability. Additionally, the system will support a robust review and
rating mechanism, allowing multiple users to leave comments and star ratings, which will
be stored in the database.

3.2 Non-Functional Requirements

The application also incorporates critical non-functional requirements to ensure usability,


performance, security, and cultural inclusivity. Also, the platform must be compatible with
all major network-connected devices, including desktops, mobile phones, and tablets, ensur-
ing accessibility across different user preferences. It must support cross-app compatibility,
including major operating systems like Ubuntu, Windows, MacOS,... The system’s imple-
mentation will leverage development frameworks like Java and JavaFX, ensuring a struc-
tured and maintainable codebase. To store and manage data effectively, the H2 database
engine will be employed, offering lightweight, in-memory operations with persistent stor-
age when required. Performance requirements mandate that search functionality for recipes
and restaurants must return results within 5 seconds to enhance user satisfaction. The sys-
tem must also guarantee 24/7 availability to ensure uninterrupted access for users and must
support up to 100 concurrent users without experiencing performance degradation. Re-
garding security, the platform must restrict database modification privileges solely to ad-
mins, ensuring only authorized personnel can add or remove data. Users will be limited to
editing their own account information, and recipes will remain public and accessible to all
registered users. Additionally, the application must cater to diverse cultural and political
requirements by supporting various food preferences such as vegetarian, vegan, halal, and
kosher. User-generated content will be moderated to exclude offensive, inappropriate, or
culturally insensitive material, fostering a respectful and inclusive platform for all users.

System Analysis And Design 11


3.3 Use Case Diagram

3.3 Use Case Diagram

Figure 1: Use Case Diagram

System Analysis And Design 12


3.3 Use Case Diagram

Use Case: Register

Use Case Name Register


Actor User
Description The user registers a new account to access the system.
Trigger The user clicks on the "Register" button.
Type External
Pre-conditions The user does not already have an account.
Normal course
• User navigates to the login page of the system.
• System displays the login form, prompting the
user to enter a username and password.
• User enters their username and password in the
provided fields and submits the form.
• System validates the entered credentials:
– Checks if the username exists in the
database.
– Verifies if the password matches the stored
password for the provided username.
• If the credentials are valid, the System:
– Authenticates the user.
– Creates a session for the user.
– Redirects the user to the homepage (or the
appropriate landing page).
• User is logged into the system and gains access
to authorized functionalities.

Post-conditions
• A new account is created and stored in the
system.
• The user is notified of successful registration.

Table 2: Use Case: Register

System Analysis And Design 13


3.3 Use Case Diagram

Use Case: Search Recipe/Restaurant

Use Case Name Search Recipe/Restaurant


Actor User
Description The user searches for recipes or restaurants in the
system.
Trigger The user clicks on the "Search" button and enters a
search query.
Type External
Pre-conditions The user has logged into their account.
Normal course
• User navigates to the search feature on the app.
• System displays a search bar where the user can
input a recipe name, ingredient, or keyword.
• User enters a search query (e.g., "pasta" or
"chicken" or "Lau Phan").
• System processes the search query and queries
the database for matching recipes/ restaurants.
• System displays a list of relevant recipes,
including brief details (e.g., recipe name, image,
and preparation time).
• User selects a desired recipe from the search
results.
• System displays the full recipe details,
including ingredients, instructions, and other
relevant information.

Post-conditions The search results are displayed to the user.

Table 3: Use Case: Search Recipe/Restaurant

System Analysis And Design 14


3.3 Use Case Diagram

Use Case: Manage Recipe

Use Case Name Manage Recipe


Actor User
Description User manages recipes which posted by that user in
the system.
Trigger The owner clicks on "Manage Recipe."
Type External
Pre-conditions The owner has logged into their account.
Normal course
• User navigates to the "Manage Recipes" section
in their account.
• System displays the list of recipes already
added by the user (if any) and provides options:
– Create Recipe
– Edit Recipe
– Delete Recipe
– View Recipe
• User selects one of the following actions:
– Create Recipe
– Edit Recipe
– Delete Recipe
– View Recipe
• After completing the action, the System
refreshes the recipe list and reflects any changes
(if applicable).

Post-conditions Recipes are updated in the system and visible to


users.

Table 4: Use Case: Manage Recipe

System Analysis And Design 15


3.3 Use Case Diagram

Use Case: Manage Restaurant

Use Case Name Manage Restaurant


Actor Restaurant Owner
Description The restaurant owner manages restaurant
information in the system.
Trigger The admin clicks on "Manage Restaurant."
Type External
Pre-conditions The admin has logged into their account.
Normal course
• Restaurant Owner navigates to the "Manage
Restaurant" section in their account.
• System displays the current restaurant details
(if already added) and provides options:
– Add Restaurant
– Edit Restaurant
– Delete Restaurant
– View Restaurant Details
• Restaurant Owner selects one of the following
actions:
• After completing the action, the System
refreshes the restaurant information and reflects
any changes (if applicable).

Post-conditions Restaurant information is updated in the system and


accessible to users.

Table 5: Use Case: Manage Restaurant

System Analysis And Design 16


3.3 Use Case Diagram

Use Case: Manage Users

Use Case Name Manage Users


Actor Admin
Description The admin manages user accounts in the system.
Trigger The admin clicks on "Manage Users."
Type External
Pre-conditions The admin has logged into their account.
Normal course
• Admin navigates to the "Manage Users" section
in the admin dashboard.
• System displays a list of all registered users,
showing details like:
– Username
– Email
– Account status
– Role
• Admin selects one of the following actions:
– Add user
– Edit user
– Delete user
– View user detail
– Update user status
• After completing any action, the System
refreshes the user list to reflect changes.

Post-conditions User accounts are updated in the system.

Table 6: Use Case: Manage Users

System Analysis And Design 17


3.3 Use Case Diagram

Use Case: Login

Use Case Name Login


Actor User
Description The user logs into their account to access the system.
Trigger The user clicks on the "Login" button.
Type External
Pre-conditions The user has a registered account.
Normal course
• User navigates to the Login Page of the system.
• System displays the login form with fields for
username/email and password.
• User enters their username/email and
password into the respective fields and submits
the form (e.g., by clicking "Login").
• System validates the credentials:
– Checks if the username/email exists in the
database.
– Verifies that the entered password matches
the stored password for the given
username/email.
• If the credentials are valid:
– System authenticates the user.
– System creates a session for the user to
maintain login status.
– System redirects the user to the
homepage/dashboard or the appropriate
landing page.
• User gains access to their account and the
system’s features.

Post-conditions The user is logged into their account and can use the
system features.

Table 7: Use Case: Login

System Analysis And Design 18


3.3 Use Case Diagram

Use Case: Approve Recipe/ Restaurant

Use Case Name Approve Recipe/ Restaurant


Actor Admin
Description Admin decide which recipes/ restaurants could be
accepted and uploaded
Trigger Admin click button view "Pending Approvals"
Type External
Pre-conditions The user has a admin account.
Normal course
• Admin navigates to the "Pending Approvals"
section in the admin dashboard.
• System displays a list of recipes and restaurants
submitted by users that require approval.
– Each entry includes details such as:
* For Recipes: Recipe name, ingredients,
instructions, uploaded images, and
submitter information.
* For Restaurants: Restaurant name,
location, contact details, operating
hours, cuisine type, uploaded images,
and submitter information.
• Admin selects an entry (recipe or restaurant) to
review.
• System displays the full details of the selected
recipe or restaurant.
• Admin reviews the details and performs one of
the following actions:
– Approve the Recipe or Restaurant
– Reject the Recipe or Restaurant
• System refreshes the pending approval list to
reflect the updated status.

Post-conditions
• The selected recipe or restaurant is either
approved or rejected by the admin.
• The status of the recipe or restaurant is updated
in the system.
• The submitter is notified of the decision.

Table 8: Use Case: Approve Recipe/ Restaurant

System Analysis And Design 19


3.4 Activity Diagram

3.4 Activity Diagram

Figure 2: Manage Recipe Activity Diagram

System Analysis And Design 20


3.4 Activity Diagram

Figure 3: Manage Restaurant Activity Diagram

System Analysis And Design 21


3.4 Activity Diagram

Figure 4: Manage User Activity Diagram

System Analysis And Design 22


3.5 Sequence Diagram

3.5 Sequence Diagram

Figure 5: Login Sequence Diagram


The Login sequence diagram illustrates the interaction between the User, UI, Login Con-
troller, User DAO, and Entity Object during the login process. The user enters their cre-
dentials, which are passed through the UI to the Login Controller. The Login Controller
queries the User DAO, which executes an SQL operation to validate the credentials. If the
credentials are valid, the system displays the dashboard view. If invalid, an error message
is returned, notifying the user of the failure.

Figure 6: Register Sequence Diagram


The Register sequence diagram demonstrates the steps involved when a user registers for
a new account. The user initiates the registration process through the UI, which sends the
request to the Register Controller. The controller forwards the request to the User DAO,
where an SQL operation is executed to store the new user details. If the registration is valid,
the dashboard view is shown. If invalid, the system returns an error, informing the user of
the unsuccessful registration.

System Analysis And Design 23


3.5 Sequence Diagram

Figure 7: Manage Recipe Sequence Diagram

The Manage Recipe sequence diagram shows the interactions involved when a user man-
ages their recipes. The process includes three main actions: uploading, retrieving, and delet-
ing recipes. First, the user uploads a recipe through the UI, which forwards the request to
the ManageRecipeController, then to the Recipe DAO, where an SQL query saves the recipe
in the database. Next, the user requests their recipes, prompting the system to fetch the data
from the database through similar interactions. Finally, the user can delete a recipe, where
the system processes the deletion request and updates the database accordingly. For each
action, if the operation is valid, the system confirms success and refreshes the interface to
reflect the updated recipe list.

System Analysis And Design 24


3.5 Sequence Diagram

Figure 8: Manage Restaurant Sequence Diagram

The Manage Restaurant sequence diagram demonstrates the steps involved when a restau-
rant owner manages their restaurant data. The process includes three main operations: sign-
ing up a restaurant, retrieving restaurant details, and deleting a restaurant. First, when
the restaurant owner signs up a new restaurant, the request is sent through the UI to the
ManageRestaurantController, which saves the data via the Restaurant DAO and executes a
database query to store the information. Second, when the owner requests to retrieve their
restaurant details, the flow proceeds through the UI and ManageRestaurantController to the
Restaurant DAO, which queries the database to fetch the required data. Lastly, for deleting
a restaurant, the delete request follows the same process chain, where the Restaurant DAO
executes a delete operation on the database. After each operation, if successful, the system
validates the response and refreshes the interface to reflect the changes.

System Analysis And Design 25


3.5 Sequence Diagram

Figure 9: Manage User Sequence Diagram

The Manage User sequence diagram illustrates the interactions involved in managing user
data within the system. It encompasses three primary operations: creating, retrieving, and
deleting user records. When a user initiates the creation of a new user, the request is trans-
mitted from the UI to the AdminController, which then delegates the creation process to
the UserDao. The UserDao subsequently executes a database query to insert the new user
details into the database. For retrieving all users, the request is similarly routed from the UI
to the AdminController, which then forwards it to the UserDao. The UserDao retrieves the
user data through a database query and returns it to the AdminController. Finally, to delete
a user, the request originates from the UI and is directed to the AdminController, which
then instructs the UserDao to execute a database delete query to remove the specified user
from the database. Upon successful completion of each operation, the system validates the
outcome and updates the user interface accordingly.

System Analysis And Design 26


3.5 Sequence Diagram

Figure 10: Search Recipe Sequence Diagram

The Search Recipe sequence diagram outlines the interactions when a user searches for
recipes. The process involves several key actions: initiating a search with specific crite-
ria, viewing detailed information about individual recipes, submitting reviews for recipes,
and managing a favorites list by adding or removing recipes. First, when the user initiates
a search, the request is sent from the UI to the SearchController, which delegates the search
operation to the Recipe DAO. The Recipe DAO executes a database query to retrieve recipes
that match the search criteria. Next, when the user views a recipe’s details, the request flows
through the UI and SearchController to the Recipe DAO, which retrieves the detailed infor-
mation from the database. For submitting reviews, the user initiates the review operation

System Analysis And Design 27


3.5 Sequence Diagram

through the UI, and the SearchController forwards the request to the Recipe DAO, which ex-
ecutes a database query to store the review. Lastly, for managing favorites, the user initiates
the add/remove operation through the UI, and the SearchController forwards the request
to the Recipe DAO, which executes the necessary database queries to update the user’s fa-
vorites list. After each action, if successful, the system validates the operation and updates
the user interface accordingly.

System Analysis And Design 28


3.5 Sequence Diagram

Figure 11: Search Restaurant Sequence Diagram

The Search Restaurant sequence diagram illustrates the interactions when a user searches
for restaurants. The process involves several key actions: initiating a search with specific
criteria, viewing detailed information about individual restaurants, submitting reviews for
restaurants, and managing a favorites list by adding or removing restaurants. First, when
the user initiates a search, the request is sent from the UI to the SearchController, which del-
egates the search operation to the RestaurantDao. The RestaurantDao executes a database
query to retrieve restaurants that match the search criteria. Next, when the user views a
restaurant’s details, the request flows through the UI and SearchController to the Restau-
rantDao, which retrieves the detailed information from the database. For submitting re-

System Analysis And Design 29


3.5 Sequence Diagram

views, the user initiates the review operation through the UI, and the SearchController for-
wards the request to the RestaurantDao, which executes a database query to store the review.
Lastly, for managing favorites, the user initiates the add/remove operation through the UI,
and the SearchController forwards the request to the RestaurantDao, which executes the
necessary database queries to update the user’s favorites list. After each action, if success-
ful, the system validates the operation and updates the user interface accordingly.

System Analysis And Design 30


3.5 Sequence Diagram

Figure 12: Request Handle Sequence Diagram

The Request Handle sequence diagram outlines the interactions when an admin handles a
user’s request. The process involves three main actions: viewing the request, accepting the
request, and rejecting the request. First, when the admin views a request, the request is sent
from the UI to the AdminController, which delegates the retrieval of the request details to
the UserDao. The UserDao executes a database query to fetch the request information and
returns it to the AdminController. Next, when the admin accepts the request, the request is
sent from the UI to the AdminController, which delegates the acceptance operation to the
UserDao. The UserDao executes a database query to update the request status to "accepted".
Lastly, for rejecting a request, the admin initiates the rejection operation through the UI,
and the AdminController forwards the request to the UserDao, which executes a database
query to update the request status to "rejected". After each action, if successful, the system
validates the operation and updates the user interface accordingly.

System Analysis And Design 31


4 S TAGE 3: D ESIGN

4.1 Design Overview

Based on the MVC architecture, the system is divided into three main packages.

Figure 13: View and Controller

4.1.1 View (Front-end)

The View package represents the user interface, allowing users to interact with the system.
It includes: Register, Login, Dashboard and DetailRecipe.
These interfaces (defined in FXML) display data to users and capture user actions.

4.1.2 Controller (Back-end)

The Controller package handles logic and user actions, bridging the View and Model. Key
controllers include:

• RegisterController: Manages user registration logic.


• LoginController: Handles user authentication.
• DashboardController: Manages dashboard functionalities.
• RecipeController: Processes recipe-related actions.

System Analysis And Design 32


4.1 Design Overview

4.1.3 Model (Back-end)

The Model package manages the data and business logic. It includes:

• Entity: Represents core system actors and objects:


– Actor: User, Admin, and RestaurantOwner.
– Entities: Restaurant and Recipe.
• DAO (Data Access Objects): Interfaces for database operations:
– UserDAO, RecipeDAO, RestaurantDAO, AssessmentDAO

Figure 14: Model package

System Analysis And Design 33


4.2 Detailed Package Model

4.2 Detailed Package Model

Figure 15: User class

User
Attribute Name Data Type Access Modifier Description
id int private User’s ID
email String private User’s email
username String private User’s username
password String private User’s password
myRecipes ArrayList<Recipe> private User’s created recipes
favRecipes ArrayList<Recipe> private User’s favorite recipes
favRestaurants ArrayList<Restaurant> private User’s favorite restaurants

Table 9: User Class Attributes

System Analysis And Design 34


4.2 Detailed Package Model

User
Method Name Method Type Access Modifier Description
setId void public Set Id for user
setEmail void public Set email for user
setUsername void public Set username
setPassword void public Set password
setMyRecipes void public Set user’s created recipes
setFavRecipes void public Set user’s favorite recipes
setFavRestaurants void public Set user’s favorite restaurants
getId int public Get Id for user
getUsername String public Get username
getPassword String public Get password
getMyRecipes ArrayList<Recipe> public Get user’s created recipes
getFavRecipes ArrayList<Recipe> public Get user’s favorite recipes
getFavRestaurants ArrayList<Restaurant> public Get user’s favorite restaurants

Table 10: User Class Methods

Figure 16: RestaurantOwner class

RestaurantOwner
Attribute Name Data Type Access Modifier Description
List of names of restaurants
myRestaurants ArrayList<Restaurant> private
owned by an user

Table 11: RestaurantOwner Class Attributes

System Analysis And Design 35


4.2 Detailed Package Model

RestaurantOwner
Method Name Method Type Access Modifier Description
setMyRestaurants void public User’s ID
getMyRestaurants ArrayList<Restaurant> public User’s email

Table 12: RestaurantOwner Class Methods

Figure 17: Admin class

Admin
Attribute Name Data Type Access Modifier Description
Recipes queue waiting for
recipesQueue ArrayList<Recipe> private
approved from admin
Restaurant queue waiting for
restaurantQueue ArrayList<Restaurant> private
approved from admin

Table 13: Admin Class Attributes

Admin
Method Name Method Type Access Modifier Description
Set the waiting
setRecipesQueue void public
recipes queue
Set waiting
setRestaurantsQueue void public
restaurants queue
Get waiting
getRecipesQueue ArrayList<Recipe> public
recipes queue
Get waiting
getRestaurantsQueue ArrayList<Restaurant> public
restaurants queue

Table 14: Admin Class Methods

System Analysis And Design 36


4.2 Detailed Package Model

Figure 18: Recipe class

Recipe
Attribute Name Data Type Access Modifier Description
id int private ID of recipe
name String private Name of recipe
authorId int private Author ID of recipe
cuisineType String private Cuisine type of recipe
time int private Time to cook
ingredients String private Ingredients of recipe
tutorial String private Tutorial (Step by step)
assessments ArrayList<Assessment> private Assessments of recipe

Table 15: Recipe Class Attributes

System Analysis And Design 37


4.2 Detailed Package Model

Recipe
Method Name Method Type Access Modifier Description
setId void public Set id for Recipe
setName void public Set name for Recipe
setAuthorId void public Set author name of the Recipe
setCuisine void public Set cuisine type of the Recipe
setTime void public Set time creation of the Recipe
setIngredients void public Set ingredients of the Recipe
setTutorial void public Set tutorial text of the Recipe
setAssessments void public Set assessments of the Recipe
getId int public Get id for Recipe
getName String public Get name for Recipe
getAuthorId String public Get author id of the Recipe
getCuisine String public Get cuisine type of the Recipe
getTime int public Get time creation of the Recipe
getIngredients String public Get ingredients of the Recipe
getTutorial String public Get tutorial text of the Recipe
getAssessments ArrayList<Assessment> public Get assessments of the Recipe

Table 16: Recipe Class Methods

Figure 19: Restaurant class

System Analysis And Design 38


4.2 Detailed Package Model

Restaurant
Attribute Name Data Type Access Modifier Description
id int private ID of restaurant
name String private Name of restaurant
ownerId int private Owner ID of restaurant
address String private Address of restaurant
phoneNumber String private Phone Number of restaurant

Table 17: Restaurant Class Attributes


Restaurant
Method Name Method Type Access Modifier Description
setId void public set ID for restaurant
setName void public set name for restaurant
setOwnerId void public set Owner ID of restaurant
setAddress void public set address for restaurant
setPhoneNumber void public set phone number for restaurant
getId int public get restaurant’s ID
getName String public get Name of restaurant
getOwnerId int public get Owner ID of restaurant
getAddress String public get address of restaurant
getPhoneNumber String public get Phone Number of restaurant

Table 18: Restaurant Class Methods

Figure 20: Assessment class

System Analysis And Design 39


4.2 Detailed Package Model

Assessment
Attribute Name Data Type Access Modifier Description
authorId int private ID of author
rate int private Rating from author
comment String private Comment from author

Table 19: Assessment Class Attributes


Assessment
Method Name Method Type Access Modifier Description
setAuthorId void public set author ID
setRate void public set rating from author
setComment void public set comment from author
getAuthorId int public get author ID
getRate int public get rating from author
getComment String public get comment from author

Table 20: Assessment Class Methods

Figure 21: UserDao class


UserDao
Attribute Name Data Type Access Modifier Description
conn Connection private Connection to Database

Table 21: UserDao Attributes

System Analysis And Design 40


4.2 Detailed Package Model

UserDao
Method Name Method Type Access Modifier Description
insert void public Insert to the users table
update void public Update a row in the users table
deleteByID void public Delete a row in users table
findUser User public Return user by username and password

Table 22: UserDao Methods

Figure 22: RecipeDao class


RecipeDao
Attribute Name Data Type Access Modifier Description
conn Connection private Connection to Database

Table 23: RecipeDao Attributes


RecipeDao
Method Name Method Type Access Modifier Description
insert void public Insert to the recipes table
update void public Update a row in the recipes table
delete void public Delete a row in recipes table
findRecipes ArrayList<Recipe> public Return list of recipes by name
getAllAccepted ArrayList<Recipe> public Return all accepted recipes
getAllPending ArrayList<Recipe> public Return all pending recipes

Table 24: RecipeDao Methods

System Analysis And Design 41


4.2 Detailed Package Model

Figure 23: RestaurantDao class


RestaurantDao
Attribute Name Data Type Access Modifier Description
conn Connection private Connection to Database

Table 25: RestaurantDao Attributes


RestaurantDao
Method Name Method Type Access Modifier Description
Insert to
save void public
the restaurants table
Update a row in
update void public
the restaurants table
Delete a row in
delete void public
restaurants table
Return list of
findRestaurants ArrayList<Restaurant> public
restaurants by name
Return all accepted
getAllAccepted ArrayList<Restaurant> public
restaurants
Return all pending
getAllPending ArrayList<Restaurant> public
restaurants

Table 26: RestaurantDao Methods

System Analysis And Design 42


4.2 Detailed Package Model

Figure 24: AssessmentDao class


AssessmentDao
Attribute Name Data Type Access Modifier Description
conn Connection private Connection to Database

Table 27: AssessmentDao Attributes


AssessmentDao
Method Name Method Type Access Modifier Description
Insert to
save void public the recipe/restaurant
review table
Delete a row
delete void public in recipe/restaurant
review table
Get recipes’
getRecipesAssessments ArrayList<Assessment> public
assessments
Get restaurants’
getRestaurantAssessments ArrayList<Assessment> public
assessments

Table 28: AssessmentDao Methods

System Analysis And Design 43


4.2 Detailed Package Model

Figure 25: RecipeAssessment class


RecipeAssessment
Attribute Name Data Type Access Modifier Description
recipeId int private ID of recipe

Table 29: RecipeAssessment Class Attributes


RecipeAssessment
Method Name Method Type Access Modifier Description
setRecipeId void public set recipe’s Id
getRecipeId int public get recipe’s Id

Table 30: RecipeAssessment Class Methods

System Analysis And Design 44


4.2 Detailed Package Model

Figure 26: RestaurantAssessment class


RestaurantAssessment
Attribute Name Data Type Access Modifier Description
restaurantId int private ID of restaurant

Table 31: RestaurantAssessment Class Attributes


RestaurantAssessment
Method Name Method Type Access Modifier Description
getRestaurantId void public get restaurant’s Id
setRestaurantId int public get restaurant’s Id

Table 32: RestaurantAssessment Class Methods

System Analysis And Design 45


4.2 Detailed Package Model

Figure 27: AppDb class


AppDb
Attribute Name Data Type Access Modifier Description
conn Connection private Initialize Connection to Database
url String private URL of Database Server
user String private Username of Database Server
password String private Password of Database Server

Table 33: AppDb Attributes


AppDb
Method Name Method Type Access Modifier Description
getConnection Connection public Return Connection to Database
closeConnection void public Close connection

Table 34: AppDb Methods

System Analysis And Design 46


5 S TAGE 4: I MPLEMENTATION
This is the demo of our implementation for our app.
Login function

Figure 28: Login


This is the user interface for our login function. Users need to enter their username and
password, then press the "Login" button to access the dashboard. If a user does not have an
account yet, they need to click the "Register" button to go to the registration interface.

System Analysis And Design 47


Register function

Figure 29: Register


This is the user interface for the registration function. Users simply need to fill in the re-
quired fields and click the "Register" button.

System Analysis And Design 48


Dashboard function

Figure 30: Dashboard

This is the dashboard displaying a list of recipes. Users can access their profile through "My
Profile," "Newsfeed," and "My Favorite Recipes." For each recipe shown on the dashboard,
users can click "View Details" to see the recipe details or "Add to Favorites" to save it. They
can also upload their own recipes to share with the community.

System Analysis And Design 49


Recipe details function

Figure 31: Recipe details


This is the user interface for each recipe. The "Description" box provides an overview of
the dish. The "Recipe" section contains the main content, which may include ingredients,
step-by-step instructions, .... The "Comments" section displays reviews of the dish. Users
can also add the dish to their favorites by clicking the red "Add to Favorites" button.

System Analysis And Design 50


6 C ONCLUSION
The Cook Handbook project represents a significant step toward bridging the gap between
traditional recipe-sharing platforms and modern, interactive culinary tools. It has been de-
veloped as an engaging, community-driven application that not only provides access to
diverse recipes but also encourages user participation through features like sharing culinary
creations, rating restaurants, and interacting with fellow food enthusiasts. This dynamic
approach fosters a sense of community while addressing the growing demand for personal-
ization and creativity in the cooking space.
One of the most critical lessons learned from this project is the value of user-centric de-
sign. The integration of interactive features and personalized recommendations highlights
the importance of understanding and addressing real user needs. Additionally, the project’s
success can be attributed to efficient collaboration and clear role assignments within the de-
velopment team. By dividing responsibilities across tasks such as system design, coding,
and reporting, the team ensured the smooth progress of the project. Furthermore, the adop-
tion of an iterative development model, such as system prototyping, allowed for continuous
improvement based on feedback, significantly enhancing the quality of the final product.
From a broader perspective, this project also provided insights into balancing technical fea-
sibility and business goals. Using cost-effective tools like JavaFX and the H2 database en-
sured scalability and performance, while business strategies such as the freemium model
and targeted advertising offer clear revenue potential. These approaches demonstrated how
innovation can align with both technical and economic considerations, making the platform
sustainable in the long term.
Looking ahead, the Cook Handbook has immense potential for further development. Future
plans include integrating advanced AI to provide smarter recipe recommendations and meal
planning features. Expanding the platform globally through localization, multi-language
support, and accommodating diverse cultural cuisines will help reach a broader audience.
The creation of a mobile app for iOS and Android is also a priority to enhance accessibility.
Additionally, community-driven features like forums, live cooking classes, and partnerships
with food brands and restaurants will deepen user engagement and enrich the ecosystem.
In conclusion, the Cook Handbook is more than just a recipe-sharing platform; it is a space
for creativity, connection, and inspiration. The project’s innovative approach to fostering
community interactions, coupled with its scalability and monetization potential, sets the
stage for a transformative culinary experience. By building on the lessons learned and incor-
porating planned enhancements, the Cook Handbook has the potential to become a global
leader in interactive culinary applications. Its ability to evolve and adapt to user needs en-
sures that it will remain relevant and impactful in the ever-changing digital landscape.

System Analysis And Design 51

You might also like