Skip to content

Sequence Diagrams

Muhammet Emin Çiftçi edited this page Oct 14, 2024 · 26 revisions

Viewset To Database

This is a generic sequence. Other models follows this.

sequenceDiagram
    Viewset->>+Controller: create(RequestObject)
    Controller->>+Serializer: create(RequestObject)
    Serializer->>+Model: create(SerialObject)
    Model->>+Database: create(ModelObject)
    alt saving is successful
    Database-->>Model: success
    Model-->>Serializer: success
    Serializer-->>Controller: success
    Controller-->>Viewset: success
    else
    Database-->>Model: failure
    Model-->>Serializer: failure
    Serializer-->>Viewset: failure
    Controller-->>Viewset: failure
    end
Loading

Create Quiz

sequenceDiagram
    loop For each Quiz Question
    loop For question word for each question choice
    Registered User->>+BabelNetClient: fetch_synsets(keyword)
    BabelNetClient->>+BabelNetAPI:get_synsets(keyword, api_key)
    BabelNetAPI-->>BabelNetClient: translation list
    BabelNetClient-->>Registered User: translation list
    end
    end
    Registered User->>+QuizViewset: create(QuizQuestion)
    alt saving is successful
    QuizViewset-->>Registered User: success
    else
    QuizViewset-->>Registered User: failure
    end
Loading

Create Forum Question

sequenceDiagram
    Registered User->>+BabelNetClient: fetch_synsets(keyword)
    BabelNetClient->>+BabelNetAPI:get_synsets(keyword, api_key)
    BabelNetAPI-->>BabelNetClient: entity list
    BabelNetClient-->>Registered User: entity list
    Registered User->>+ForumQuestionViewset: create(ForumQuestion)
    alt 
    ForumQuestionViewset-->>Registered User: success
    else
    ForumQuestionViewset-->>Registered User: failure
    end
Loading

Semantic Search for Forum

sequenceDiagram

    Registered User->>+BabelNetClient: fetch_synsets(keyword)
    BabelNetClient->>+BabelNetAPI:get_synsets(keyword, api_key)
    BabelNetAPI-->>BabelNetClient: entity list
    BabelNetClient-->>Registered User: entity list
    Registered User->>+ForumQuestionFeedViewset: get(entityId)
    
    alt 
    ForumQuestionFeedViewset-->>Registered User: success
    else
    ForumQuestionFeedViewset-->>Registered User: failure
    end
Loading

Question Bookmark for Forum

sequenceDiagram
    Registered User->>+ForumQuestionBookmarkViewset: bookmark_question(questionId)
    alt 
    ForumQuestionBookmarkViewset-->>Registered User: success
    else
    ForumQuestionBookmarkViewset-->>Registered User: failure
    end
Loading

Semantic Search for Quiz

sequenceDiagram

    Registered User->>+BabelNetClient: fetch_synsets(keyword)
    BabelNetClient->>+BabelNetAPI:get_synsets(keyword, api_key)
    BabelNetAPI-->>BabelNetClient: entity list
    BabelNetClient-->>Registered User: entity list
    Registered User->>+QuizFeedViewset: get(entityId)
    
    alt 
    QuizFeedViewset-->>Registered User: success
    else
    QuizFeedViewset-->>Registered User: failure
    end
Loading

Block User

sequenceDiagram
    Registered User->>+UserInfoViewset: getUser(username)
    alt 
    UserInfoViewset-->>Registered User: success
    else
    UserInfoViewset-->>Registered User: failure
    end
    Registered User->>+BlockViewset: blockUser(username)
    alt 
    BlockViewset-->>Registered User: success
    else
    BlockViewset-->>Registered User: failure
    end

Loading

Follow User

sequenceDiagram
    Registered User->>+UserInfoViewset: getUser(username)
    alt 
    UserInfoViewset-->>Registered User: success
    else
    UserInfoViewset-->>Registered User: failure
    end
    Registered User->>+FollowViewset: followUser(username)
    alt 
    FollowViewset-->>Registered User: success
    else
    FollowViewset-->>Registered User: failure
    end

Loading






OLD DIAGRAMS

View Post

