Skip to content

Commit

Permalink
Merge pull request #148 from Arquisoft/documentation_final_fixes
Browse files Browse the repository at this point in the history
Documentation final fixes
  • Loading branch information
marco-qg authored May 3, 2024
2 parents 85ae33f + 2e239de commit 766fa77
Show file tree
Hide file tree
Showing 16 changed files with 285 additions and 119 deletions.
32 changes: 1 addition & 31 deletions apisgatewayservice/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,8 @@
openapi: 3.0.0
info:
title: Sample API
title: Api's Gateway Open Api information
version: 1.0.0
paths:
/users:
get:
summary: Get users
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: array
items:
type: object
properties:
username:
type: string
description: User ID
example: student
createdAt:
type: string
description: Creation date.
example: '2024-03-17T20:47:23.935Z'
'500':
description: Internal server error
content:
application/json:
schema:
type: object
properties:
error:
type: string
/history/questions:
get:
summary: Get history questions
Expand Down
Binary file added docs/images/Grafana.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/QualityTree.jpg
Binary file not shown.
Binary file added docs/images/QualityTree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,15 @@ include::src/10_quality_requirements.adoc[]
include::src/11_technical_risks.adoc[]

<<<<
// 12. Glossary
include::src/12_glossary.adoc[]
// 12. Testing
include::src/12_testing.adoc[]

<<<<
// 13. Monitoring
include::src/13_monitoring.adoc[]

<<<<
// 14. Glossary
include::src/14_glossary.adoc[]


