Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation jonathan #30

Merged
merged 31 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ff5fadb
Update sonar-project.properties
ExarcaFidalgo Jan 22, 2024
3a7d874
Update README.md
ExarcaFidalgo Jan 22, 2024
09590d8
0 por es6b
ExarcaFidalgo Jan 23, 2024
dc74163
Revert "Merge branch 'master' into master"
ExarcaFidalgo Jan 26, 2024
a50371b
Merge branch 'master' into master
ExarcaFidalgo Jan 26, 2024
e049274
Revert "Merge branch 'master' of https://github.com/Arquisoft/wiq_0"
ExarcaFidalgo Jan 26, 2024
e9278f2
Expiando mis pecados
ExarcaFidalgo Jan 26, 2024
1f0cbfb
Minor fixes to tear-down the container
augustocristian Feb 12, 2024
f4f8efb
Merge pull request #6 from Arquisoft/ft_solveproblemcompose
labra Feb 12, 2024
88b6114
Added corrected business context diagram
uo283642 Feb 20, 2024
601f920
Updated 03. Added diagrams + minor fixes
uo283642 Feb 20, 2024
16cbd6b
06 mostly finished.
uo283642 Feb 21, 2024
2672af2
Uploaded 05-Level 3 diagram.
uo283642 Feb 21, 2024
5ad812a
05 Added third level diagram and explanation.
uo283642 Feb 21, 2024
3708d62
Merge branch 'Arquisoft:master' into documentation_jonathan
uo283642 Feb 21, 2024
b5c91c0
Merge remote-tracking branch 'origin/develop' into documentation_jona…
uo283642 Feb 21, 2024
5e43b4b
12 Added some terms refering to question generation.
uo283642 Feb 21, 2024
f63474d
Update 05_building_block_view.adoc
uo283642 Feb 22, 2024
eb940c4
Update 03_system_scope_and_context.adoc
uo283642 Feb 22, 2024
6aaebbe
Removed styling
uo283642 Feb 22, 2024
6edeaf3
Uploaded 03 technical context diagram.
uo283642 Feb 22, 2024
6433881
03 Technical context diagram changed for img.
uo283642 Feb 22, 2024
3b46b75
Updated 05_building_block_view (Third level)
uo283642 Feb 22, 2024
4fb45f1
Added modified version of 05: Level 3 diagram
uo283642 Feb 22, 2024
0674ee5
03_Technical context diagram correction
uo283642 Feb 22, 2024
fac11d2
Changed diagram labels for 06.
uo283642 Feb 22, 2024
f763419
Merge branch 'documentation_jonathan' of https://github.com/Arquisoft…
uo283642 Feb 22, 2024
72fd11e
Merge branch 'develop' into documentation_jonathan
uo283642 Feb 22, 2024
465dc50
Atoning for my sins
uo283642 Feb 22, 2024
54c0ed6
Minor changes correction
uo283642 Feb 22, 2024
eddd2c7
Minor change on readme
uo283642 Feb 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/images/03_Business_Context_Diagram.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 added docs/images/03_Technical_Context.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 added docs/images/05_Level_3_Diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions docs/src/03_system_scope_and_context.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,5 @@ together with a mapping table showing the relationships between channels and inp

****

The following diagram represents the general structure of the project, as well as the communication channels between various system components. It shows communication to external sources, as well as communications between the various microsystems.
image::03_Technical_Context.png[]

