Skip to content

Sequence Diagrams Archive

Onur Dilsiz edited this page Oct 15, 2024 · 1 revision

1. User Authentication Processes

1.1 Register

sequenceDiagram
    actor U as User
    participant S as System
    participant DB as Database

    %register
    U->>S: register(username, email, password)
    S->>DB: Check if user exists
    DB-->>S: User does not exist
    S->>DB: Create new user
    DB-->>S: User created
    S->>U: Registration successful
Loading

1.2 Login

sequenceDiagram
    actor U as User
    participant S as System
    participant DB as Database

    %login
    U->>S: login(username, password)
    S->>DB: Validate user credentials
    DB-->>S: Credentials valid
    S->>U: Login successful
Loading

1.3 Logout

sequenceDiagram
    actor U as User
    participant S as System
    participant DB as Database

    %logout
    U->>S: logout()
    S->>DB: Update user session
    DB-->>S: Session updated
    S->>U: Logout successful
Loading

1.4 Edit Profile

sequenceDiagram
    actor U as User
    participant S as System
    participant DB as Database

    %edit_profile
    U->>S: editProfile(username, email, password)
    S->>DB: Retrieve user information
    DB-->>S: User information retrieved
    S->>DB: Update user information
    DB-->>S: User information updated
    S->>U: Profile edited successfully
Loading

2. Content Interaction

2.1 Bookmark Book Pages

sequenceDiagram
    
        RegisteredUser->>+BookList: addBook(Book)
        BookList->>+BookList: getBooks()
    alt addBook successfull
        BookList->>+RegisteredUser: success
    else Book already exists
        BookList->>+RegisteredUser: failure
    end
Loading

2.2 Creating a post

sequenceDiagram
    actor U as User
    participant S as System
    participant DB as Database

    %create_post
    U->>S: createPost(title, content, bookID)
    S->>DB: Check if book exists
    DB-->>S: Book exists
    S->>DB: Check user privileges
    DB-->>S: Privileges confirmed
    S->>DB: Save post
    DB-->>S: Post saved
    S->>U: Post creation successful
Loading
Clone this wiki locally