-
Notifications
You must be signed in to change notification settings - Fork 1
UML Sequence Diagram
cemsarpkaya edited this page May 15, 2025
·
23 revisions
Log in*
sequenceDiagram
actor User as Personal User
participant System as AuthenticationSystem
User ->> System : login(username,password)
activate System
System -->> System : h = hashPassword(password)
System ->> Database : query(username, h)
activate Database
Database -->> System : response
deactivate Database
alt response == FOUND
System -->> User : response
else response != FOUND
System -->> User : response
deactivate System
end
Register*
sequenceDiagram
actor User as Non-Registered User
User ->> NonRegisteredUser : register(username,password,email)
activate NonRegisteredUser
NonRegisteredUser -->> NonRegisteredUser : response = validateEmail(email)
alt response == true
NonRegisteredUser ->> AuthenticationSystem : hashPassword(password)
activate AuthenticationSystem
AuthenticationSystem -->> NonRegisteredUser : h
deactivate AuthenticationSystem
NonRegisteredUser ->> Database : add(username, h ,email)
activate Database
Database -->> NonRegisteredUser : status
deactivate Database
NonRegisteredUser -->> User : response
else response == false
NonRegisteredUser -->> User : response
deactivate NonRegisteredUser
end
Rate Health Score of a Recipe*
sequenceDiagram
actor User as Dietitian (User)
User ->> Dietitian : rateRecipeHealthiness(recipe, score)
activate Dietitian
participant R as recipe : Recipe
Dietitian ->> R : updateRating("health", score)
activate R
R ->> Database : update(recipe.id, recipe.healthRating)
activate Database
Database -->> R : status
deactivate Database
R -->> Dietitian : response
deactivate R
Dietitian -->> User : response
deactivate Dietitian
*: In these diagrams, error/exception handling due to reasons unrelated to the user input are omitted for the sake of simplicity.
Like A Recipe
sequenceDiagram
actor U as User (logged in)
participant RU as RegisteredUser
participant R as Recipe
participant DB as Database
Note over RU: RU.likedRecipes: List<Recipe>
Note over R: R.likes: int
U->>RU: likeRecipe(R)
alt R NOT in RU.likedRecipes
RU->>R: addLike()
R->>DB: addLike(RU, R)
DB-->>R: {status}
alt status = success
R-->>RU: {status}
RU->>RU: likedRecipes.add(R)
RU->>U: show "Recipe liked successfully"
else status = failure
R-->>RU: {status}
RU->>U: show "Failed to like recipe"
end
else R in RU.likedRecipes
RU->>R: removeLike()
R->>DB: removeLike(RU, R)
DB-->>R: {status}
alt status = success
R-->>RU: {status}
RU->>RU: likedRecipes.remove(R)
RU->>U: show "Recipe unliked successfully"
else status = failure
R-->>RU: {status}
RU->>U: show "Failed to unlike recipe"
end
end
Follow A User
sequenceDiagram
actor U as User (logged in)
participant RU as RegisteredUser (Follower)
participant TU as RegisteredUser (Target)
participant DB as Database
U->>RU: followUser(TU)
RU->>DB: followUser(RU, TU)
DB-->>RU: {status}
alt status = success
RU->>RU: followedUsers.add(TU)
TU->>TU: followerUsers.add(RU)
RU->>U: show "Successfully followed user"
else status = failure
RU->>U: show "Failed to follow user"
end
Delete A Recipe Comment
sequenceDiagram
actor U as User (logged in)
participant RU as RegisteredUser
participant RC as RecipeComment
participant R as Recipe
participant DB as Database
U->>RU: deleteRecipeComment(RC)
RU->>RC: deleteRecipeComment()
RC->>DB: deleteRecipeComment(RC)
DB-->>RC: {status}
alt status = success
RC-->>RU: {status}
RU->>R: removeComment(RC)
RU->>U: show "Comment deleted successfully"
else status = failure
RC-->>RU: {status}
RU->>U: show "Failed to delete comment"
end
Post a Question (Ali Gokcek)
sequenceDiagram
actor U as User
participant RU as RegisteredUser
participant Q as Question
participant DB as Database
Note over RU: RU.askedQuestions : List<Question>
Note over Q: Q.id, Q.title, Q.content, Q.timestamp, etc.
U->>RU: askQuestion(title, content)
alt question is VALID
RU->>Q: construct Question(title, content, RU)
Note over Q: sets Q.author = RU<br/>assigns Q.id, Q.timestamp, etc.
Q->>DB: saveQuestion(Q)
DB-->>RU: {status}
alt status = success
RU->>RU: askedQuestions.add(Q)
Note over RU: Q added to askedQuestions
RU-->>U: show "Question successfully added"
else status = failure
Note over RU: rollback changes
RU-->>U: show error "Question could not be posted"
end
else question is INVALID
RU-->>U: show error "Invalid question data"
end
Rate Taste/Difficulty Score (Ali Gokcek)
sequenceDiagram
actor U as User
participant RU as RegisteredUser
participant R as Recipe
participant DB as Database
Note over RU: RU.ratedRecipes : List<Recipe>
Note over R: R.tasteScore : double<br/>R.difficultyScore : double<br/>R.numberOfRatings : int
U->>RU: rateRecipe(R, category, rate)
RU->>R: updateRating(category, rate)
Note over R: updates aggregate ratings<br/>e.g., R.tasteScore, R.difficultyScore
R->>DB: updateRecipeRating(R.id, R.tasteScore, R.difficultyScore)
DB-->>R: {status}
R-->>RU: {status}
alt status = success
alt R NOT in RU
RU->>RU: ratedRecipes.put(R)
Note over RU: first time rating stored
else R ALREADY in RU
Note over RU: no changes needed on RU
end
RU-->>U: show "Rating successfully recorded"
else status = failure
Note over RU: rollback changes if needed
RU-->>U: show error "Rating could not be recorded"
end
Filter Recipes (Ali Gokcek)
sequenceDiagram
actor U as User
participant RU as RegisteredUser
participant DB as Database
U->>RU: filterRecipes(criteria)
RU->>DB: findRecipesByCriteria(criteria)
alt Matching recipes found
DB-->>RU: {result}
RU->>RU: process/filter/sort results (optional)
RU-->>U: {result}
else NO matching recipes found
DB-->>RU: {empty list}
RU-->>U: {empty list}
Note over U: No matching recipes found
end
- Celil Özkan (Backend)
- Cem Sarpkaya (Backend)
- Özgür Savaşçıoğlu (Backend)
- Ahmet Hacıoğlu (Frontend)
- Ahmet Selçuk Ersoy (Frontend)
- Bahadır Demirel (Frontend)
- Muhammed Ekinci (Frontend)
- Ali Gökçek (Mobile)
- Seyit Mustafa Demir (Mobile)
- Meeting Agenda 1
- Meeting Agenda 2
- Meeting Agenda 3
- Meeting Agenda 4
- Meeting Agenda 5
- Meeting Agenda 6
- Meeting Notes 1 (16.02.2025)
- Meeting Notes 2 (24.02.2025)
- Meeting Notes 3 (27.02.2025)
- Meeting Notes 4 (04.03.2025)
- Meeting Notes 5 (06.03.2025)
- Meeting Notes 6 (13.03.2025)
- Meeting Notes 7 (17.03.2025)
- Meeting Notes 8 (21.04.2025)
- Meeting Notes 9 (28.04.2025)
- Meeting Notes 10 (01.05.2025)
- Meeting Notes 11 (06.05.2025)
- Lecture Notes 1 (13.02.2025)
- Lecture Notes 2 (20.02.2025)
- Lecture Notes 3 (27.02.2025)
- Lecture Notes 4 (06.03.2025)
- Lecture Notes 5 (13.03.2025)
Click to Expand ⬇️
- Scenario 1 - User Register
- Scenario 2 - Dietitian Register
- Scenario 3 - User Login
- Scenario 4 - User Deletion
- Scenario 5 - Upload & Edit Recipe
- Scenario 6 - Single Meal Planning
- Scenario 7 - Grocery Price Comparison
- Scenario 8 - Community Forum
- Scenario 9 - Recipe Discovery & Filter
- Scenario 10 - Local Food Discovery
- Scenario 11 - Nutritional Guidance Interaction
- Scenario 12 - Market Inventory Management
- Scenario 13 - Profile Management and Preference Settings
- Scenario 14 - Rate and Comment the Recipe by User
- Scenario 15 - Bookmark a Meal and Access it in Profile Page
- Scenario 16 - Adding Nutrition Tips to a Dietitian Profile
- Scenario 17 - User Forget Password
- Scenario 18 ‐ User Follows Unfollows Users
- Scenario 19 - Allergen Alert and Meal Plan Adjustment
- Scenario 20 - Dietitian Rating of a Recipe