-
Notifications
You must be signed in to change notification settings - Fork 0
CMPE352‐Sequence Diagrams ‐ User & Account Management
Selman Akman edited this page Oct 15, 2025
·
1 revision

@startuml
actor User
participant ":System" as System
participant ":User" as UserObj
participant ":AuthenticationService" as AuthService
participant "Database" as DB
title "Sign Up"
User -> System: signUp(username, email, password)
System -> UserObj: signUp(username, email, password)
UserObj -> AuthService: validateCredentials(username, email, password)
alt Valid Credentials
AuthService --> UserObj: valid
UserObj -> DB: checkUserExists(username, email)
alt User Does Not Exist
DB --> UserObj: notExists
UserObj --> UserObj: generateUserID()
UserObj -> DB: storeUser(userID, username, email, password)
alt User Stored
DB --> UserObj: success
UserObj --> System: true
System --> User: displayMessage("Account created successfully")
else Database Error
DB --> UserObj: error
UserObj --> System: false
System --> User: displayMessage("Failed to create account due to database error")
end alt
else User Exists
DB --> UserObj: exists
UserObj --> System: false
System --> User: displayMessage("Username or email already in use")
end alt
else Invalid Credentials
AuthService --> UserObj: error
UserObj --> System: false
System --> User: displayMessage("Invalid username, email, or password (must be 8+ characters with letters and numbers)")
end alt
@enduml
@startuml
actor User
participant ":System" as System
participant ":User" as UserObj
participant ":AuthenticationService" as AuthService
participant "Database" as DB
title "Log In"
User -> System: logIn(email, password)
System -> UserObj: logIn(email, password)
UserObj -> AuthService: authenticateLogin(email, password)
alt Credentials Valid
AuthService -> DB: verifyCredentials(email, password)
alt User Found
DB --> AuthService: userID
AuthService --> UserObj: true
UserObj --> System: true
System --> User: displayMessage("Login successful")
else User Not Found
DB --> AuthService: notFound
AuthService --> UserObj: false
UserObj --> System: false
System --> User: displayMessage("Invalid email or password")
else Database Error
DB --> AuthService: error
AuthService --> UserObj: false
UserObj --> System: false
System --> User: displayMessage("Failed to log in due to database error")
end alt
else Invalid Credentials
AuthService --> UserObj: false
UserObj --> System: false
System --> User: displayMessage("Invalid email or password")
end alt
@enduml
@startuml
actor User
participant ":System" as System
participant ":User" as UserObj
participant ":AuthenticationService" as AuthService
participant "GoogleAPI" as GoogleAPI
participant "Database" as DB
title "Login via Google"
User -> System: logInViaGoogle(googleToken)
System -> UserObj: logInViaGoogle(googleToken)
UserObj -> AuthService: authenticateLogin(googleToken)
alt Valid Token
AuthService -> GoogleAPI: verifyToken(googleToken)
alt Token Verified
GoogleAPI --> AuthService: userEmail
AuthService -> DB: checkUserExists(userEmail)
alt User Exists
DB --> AuthService: userID
AuthService --> UserObj: true
UserObj --> System: true
System --> User: displayMessage("Google login successful")
else User Does Not Exist
DB --> AuthService: notExists
AuthService --> UserObj: false
UserObj --> System: false
System --> User: displayMessage("No account linked to this Google email")
else Database Error
DB --> AuthService: error
AuthService --> UserObj: false
UserObj --> System: false
System --> User: displayMessage("Failed to log in due to database error")
end alt
else Invalid Token
GoogleAPI --> AuthService: error
AuthService --> UserObj: false
UserObj --> System: false
System --> User: displayMessage("Invalid Google token")
end alt
else Invalid Input
AuthService --> UserObj: false
UserObj --> System: false
System --> User: displayMessage("Invalid Google token")
end alt
@enduml
@startuml
actor User
participant ":System" as System
participant ":User" as UserObj
participant ":EmailService" as EmailService
participant "Database" as DB
title "Reset Password"
User -> System: resetPassword(email)
System -> UserObj: resetPassword(email)
UserObj -> DB: checkUserExists(email)
alt User Exists
DB --> UserObj: userID
UserObj -> EmailService: sendResetLink(email)
alt Email Sent
EmailService --> UserObj: success
UserObj --> System: true
System --> User: displayMessage("Password reset link sent to your email")
else Email Error
EmailService --> UserObj: error
UserObj --> System: false
System --> User: displayMessage("Failed to send reset link")
end alt
else User Not Found
DB --> UserObj: notFound
UserObj --> System: false
System --> User: displayMessage("Email not found")
else Database Error
DB --> UserObj: error
UserObj --> System: false
System --> User: displayMessage("Failed to reset password due to database error")
end alt
@enduml
@startuml
actor User
participant ":System" as System
participant ":User" as UserObj
participant "Database" as DB
title "View Profile"
User -> System: viewProfile()
System -> UserObj: getUserID()
alt User Authenticated
UserObj --> System: userID
System -> UserObj: viewProfile()
UserObj -> DB: fetchProfile(userID)
alt Profile Found
DB --> UserObj: UserProfile
UserObj --> System: UserProfile
System --> User: displayMessage("Profile displayed", UserProfile)
else Profile Not Found
DB --> UserObj: notFound
UserObj --> System: null
System --> User: displayMessage("Profile not found")
else Database Error
DB --> UserObj: error
UserObj --> System: null
System --> User: displayMessage("Failed to fetch profile due to database error")
end alt
else User Not Authenticated
UserObj --> System: error
System --> User: displayMessage("Please log in to view profile")
end alt
@enduml
@startuml
actor User
participant ":System" as System
participant ":User" as UserObj
participant "Database" as DB
title "Edit Profile"
User -> System: editProfile(profileData)
System -> UserObj: getUserID()
alt User Authenticated
UserObj --> System: userID
System -> UserObj: editProfile(profileData)
alt Valid Profile Data
UserObj -> DB: updateProfile(userID, profileData)
alt Profile Updated
DB --> UserObj: success
UserObj --> System: true
System --> User: displayMessage("Profile updated successfully")
else Database Error
DB --> UserObj: error
UserObj --> System: false
System --> User: displayMessage("Failed to update profile due to database error")
end alt
else Invalid Profile Data
UserObj --> System: false
System --> User: displayMessage("Invalid profile data")
end alt
else User Not Authenticated
UserObj --> System: error
System --> User: displayMessage("Please log in to edit profile")
end alt
@enduml
@startuml
actor User
participant ":System" as System
participant ":User" as UserObj
participant "Database" as DB
title "Upload Profile Picture"
User -> System: uploadProfilePicture(image)
System -> UserObj: getUserID()
alt User Authenticated
UserObj --> System: userID
System -> UserObj: uploadProfilePicture(image)
alt Valid Image
UserObj -> DB: storeProfilePicture(userID, image)
alt Picture Stored
DB --> UserObj: imageURL
UserObj --> System: imageURL
System --> User: displayMessage("Profile picture uploaded successfully")
else Database Error
DB --> UserObj: error
UserObj --> System: null
System --> User: displayMessage("Failed to upload profile picture due to database error")
end alt
else Invalid Image
UserObj --> System: null
System --> User: displayMessage("Invalid image file")
end alt
else User Not Authenticated
UserObj --> System: error
System --> User: displayMessage("Please log in to upload profile picture")
end alt
@enduml
@startuml
actor User
participant ":System" as System
participant ":User" as UserObj
participant "Database" as DB
title "Add Bio/Description"
User -> System: addBio(bioText)
System -> UserObj: getUserID()
alt User Authenticated
UserObj --> System: userID
System -> UserObj: addBio(bioText)
alt Valid Bio
UserObj -> DB: storeBio(userID, bioText)
alt Bio Stored
DB --> UserObj: success
UserObj --> System: true
System --> User: displayMessage("Bio updated successfully")
else Database Error
DB --> UserObj: error
UserObj --> System: false
System --> User: displayMessage("Failed to update bio due to database error")
end alt
else Invalid Bio
UserObj --> System: false
System --> User: displayMessage("Invalid bio text")
end alt
else User Not Authenticated
UserObj --> System: error
System --> User: displayMessage("Please log in to add bio")
end alt
@enduml
@startuml
actor User
participant ":System" as System
participant ":User" as UserObj
participant "Database" as DB
title "Set User Location"
User -> System: setLocation(location)
System -> UserObj: getUserID()
alt User Authenticated
UserObj --> System: userID
System -> UserObj: setLocation(location)
alt Valid Location
UserObj -> DB: storeLocation(userID, location)
alt Location Stored
DB --> UserObj: success
UserObj --> System: true
System --> User: displayMessage("Location updated successfully")
else Database Error
DB --> UserObj: error
UserObj --> System: false
System --> User: displayMessage("Failed to update location due to database error")
end alt
else Invalid Location
UserObj --> System: false
System --> User: displayMessage("Invalid location")
end alt
else User Not Authenticated
UserObj --> System: error
System --> User: displayMessage("Please log in to set location")
end alt
@enduml
@startuml
actor User
participant ":System" as System
participant ":User" as UserObj
participant "Database" as DB
title "Enable/Disable Notifications"
User -> System: manageNotifications(enabled)
System -> UserObj: getUserID()
alt User Authenticated
UserObj --> System: userID
System -> UserObj: manageNotifications(enabled)
UserObj -> DB: updateNotificationSettings(userID, enabled)
alt Settings Updated
DB --> UserObj: success
UserObj --> System: true
System --> User: displayMessage("Notification settings updated successfully")
else Database Error
DB --> UserObj: error
UserObj --> System: false
System --> User: displayMessage("Failed to update notification settings due to database error")
end alt
else User Not Authenticated
UserObj --> System: error
System --> User: displayMessage("Please log in to manage notifications")
end alt
@enduml
@startuml
actor User
participant ":System" as System
participant ":User" as UserObj
participant "Database" as DB
title "Delete/Deactivate Account"
User -> System: deleteAccount()
System -> UserObj: getUserID()
alt User Authenticated
UserObj --> System: userID
System -> UserObj: deleteAccount()
UserObj -> DB: deleteUser(userID)
alt Account Deleted
DB --> UserObj: success
UserObj --> System: true
System --> User: displayMessage("Account deleted successfully")
else Database Error
DB --> UserObj: error
UserObj --> System: false
System --> User: displayMessage("Failed to delete account due to database error")
end alt
else User Not Authenticated
UserObj --> System: error
System --> User: displayMessage("Please log in to delete account")
end alt
@enduml
@startuml
actor Admin
participant ":System" as System
participant ":Admin" as AdminObj
participant ":User" as UserObj
participant "Database" as DB
title "Admin Managing User Accounts"
Admin -> System: manageUserAccount(userID, action, profileData?)
System -> AdminObj: verifyAdmin()
alt Admin Authorized
AdminObj --> System: adminID
System -> AdminObj: manageUserAccount(userID, action, profileData?)
AdminObj -> DB: checkUserExists(userID)
alt User Exists
DB --> AdminObj: userExists
alt Action = Edit
AdminObj -> UserObj: editProfile(profileData)
alt Valid Profile Data
UserObj -> DB: updateProfile(userID, profileData)
DB --> UserObj: success
UserObj --> AdminObj: true
AdminObj --> System: true
System --> Admin: displayMessage("User profile updated successfully")
else Invalid Profile Data
UserObj --> AdminObj: false
AdminObj --> System: false
System --> Admin: displayMessage("Invalid profile data")
end alt
else Action = Delete
AdminObj -> UserObj: deleteAccount()
UserObj -> DB: deleteUser(userID)
DB --> UserObj: success
UserObj --> AdminObj: true
AdminObj --> System: true
System --> Admin: displayMessage("User account deleted successfully")
else Action = Create
AdminObj -> UserObj: signUp(username, email, password)
UserObj -> DB: storeUser(userID, username, email, password)
DB --> UserObj: success
UserObj --> AdminObj: true
AdminObj --> System: true
System --> Admin: displayMessage("User account created successfully")
end alt
else User Not Found
DB --> AdminObj: notFound
AdminObj --> System: false
System --> Admin: displayMessage("Invalid user ID")
else Database Error
DB --> AdminObj: error
AdminObj --> System: false
System --> Admin: displayMessage("Failed to manage account due to database error")
end alt
else Admin Not Authorized
AdminObj --> System: error
System --> Admin: displayMessage("Unauthorized: Admin access required")
end alt
@enduml
@startuml
actor Moderator
participant ":System" as System
participant ":Moderator" as ModeratorObj
participant "Database" as DB
title "Moderator Reviewing Reports"
Moderator -> System: reviewReport(reportID, action)
System -> ModeratorObj: verifyModerator()
alt Moderator Authorized
ModeratorObj --> System: moderatorID
System -> ModeratorObj: reviewReport(reportID, action)
ModeratorObj -> DB: checkReportExists(reportID)
alt Report Exists
DB --> ModeratorObj: reportData
alt Valid Action
ModeratorObj -> DB: updateReportStatus(reportID, action)
alt Report Updated
DB --> ModeratorObj: success
ModeratorObj --> System: true
System --> Moderator: displayMessage("Report processed successfully")
else Database Error
DB --> ModeratorObj: error
ModeratorObj --> System: false
System --> Moderator: displayMessage("Failed to process report due to database error")
end alt
else Invalid Action
ModeratorObj --> System: false
System --> Moderator: displayMessage("Invalid action")
end alt
else Report Not Found
DB --> ModeratorObj: notFound
ModeratorObj --> System: false
System --> Moderator: displayMessage("Invalid report ID")
else Database Error
DB --> ModeratorObj: error
ModeratorObj --> System: false
System --> Moderator: displayMessage("Failed to fetch report due to database error")
end alt
else Moderator Not Authorized
ModeratorObj --> System: error
System --> Moderator: displayMessage("Unauthorized: Moderator access required")
end alt
@enduml- Lab1
- Lab 1 Meeting Notes
- Lab2
- Lab 2 Meeting Notes
- Lab3
- Lab 3 Meeting Notes
- Lab4
- Lab4 Meeting Notes
- Lab5
- Lab5 Meeting Notes
- Lab 5: MVP Implementation & Planning
- Lab6
- Lab6 Meeting Notes
- Lab7
- Lab7 Meeting Notes
- Lab 7: Milestone 2 Demo Preparation
- Lab8
- Lab8 Meeting Notes
- Lab 8: Requirements Review & Acceptance Planning
- Ahmet's Bio
- Barathan's Bio
- Berkay's Bio
- Berke's Bio
- Caglar's Bio
- Mehmet Emin's Bio
- Nilsu's Bio
- Ömer's Bio
- Selman's Bio
- Taha's Bio
Ahmet Okta
Barathan Aslan
Berke Kartal
Mehmet Çağlar Kurt
Mehmet Emin Atak
Muhammet Berkay Keskin
Mustafa Taha Söylemez
Nilsu Tüysüz
Selman Akman
Ömer Faruk Bayram
- Use Case Diagram
- Class Diagram
- Sequence Diagrams - Admin Management and Moderator Functions
- Sequence Diagrams - Rewards, Badges and Leaderboard System
- Sequence Diagrams - Notification System
- Sequence Diagrams - Tips and Recommendations
- Sequence Diagrams - Challenge and Activity Tracking
- Sequence Diagrams - Waste Tracking and Scoring System
- Sequence Diagrams - User and Account Management
- Sequence Diagrams - Goal Management
- Sequence Diagrams - Authentication
- Sequence Diagrams - Session Management
- Sequence Diagrams - Events Management
- Project Plan
- Requirements
- Elicitation Questions & Answers
- Scenario #1
- Scenario #2
- Scenario #3
- Scenario #4
- Scenario #5
- Scenario #6
- Scenario #7
- Scenario #8
- Scenario #9
- Scenario #10
- Scenario #11
- Scenario #12
- Scenario #13
- Scenario #14
- Use Case Diagram
- Class Diagram
- Sequence Diagrams - Admin Management and Moderator Functions
- Sequence Diagrams - Rewards,Badges and Leaderboard System
- Sequence Diagrams - Notification System
- Sequence Diagrams - Tips and Recommendations
- Sequence Diagrams - Challenge and Activity Tracking
- Sequence Diagrams - Waste Tracking and Scoring System
- Sequence Diagrams - User and Account Management
- Sequence Diagrams - Goal Management
- Sequence Diagrams - Auth
- Sequence Diagrams - Session Management
- User Manual for Frontend-Web
- System Manual for Frontend-Web
- Research Documentation for Frontend-Web
- Testing Manual for Frontend-Web