Skip to content

Sequence Diagrams

Anıl Köse edited this page Apr 22, 2024 · 26 revisions

Auth

Create Account

sequenceDiagram
  actor User
  participant AccountServer
  participant Database
  User->>AccountServer: createAccount(username, email, password)
  activate AccountServer
  activate Database
  alt success
    AccountServer->>Database: Credentials
    Database-->>AccountServer: Success
    AccountServer-->>User: <200, "Success">
  else username/email exists
    Database-->>AccountServer: <1062, ER_DUP_ENTRY>
    deactivate Database
    AccountServer-->>User: <409, "Conflict">
    deactivate AccountServer
  end
Loading

Login

sequenceDiagram
  actor User
  participant AuthServer
  participant Database
  User->>AuthServer: login(username, password)
  activate AuthServer
  AuthServer->>Database: Credentials
  activate Database
  alt success
    Database-->>AuthServer: <200, userData>
    AuthServer->>AuthServer: Issue JWT
    AuthServer-->>User: <200, JWT>
  else no match
    Database-->>AuthServer: no match
    deactivate Database
    AuthServer-->>User: <401, "Unauthorized">
    deactivate AuthServer
  end
Loading

Wikidata

Browse

sequenceDiagram
  actor User
  participant WikidataClient
  participant Wikidata API
  User->>WikidataClient: browse(searchText)
  activate WikidataClient
  WikidataClient->>Wikidata API: searchText
  activate Wikidata API
  alt success
    Wikidata API-->>WikidataClient: <200, matchList[{itemID, itemName, itemCategory}]>
    WikidataClient-->>User: <200, matchList[{itemID, itemName, itemCategory}]>
  else error
    Wikidata API-->>WikidataClient: <ERROR_CODE, ERROR_MESSAGE>
    deactivate Wikidata API
    WikidataClient-->>User: <ERROR_CODE, ERROR_MESSAGE>
    deactivate WikidataClient
  end 
Loading

View Architect Page

sequenceDiagram
  actor User
  participant WikidataClient
  participant Wikidata API
  User->>WikidataClient: getArchitectInfo(itemID)
  activate WikidataClient
  WikidataClient->Wikidata API: getArchitectInfo(itemID)
  activate Wikidata API
  alt success
    Wikidata API-->>WikidataClient: <200, {{architectName, architectDescription, architectProfileImageURL},<br/>buildingList[{itemID, buildingName, buildingImageURL, buildingStyleID, buildingStyleName, buildingStyleImageURL, buildingCoordinates}]}>
    WikidataClient-->>User: <200, {{architectName, architectDescription, architectProfileImageURL},<br/>buildingList[{itemID, buildingName, buildingImageURL, buildingStyleID, buildingStyleName, buildingStyleImageURL, buildingCoordinates}]}>
  else error
    Wikidata API-->>WikidataClient: <ERROR_CODE, ERROR_MESSAGE>
    deactivate Wikidata API
    WikidataClient-->>User: <ERROR_CODE, ERROR_MESSAGE>
    deactivate WikidataClient
  end 
Loading

View Style Page

sequenceDiagram
  actor User
  participant WikidataClient
  participant Wikidata API
  User->>WikidataClient: getStyleInfo(itemID)
  activate WikidataClient
  WikidataClient->Wikidata API: getStyleInfo(itemID)
  activate Wikidata API
  alt success
    Wikidata API-->>WikidataClient: <200, {{styleName, styleDescription},<br/>relatedStyles[{itemId, styleName, styleImageURL}],<br/>architects[{itemID, architectName, architectProfileImageURL}],<br/>buildingList[{itemID, buildingName, buildingImageURL, buildingCoordinates}]}>
    WikidataClient-->>User: <200, {{styleName, styleDescription},<br/>relatedStyles[{itemId, styleName, styleImageURL}],<br/>architects[{itemID, architectName, architectProfileImageURL}],<br/>buildingList[{itemID, buildingName, buildingImageURL, buildingCoordinates}]}>
  else error
    Wikidata API-->>WikidataClient: <ERROR_CODE, ERROR_MESSAGE>
    deactivate Wikidata API
    WikidataClient-->>User: <ERROR_CODE, ERROR_MESSAGE>
    deactivate WikidataClient
  end 
Loading

View Building Page

sequenceDiagram
  actor User
  participant WikidataClient
  participant Wikidata API
  User->>WikidataClient: getBuildingInfo(itemID)
  activate WikidataClient
  WikidataClient->Wikidata API: getBuildingInfo(itemID)
  activate Wikidata API
  alt success
    Wikidata API-->>WikidataClient: <200, {{buildingName, buildingDescription, buildingImageURL, buildingCoordinates}],<br/>architects[{itemID, architectName, architectProfileImageURL}],<br/>{itemID, styleName, styleImageURL}}>
    WikidataClient-->>User: <200, {{buildingName, buildingDescription, buildingImageURL, buildingCoordinates}],<br/>architects[{itemID, architectName, architectProfileImageURL}],<br/>{itemID, styleName, styleImageURL}}>
  else error
    Wikidata API-->>WikidataClient: <ERROR_CODE, ERROR_MESSAGE>
    deactivate Wikidata API
    WikidataClient-->>User: <ERROR_CODE, ERROR_MESSAGE>
    deactivate WikidataClient
  end 
Loading

Feed

View Feed

sequenceDiagram
  actor User
  participant FeedService
  participant Database
  User->>FeedService: getRelevantPosts(userID)
  FeedService->>Database: findAllRelevantPosts(userID)
  activate FeedService
  activate Database
  alt SUCCESS
    Database-->>FeedService: postList[{postHeader,author,postBody,metadata}]
    FeedService-->>User: <200, postList[{postHeader,author,postBody,metadata}]>

  else USER UNAUTHORIZED
    deactivate Database
    FeedService-->>User: <401, Unauthorized>
    deactivate FeedService
  end

Loading

Browse

sequenceDiagram
  actor User
  participant FeedService
  participant Database
  User->>FeedService: getRelevantPosts(userID, searchText)
  FeedService->>Database: findAllRelevantPosts(userID, searchText)
  activate FeedService
  activate Database
  alt SUCCESS
    Database-->>FeedService: postList[{postHeader,author,postBody,metadata}]
    FeedService-->>User: <200, postList[{postHeader,author,postBody,metadata}]>

  else USER UNAUTHORIZED
    deactivate Database
    FeedService-->>User: <401, Unauthorized>
    deactivate FeedService
  end
Loading

Post

Create Post

sequenceDiagram
  actor User
  participant PostService
  participant Database
  User->>PostService: createPost(userID, postHeader, postBody, postImage)
  PostService->>Database: savePost(userID, postHeader, postBody, postImage)
  activate PostService
  activate Database
  alt SUCCESS
    Database-->>PostService: post[{postID}]
    PostService-->>User: <200, post[{postID}]>

  else POST ERROR
    deactivate Database
    Database-->>PostService: DB ERROR
    PostService-->>User: <500, Server Error>
    deactivate PostService


  else USER UNAUTHORIZED
    PostService-->>User: <401, Unauthorized>
  end
Loading

Delete Post

Comment

Like

Bookmark

Share

Report

Profile

View Profile

Update Profile

🏠 Home

👤 Team Members

Lab Reports

📅 451 Meetings

💻 451 Project

🔬 451 Research

✍️ 451 Reports

📋 Templates

📁 352 Archive

📅 Meetings
💻 Project
🔬 Research
Clone this wiki locally