Skip to content

CMPE352‐Sequence Diagrams ‐ User & Account Management

Selman Akman edited this page Oct 15, 2025 · 1 revision

Sign Up Sequence Diagram

Diagram

image

Code

@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

Log In Sequence Diagram

Diagram

image

Code

@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

Login via Google Sequence Diagram

Diagram

image

Code

@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

Reset Password Sequence Diagram

Diagram

image

Code

@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

View Profile Sequence Diagram

Diagram

image

Code

@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

Edit Profile Sequence Diagram

Diagram

image

Code

@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

Upload Profile Picture Sequence Diagram

Diagram

image

Code

@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

Add Bio/Description Sequence Diagram

Diagram

image

Code

@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

Set User Location Sequence Diagram

Diagram

image

Code

@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

Enable/Disable Notifications Sequence Diagram

Diagram

image

Code

@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

Delete/Deactivate Account Sequence Diagram

Diagram

image

Code

@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

Admin Managing User Accounts Sequence Diagram

Diagram

image

Code

@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

Moderator Reviewing Reports Sequence Diagram

Diagram

image

Code

@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

Labs

Team Members

Weekly Reports

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

Meetings

Milestones

Templates

Research on Git

Projects

Project Resources

Software Design Diagrams

Documentation(Manuals & Research Doc)

CMPE352 Archive

Projects

Project Resources

Software Design Diagrams

Documentation(Manuals & Research Doc)



Documentation(Individual Contributions and/or Milestone Report)

Individual Contributions

Meeting Notes

Clone this wiki locally