sequenceDiagram
Registered User->>ContentController: getPost(post)
ContentController->>+Database: retrieve post from database
Database-->>ContentController: post
alt success
    ContentController->>Wikidata: getInfoBox(qid: String)
    Wikidata-->>ContentController: success
    ContentController-->>Registered User: success
else failure
    Database-->>-ContentController: failure
    ContentController-->>Registered User: failure
end
Loading

Bookmark Post

sequenceDiagram
    Registered User->>+ContentController: getPost(post_id)
    ContentController->>+ Database: get post
    Activate Registered User
    alt saving is successful
        Database-->>ContentController: Post
        ContentController-->>Registered User: Post
        Registered User->>ContentController: bookmarkPost(post)
        ContentController->>+ Database: save bookmark action into database
        Database-->>ContentController: success
        ContentController-->>Registered User: success
    else failure
        Database-->>-ContentController: failure
        ContentController-->>-Registered User: failure
    end
    Deactivate Registered User
Loading

Block User

sequenceDiagram
    Registered User->>+ UserController: getUser(username)
    Activate Registered User
    UserController->>+ Database: get user profile
    alt user blocking is successful
        Database-->>UserController: profile
        UserController -->> Registered User: profile
        Registered User->> UserController: blockUser(username)
        UserController->> Database: save the block action
        Database-->>UserController: success
        UserController -->> Registered User: success

    else failure
        Database-->>-UserController: failure
        UserController-->>-Registered User: failure
    end    
    Deactivate Registered User

Loading

Reset Password

sequenceDiagram
    Registered User->>+ UserController: login(username: String, password: String) 
    Activate Registered User
    UserController->>+ Database: verify credentials
    alt reset password is successful
        Database-->>UserController: success
        UserController -->> Registered User: success
        Registered User->> UserController: update(password)
        UserController->> Database: save the reset action
        Database-->>UserController: success
        UserController -->> Registered User: success

    else failure
        Database-->>-UserController: failure
        UserController-->>-Registered User: failure
    end    
    Deactivate Registered User

Loading

Like Post

sequenceDiagram
    Registered User->>+ContentController: getPost(post_id)
    ContentController->>+ Database: get post
    Activate Registered User
    alt saving is successful
        Database-->>ContentController: Post
        ContentController-->>Registered User: Post
        Registered User->>ContentController: likePost(post)
        ContentController->>+ Database: save like action into database
        Database-->>ContentController: success
        ContentController-->>Registered User: success
    else failure
        Database-->>-ContentController: failure
        ContentController-->>-Registered User: failure
    end
    Deactivate Registered User
Loading

Follow User

sequenceDiagram
    Registered User->>+ ProfileController: getProfile(username)
    ProfileController->>+ Database: get profile
    Activate Registered User
    alt user followed successfully
        Database-->>ProfileController: Profile
        ProfileController -->> Registered User: Profile
        Registered User->> ProfileController: followUser(profile)
        ProfileController->>+ Database: save the follow action

        Database-->>ProfileController: success
        ProfileController -->> Registered User: success
    else failure
        Database-->>-ProfileController: failure
        ProfileController-->>-Registered User: failure
    end

    Deactivate Registered User

Loading

Update Profile

sequenceDiagram
    Registered User->>+ ProfileController: getProfile(username)
    ProfileController->>+ Database: get profile
    Activate Registered User
    alt profile updated successfully
        Database-->>ProfileController: Profile
        ProfileController -->> Registered User: Profile
        Registered User->> ProfileController: update(profile)
        ProfileController->>+ Database: save the new profile action

        Database-->>ProfileController: success
        ProfileController -->> Registered User: success
    else failure
        Database-->>-ProfileController: failure
        ProfileController-->>-Registered User: failure
    end

    Deactivate Registered User

Loading

BOUNSWE2024 - G11

Logo Turquiz App

⏳ Status

DONE

🧑🏼‍💻 Team

📝 Diagrams

📆 Lab Reports

📆 Meeting Notes

📍 Milestones

📎 Planning

📚 User Scenarios / Stories

📚 Resources

🔎 Research

🗂️ Templates

Clone this wiki locally