37 changes: 21 additions & 16 deletions docs/src/05_building_block_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ This level shows how the application will work internally in generaly. The clien
:User:
package "WIQ App" {
:User: -> [WebApp] : " Interacts "
[WebApp] <-> [Gateway Service] : Redirects Requests
[WebApp] <--> [Gateway Service] : Redirects Requests
[Gateway Service] <--down-> [Game Service] : Plays
[Gateway Service] <-- [Store Question Service] : Loads data
[Gateway Service] <-- [User Stats Service] : Loads data
[Gateway Service] <-> [UserAuth Service] : Logs in / Registers
[Apisgateway Service] <-up- [WebApp] : Gets Data
[Apisgateway Service] ---> [Store Question Service] : Gets Data
[Apisgateway Service] --> [User Stats Service] : Gets Data
[Gateway Service] <-left-> [UserAuth Service] : Logs in / Registers
[Questions Service] -up--> [Store Question Service] : Stores data
[Game Service] -> [User Stats Service] : Stores data
[Game Service] <-left-> [Questions Service] : Gets questions
[Questions Service] -up-> [Store Question Service] : Stores data
[Game Service] <--right--> [Questions Service] : Gets questions
}
[Questions Service] <.left.> [WikiData] : " Gets data "
----
Expand Down Expand Up @@ -87,6 +88,8 @@ package "WIQ App"{
component "WebApp"
component "Gateway Service" as GatewayS
component "Api's Gateway" as ApisGateway
component "Game Service"
package "Store Question Service" as QHS{
component "Store-Q Service" as QHController
Expand All @@ -109,20 +112,22 @@ package "WIQ App"{
}
}
User -right-> WebApp : Uses
WebApp <-right-> GatewayS: Redirects requests
User --> WebApp : " Uses"
WebApp <-down-> GatewayS: "Redirects\t\t\t\nrequests\t\t\t"
GatewayS <------> "UserAuth Service" : "Handles user\nlogin/registry\n\n\n"
GatewayS <--> "Game Service" : "Handles user\n current game"
GatewayS <--up--> "UserAuth Service" : "Handles user\nlogin/registry"
GatewayS <-down-> "Game Service" : "Handles user current game"
GatewayS <--up-- "QHS" : "\nReceives generated\nquestions"
GatewayS <--- "USS" : "Receives\t\t\t\nuser statistics\t\t\t"
ApisGateway <-up- WebApp : "Gets data\n from the Api"
ApisGateway -left-> QHS : "Gets Generated\n Questions"
ApisGateway ---> USS : "Gets Users' Stats"
"Game Service" <---> "Questions Service" : "Receives question petitions,\nsends questions\n\n"
"Game Service" ---> "USS" : "Sends user\t\nstatistics\t\t"
"Game Service" <-----> "Questions Service" : "Receives question \npetitions,\nsends questions"
"Game Service"-> "USS" : "Sends user\t\nstatistics\t\t"
"Questions Service" -up-> "QHS" : " Sends\n generated\n questions"
"Wikidata" .up.> "Wikidata Extractor" : "Returns data"
"Wikidata" <.up. "Wikidata Extractor" : "Queries"
"Wikidata" .up..> "Wikidata Extractor" : "Returns data"
"Wikidata" <.up.. "Wikidata Extractor" : "Queries"
"Wikidata Extractor" --> QSDB
"Questions Generator Service" <-- QSDB
"Questions Generator Service" --> QSDB
Expand Down
108 changes: 72 additions & 36 deletions docs/src/06_runtime_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,29 @@ autonumber
actor "User" as user
user -> "Game Service": Begins game
"Game Service" -> "Question Service" : Requests n questions
"Question Service" -> "Wikidata REST API" : Requests information to create questions
"Wikidata REST API" -> "Question Service" : Returns information
"Question Service" -> "Question Service" : Creates questions
"Question Service" -> "Game Service" : Returns questions
user -> "Webapp": [clicks] Starts New Game
"Webapp" -> "Game Service": Requests new game
"Game Service" -> "Game Service" : Creates new game
"Game Service" -> "Question Generator Service" : Requests n questions
database "MongoDB database" as DB
"Question Generator Service" -> DB : Requests information to create questions
DB --> "Question Generator Service" : Returns information
"Question Generator Service" -> "Question Generator Service" : Creates questions
"Question Generator Service" -> "Question Historic Service" : Sends the generated questions
"Question Generator Service" --> "Game Service" : Returns questions
loop n times
"Game Service" -> user : Shows question
"Game Service" --> "Webapp" : Returns question
"Webapp" -> user : Shows question
user -> "Game Service" : Responds question
user -> "Webapp" : Responds question
"Webapp" -> "Game Service" : Responds question
end
"Game Service" -> "Question Historic Service" : Sends the shown questions
"Game Service" -> "Player Statistics Service" : Sends the user's match data
"Game Service" -> "User Stats Service" : Sends the user's match data
----

In circumstances in which few questions are needed for the game, it may be possible to extract all of them in a batch without affecting performance and response times. Besides, extracting them this way opens up the possibility of using multiple threads to gather the data, greatly increasing performance. However, if the querying times are too high, this strategy may cause great delays while loading the game. A possible alternative is explained below:
Expand All @@ -38,34 +46,50 @@ autonumber
actor "User" as user
user -> "Game Service": Begins game
"Game Service" -> "Question Service" : Requests n questions
"Question Service" -> "Wikidata REST API" : Requests information to create questions
"Wikidata REST API" -> "Question Service" : Returns information
"Question Service" -> "Game Service" : Returns questions
user -> "Webapp": [clicks] Starts New Game
"Webapp" -> "Game Service": Requests new game
"Game Service" -> "Game Service" : Creates new game
"Game Service" -> "Question Generator Service" : Requests n questions
database "MongoDB Database" as db
"Question Generator Service" -> db : Requests information to create questions
db --> "Question Generator Service" : Returns information
"Question Generator Service" -> "Question Historic Service" : Sends the shown questions
"Question Generator Service" --> "Game Service" : Returns questions
loop Until the game ends
loop n-k times
"Game Service" -> user : Shows question
...
user -> "Game Service" : Responds question
"Game Service" --> "Webapp" : Returns question
"Webapp" -> user : Shows question
user -> "Webapp" : Responds question
"Webapp" -> "Game Service" : Responds question
end
"Game Service" -> "Question Service" : Requests n questions
"Question Service" -> "Wikidata REST API" : Requests information to create questions
"Wikidata REST API" -> "Question Service" : Returns information
"Question Service" -> "Question Service" : Creates questions
"Question Service" -> "Game Service" : Returns questions
"Game Service" -> "Question Generator Service" : Requests n questions
"Question Generator Service" -> db : Requests information to create questions
db --> "Question Generator Service" : Returns information
"Question Generator Service" -> "Question Historic Service" : Sends the shown questions
"Question Generator Service" -> "Question Generator Service" : Creates questions
"Question Generator Service" --> "Game Service" : Returns questions
loop k times
"Game Service" -> user : Shows question
...
user -> "Game Service" : Responds question
"Game Service" --> "Webapp" : Returns question
"Webapp" -> user : Shows question
user -> "Webapp" : Responds question
"Webapp" -> "Game Service" : Responds question
end
end
"Game Service" -> "Question Historic Service" : Sends the shown questions
"Game Service" -> "Player Statistics Service" : Sends the user's match data
"Game Service" -> "User Stats Service" : Sends the user's match data
----

In cases where a lot of questions are needed, or wikidata querying has a great impact on performance, this alternative may prove to be convenient. By distributing the data fetching along the entire match, bottlenecks on performance will be reduced. Depending on the system load, or even on client device's specifications, batch sizes may vary adapting to maintain responsiveness.
Expand All @@ -78,10 +102,13 @@ autonumber
actor "User" as user
user -> "Player Statistics Service" : Requests user data
"Player Statistics Service" -> "MongoDB Server" : Makes petition through REST API
"MongoDB Server" -> "Player Statistics Service" : Returns information
"Player Statistics Service" -> user : Shows data
user -> "Player Stats Service" : Requests user data
database "MongoDB Database" as db
"Player Stats Service" -> db : Makes petition through REST API
db -> "Player Stats Service" : Returns information
"Player Stats Service" -> user : Shows data
----

=== User consults questions used in games.
Expand All @@ -92,8 +119,17 @@ autonumber
actor "User" as user
user -> "Question Historic Service" : Requests user data
"Question Historic Service" -> "MongoDB Server" : Makes petition through REST API
"MongoDB Server" -> "Question Historic Service" : Returns information
"Question Historic Service" -> user : Shows data
user -> "WebApp" : Requests questions data
"WebApp" -> "Api's Gateway Service" : Requests questions data
"Api's Gateway Service" -> "Store Question Service" : Requests questions data
database "MongoDB Database" as db
"Store Question Service" -> db : Makes petition through REST API
db --> "Store Question Service" : Returns Data
"Api's Gateway Service" <-- "Store Question Service" : Returns Data
"WebApp" <-- "Api's Gateway Service" : Returns Data
"WebApp" -> user : Shows data
----
30 changes: 18 additions & 12 deletions docs/src/07_deployment_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ cloud "Azure Cloud\n" {
node "Wikidata Extractor Container"{
node "Wikidata Extractor Service"
}
node "Api's Gateway Container"{
node "Api's Gateway Service"
}
}
}
}
Expand All @@ -48,23 +51,26 @@ cloud "Wikidata"
actor "User"
"User" -left- "Web App" : "\t\tHTTP/port:3000\t\t"
"User" -- "Web App" : " HTTP/port:3000"
"Web App" -down- "Gateway Service" : "port: 8000 "
"Api's Gateway Service" -up- "Web App" : "port: 8100"
"Web App" -- "Gateway Service" : "port: 8000"
"Gateway Service" --- "Auth Service" : " port: 8002"
"Gateway Service" --- "User Service" : "port: 8001 "
"Gateway Service" --- "Game Service" : "port: 8005\t\t"
"Gateway Service" -- "Store Question Service" : "port: 8004"
"Gateway Service" -- "User Stats Service" : "port: 8003"
"Gateway Service" -up- "Auth Service" : "port: 8002 "
"Gateway Service" -up- "User Service" : "port: 8001"
"Gateway Service" -right- "Game Service" : " port: 8005 "
"User Stats Service" -- "Game Service" : " port: 8003"
"Game Service" -- "User Stats Service" : "port: 8003"
"Game Service" -- "Question Generator Service" : " port: 8007"
"User Stats Service" -up- "Api's Gateway Service" : " port: 8003"
"Store Question Service" -up- "Api's Gateway Service" : "\tport: 8004"
"Question Generator Service" -- "Store Question Service" : "port: 8004"
"Question Generator Service" -- "Wikidata Extractor Service" : "port: 8008"
"Store Question Service" -- "Question Generator Service" : "\tport: 8004"
"Question Generator Service" -- "Wikidata Extractor Service" : "\tport: 8008"
"Question Generator Service" -- "Game Service" : "port: 8007"
"Wikidata Extractor Service" -- "Wikidata" : "HTTPS"
"Wikidata Extractor Service" -- "Wikidata" : "\tHTTPS"
----

In addition to what is shown in the diagram, we will also use Graphana and Prometheus during the production stage as code monitoring systems.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/10_quality_requirements.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ the action to be performed by the user or the system (stimulus) in order to gene

=== Quality Tree

image::QualityTree.jpg[]
image::QualityTree.png[]

=== Quality Scenarios

Expand Down
Loading

0 comments on commit 766fa77

Please sign in to comment.