image::03-deployment-diagram-EN.png[]
26 changes: 26 additions & 0 deletions docs/src/05_building_block_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,30 @@ package "WIQ App" {
|Authentication microservice that allows the user to register and log in.
|===

=== Level 3

image::05_Level_3_Diagram.png[]

==== Motivation

To display the inner architecture of the different microservices, as well as how do their components interact with themselves and with other components from other microsystems. All microservices follow the MVC architectural pattern, to the exception of the questions generator service. (since it has no UI to handle)

==== Contained Building Blocks

[options="header"]
[cols="1,2"]
|===
|Name |Description
|Questions Generator
|Contains the required templates and proceedings to construct questions. In order to do so, it delegates the Wikidata querying to the Wikidata extractor. When the data is returned, the question is formulated through templates.
|Wikidata Extractor
|Handles extraction and formatting of Wikidata’s output. It’s queries must cover all necessary information in order to construct the question(s), including not only the correct response, but also believable and coherent “decoy responses”.
|Questions Historic Controller
|Receives the generated questions, and sends them to the database. Besides, it also handles recovering them from the database and sending them where they are needed. (e.g: as response from an API call, or to the UI)
|User Statistics Controller
|Receives various information about the player’s performance in the match. There, some processing may occur before storing it in the database. Also handles retrieving the information and sending it where it’s needed (e.g: as response from an API call, or to the UI).
|Game Controller
|Handles all the game’s logic; where the user input’s processing takes place. It can request questions to the Questions Microservice, and also gather user statistics, to later be set to the User Statistics Controller.
|UI for the game and statistics
|Handles appeareance and presentation. Actions taken by the user are communicated to their respective controllers, that may respond accordingly.
|===
142 changes: 95 additions & 47 deletions docs/src/06_runtime_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,67 +37,115 @@ See https://docs.arc42.org/section-6/[Runtime View] in the arc42 documentation.

****

=== Usage diagram
[plantuml,"Scenario diagram",png]
=== User plays a match. Only one question batch is needed.

[plantuml,"Question generation 1",png]
----
actor User
entity APP
entity QandA
Activate User
Activate APP
User -> APP : Start Game
Activate QandA
APP -> QandA : Request
QandA -> QandA : Generate QandA
QandA --> APP : Return QandA
deactivate QandA
APP --> User : Game Prepared
loop
User -> APP: User Plays
APP -> User :Game Responds

@startuml
!theme vibrant
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

loop n times
"Game Service" -> user : Shows question
user -> "Game Service" : Responds question
end
APP --> User: Game Ends
deactivate APP
deactivate User

"Game Service" -> "Question Historic Service" : Sends the shown questions
"Game Service" -> "Player Statistics Service" : Sends the user's match data
@enduml

----

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:

=== <Runtime Scenario 1>
=== User plays a match. An example of dynamic question generation.

[plantuml,"Question generation 2",png]
----

* _<insert runtime diagram or textual description of the scenario>_
* _<insert description of the notable aspects of the interactions between the
building block instances depicted in this diagram.>_
@startuml
!theme vibrant
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

loop Until the game ends
loop n-k times
"Game Service" -> user : Shows question
...
user -> "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

loop k times
"Game Service" -> user : Shows question
...
user -> "Game Service" : Responds question
end
end

It is possible to use a sequence diagram:
"Game Service" -> "Question Historic Service" : Sends the shown questions
"Game Service" -> "Player Statistics Service" : Sends the user's match data
@enduml

[plantuml,"Sequence diagram",png]
----
actor Alice
actor Bob
database Pod as "Bob's Pod"
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice --> Pod: Store route
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response

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, optionally client device's specifications!) batch sizes may vary, adapting to maintain responsiveness.

=== User consults its game statistics.

[plantuml,"Consult Statistics",png]
----

=== <Runtime Scenario 2>
@startuml
!theme vibrant
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
@enduml

=== <Runtime Scenario n>
----

=== User consults questions used in games.

[plantuml,"Consult questions",png]
----
@startuml
!theme vibrant
autonumber

=== Wikidata questions requests
actor "User" as user

[plantuml,"Sequence diagram WikidataApi",png]
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
@enduml
----
actor User
entity App
entity WikidataApi
User -> App: Starts a game
App -> WikidataApi: Request data
App <-- WikidataApi: Returns data
User <-- App: Displays data in question-answer format
----
3 changes: 3 additions & 0 deletions docs/src/12_glossary.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ See https://docs.arc42.org/section-12/[Glossary] in the arc42 documentation.
|MongoDB |NoSQL database system that, instead of storing data in tables as a relational database does, stores data in JSON-like documents with a flexible schema.
|REACT |Open source JavaScript library developed by Facebook to build interactive and responsive user interfaces (UI). It is one of the most popular tools for modern web application development.
|Usability |Ease with which users can interact with a product, system or application to achieve their objectives effectively, efficiently and satisfactorily.
|Dynamic question generation | There may be circumstances where pre-generating the questions isn't feasible. So instead, questions can be generated while the user is playing the game and answering questions.
|Decoy answer | For questions that offer multiple options to select the correct answer from, it will be necessary to generate believable incorrect answers, that match the topic and theme of the question. For example, when asking about the longest river in Egypt, along with the correct answer (The Nile) some other river names of the country could be chosen for alternatives.
|Question template | General structure of a question, which can or cannot transcend topics. For example, valid templates for questions could be: "What's the tallest mountain in <country>?" "What is <concept>?" "Who invented <x>?"
|===
Loading