Sequence Diagrams - bounswe/bounswe2024group6 GitHub Wiki
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
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
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
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
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
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
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
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
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
sequenceDiagram
actor User
participant PostService
participant Database
User->>PostService: deletePost(userID, postHeader, postBody, postImage)
PostService->>Database: deletePost(userID, postHeader, postBody, postImage)
activate PostService
activate Database
alt SUCCESS
Database-->>PostService: deletedPost[{postID}]
PostService-->>User: <200, deletedPost[{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
sequenceDiagram
actor User
participant PostService
participant Database
User->>PostService: commentPost(userID, postHeader, postBody, postImage)
PostService->>Database: commentPost(userID, postHeader, postBody, postImage)
activate PostService
activate Database
alt SUCCESS
Database-->>PostService: commentPost[{postID}]
PostService-->>User: <200, commentPost[{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
sequenceDiagram
actor User
participant PostService
participant Database
User->>PostService: likePost(userID, postHeader, postBody, postImage)
PostService->>Database: likePost(userID, postHeader, postBody, postImage)
activate PostService
activate Database
alt SUCCESS
Database-->>PostService: likePost[{postID}]
PostService-->>User: <200, likePost[{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
sequenceDiagram
actor User
participant PostService
participant Database
User->>PostService: bookmarkPost(userID, postHeader, postBody, postImage)
PostService->>Database: bookmarkPost(userID, postHeader, postBody, postImage)
activate PostService
activate Database
alt SUCCESS
Database-->>PostService: bookmarkPost[{postID}]
PostService-->>User: <200, bookmarkPost[{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
sequenceDiagram
actor User
participant PostService
participant Database
User->>PostService: sharePost(userID, postHeader, postBody, postImage)
PostService->>Database: sharePost(userID, postHeader, postBody, postImage)
activate PostService
activate Database
alt SUCCESS
Database-->>PostService: sharePost[{postID}]
PostService-->>User: <200, sharePost[{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
sequenceDiagram
actor User
participant PostService
participant Database
User->>PostService: reportPost(userID, postHeader, postBody, postImage)
PostService->>Database: reportPost(userID, postHeader, postBody, postImage)
activate PostService
activate Database
alt SUCCESS
Database-->>PostService: reportPost[{postID}]
PostService-->>User: <200, reportPost[{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
sequenceDiagram
actor User
participant AccountService
participant Database
User->>AccountService: viewUser(userID)
AccountService->>Database: viewUser(userID)
activate AccountService
activate Database
alt SUCCESS
Database-->>AccountService: viewUser[{userID}]
AccountService-->>User: <200, viewUser[{userID}]>
else POST ERROR
deactivate Database
Database-->>AccountService: DB ERROR
AccountService-->>User: <500, Server Error>
deactivate AccountService
else USER UNAUTHORIZED
PostService-->>User: <401, Unauthorized>
end
sequenceDiagram
actor User
participant AccountService
participant Database
User->>AccountService: changeUser(userID, postHeader, postBody, postImage)
AccountService->>Database: changeUser(userID, postHeader, postBody, postImage)
activate AccountService
activate Database
alt SUCCESS
Database-->>AccountService: changeUser[{postID}]
AccountService-->>User: <200, changeUser[{postID}]>
else POST ERROR
deactivate Database
Database-->>AccountService: DB ERROR
AccountService-->>User: <500, Server Error>
deactivate AccountService
else USER UNAUTHORIZED
AccountService-->>User: <401, Unauthorized>
end