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

Second Deliverable V0.2.0 #111

Merged
merged 91 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
7480f18
Merge pull request #73 from Arquisoft/master
andrrsin Mar 13, 2024
9e51a45
Warning removal and correct extensions
andrrsin Mar 15, 2024
2d1f308
fix #68 and #69
andrrsin Mar 26, 2024
6441f8b
Merge pull request #78 from Arquisoft/Hotfix-v0.1.2
adriiglz Mar 26, 2024
4c10201
Refactored question service and added new category: 'Guess the city'
ChristianFN2 Mar 30, 2024
082c2c3
Merge pull request #79 from Arquisoft/questions-refine
adriiglz Mar 31, 2024
011aa32
fix bug #68
andrrsin Mar 31, 2024
2a72cb9
Added OpenApi Documentation
andrrsin Mar 31, 2024
a4c61b7
Merge pull request #81 from Arquisoft/OpenApi+pre-v0.2.0
adriiglz Mar 31, 2024
797a1ef
fixed questions imagse bug
adriiglz Apr 1, 2024
9d73964
Fix rankings example
andrrsin Apr 1, 2024
e1c4865
Fix flags size
andrrsin Apr 1, 2024
75ce28f
Rankings examples fix
andrrsin Apr 1, 2024
42ec5dc
set time to questions, uncomment tests and new animation
andrrsin Apr 1, 2024
05599e6
Merge pull request #85 from Arquisoft/time-game
ChristianFN2 Apr 2, 2024
c49ce91
3 new categories added. Queries and processing optimized
ChristianFN2 Apr 2, 2024
0d50563
Minor text correction
ChristianFN2 Apr 2, 2024
6bb3a12
Questions has an score, when the game starts it is set to 0 and for e…
uo287841 Apr 2, 2024
9bb383c
New categories
andrrsin Apr 2, 2024
4ecd159
modified userSchema
adriiglz Apr 3, 2024
6db3610
modified "/rankings" endpoint returned data
adriiglz Apr 3, 2024
5a70dd5
Merge branch 'develop' into dev_score
uo287841 Apr 3, 2024
c6725be
add Points to the game and to the ranking
uo287841 Apr 4, 2024
0d26788
Made tests for question-service, some are not passing now
ChristianFN2 Apr 4, 2024
9f4f997
added a new rankings layout
adriiglz Apr 4, 2024
6196334
Fix issue in question service that didnt read body values correctly
uo287841 Apr 4, 2024
9e5c4d1
Update ranking points
uo287841 Apr 4, 2024
a4b967f
Move addUserPoints to question-service
uo287841 Apr 4, 2024
c7afae7
new Ranking page and model finished
adriiglz Apr 5, 2024
a239e6b
removed all Ranking component
adriiglz Apr 5, 2024
51029fa
removed a testing control line
adriiglz Apr 5, 2024
a794bea
Merge pull request #88 from Arquisoft/rankings
ChristianFN2 Apr 5, 2024
8d0561d
Finallized question-service tests
ChristianFN2 Apr 5, 2024
caea032
Problem with concurrent users with questions solved
ChristianFN2 Apr 5, 2024
dceb9ab
Merge branch 'develop' into dev_score
uo287841 Apr 5, 2024
dd89602
Merge pull request #90 from Arquisoft/christian-tests
adriiglz Apr 6, 2024
2eace1d
Add points updated to the new user-moce, updates the global ranking a…
uo287841 Apr 6, 2024
87e04c8
Merge branch 'develop' into dev_score, modified:
uo287841 Apr 6, 2024
a0312ab
Documentation update
ChristianFN2 Apr 6, 2024
55870af
Missing one modification
ChristianFN2 Apr 6, 2024
333fed5
Score update
andrrsin Apr 6, 2024
71add80
Documentation Update
andrrsin Apr 6, 2024
925ba03
Changes in packages
uo287841 Apr 7, 2024
4a395da
Merge branch 'develop' into dev_score
uo287841 Apr 7, 2024
7d672e2
Merge pull request #93 from Arquisoft/dev_score
ChristianFN2 Apr 7, 2024
190269f
Question service tests fixed to include new answer handling
ChristianFN2 Apr 7, 2024
7d57ea5
User service test fixed
ChristianFN2 Apr 7, 2024
21a3574
Revert "User service test fixed"
ChristianFN2 Apr 7, 2024
f7fe6b9
Gateway-tests, perform test to all current gatway-service.js routes
uo287841 Apr 7, 2024
b2f05cd
auth-service test, added more scenarios for the login case
uo287841 Apr 7, 2024
80e397f
fixed conflicts
andrrsin Apr 7, 2024
6868c1c
fixed errors
andrrsin Apr 7, 2024
73fed47
User model updated to add new categories
uo287841 Apr 7, 2024
3dc844c
Merge pull request #95 from Arquisoft/dev_score
ChristianFN2 Apr 7, 2024
cd48684
Merge branch 'develop' into luis_test
uo287841 Apr 7, 2024
fe8a171
question service hotfix
andrrsin Apr 7, 2024
0f168c8
backend coverage tests
andrrsin Apr 7, 2024
048acf3
front end coverage tests
andrrsin Apr 7, 2024
719470c
question service test fixes
andrrsin Apr 7, 2024
059364a
fixed ranking bugs
adriiglz Apr 7, 2024
747e829
added tourist attractions to rankings
adriiglz Apr 7, 2024
9911fab
Merge branch 'develop' into luis_test
uo287841 Apr 7, 2024
b5b4eff
Merge pull request #97 from Arquisoft/andrestest
ChristianFN2 Apr 7, 2024
626c3b0
Merge pull request #100 from Arquisoft/rankings
ChristianFN2 Apr 7, 2024
4387e4f
hotfix adduser
andrrsin Apr 7, 2024
ed851d7
Merge branch 'develop' into luis_test
uo287841 Apr 7, 2024
f333094
Solved problem where the registration showed an error when the user w…
ChristianFN2 Apr 7, 2024
83ba07d
User is returned in the response again in the '/adduser' (Thought unn…
ChristianFN2 Apr 7, 2024
2717f33
Merge pull request #102 from Arquisoft/hot-fix-registration
uo287841 Apr 7, 2024
6fd1017
Merge branch 'develop' into luis_test
uo287841 Apr 7, 2024
d363231
rankings tests
adriiglz Apr 7, 2024
5d8461c
Merge pull request #104 from Arquisoft/luis_test
ChristianFN2 Apr 7, 2024
423e83f
tests for Game page + removed some unused code
adriiglz Apr 7, 2024
d401c95
Merge pull request #105 from Arquisoft/test-rankings
ChristianFN2 Apr 7, 2024
07e7da4
deployment view
andrrsin Apr 7, 2024
ab327ad
Merge pull request #106 from Arquisoft/deploymentView
ChristianFN2 Apr 7, 2024
dd647c7
register 2e2 test
uo287841 Apr 7, 2024
853b2e7
Merge branch 'develop' into luis_test
uo287841 Apr 7, 2024
2241bbd
Added basic test for Question.jsx
ChristianFN2 Apr 7, 2024
9ca940d
Question Test
andrrsin Apr 7, 2024
93c9867
added rankings test and removed duplicated code
adriiglz Apr 8, 2024
b15f50b
e2e login and register
uo287841 Apr 8, 2024
12b9aaa
Merge branch 'develop' into luis_test
uo287841 Apr 8, 2024
20088f5
Merge pull request #108 from Arquisoft/test-rankings
ChristianFN2 Apr 8, 2024
cc977a1
question.test new test
uo287841 Apr 8, 2024
1a5e844
new tets
uo287841 Apr 8, 2024
443054b
Merge branch 'develop' into luis_test
uo287841 Apr 8, 2024
90f732c
E2E Testing + Coverage tests
andrrsin Apr 8, 2024
e4a05da
Modification register
uo287841 Apr 8, 2024
3667bb5
Merge branch 'develop' into luis_test
uo287841 Apr 8, 2024
da5ef80
Merge pull request #110 from Arquisoft/luis_test
adriiglz Apr 8, 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
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
- run: npm --prefix users/authservice ci
- run: npm --prefix users/userservice ci
- run: npm --prefix gatewayservice ci
- run: npm --prefix questionservice ci
- run: npm --prefix webapp ci
- run: npm --prefix questionservice test -- --coverage
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
- run: npm --prefix gatewayservice test -- --coverage
Expand Down
78 changes: 39 additions & 39 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,47 @@ on:
types: [published]

jobs:
# unit-tests:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 20
# - run: npm --prefix users/authservice ci
# - run: npm --prefix users/userservice ci
# - run: npm --prefix gatewayservice ci
# - run: npm --prefix webapp ci
# - run: npm --prefix users/authservice test -- --coverage
# - run: npm --prefix users/userservice test -- --coverage
# - run: npm --prefix gatewayservice test -- --coverage
# - run: npm --prefix webapp test -- --coverage
# - name: Analyze with SonarCloud
# uses: sonarsource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# e2e-tests:
# needs: [unit-tests]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 20
# - run: npm --prefix users/authservice install
# - run: npm --prefix users/userservice install
# - run: npm --prefix gatewayservice install
# - run: npm --prefix webapp install
# - run: npm --prefix webapp run build
# - run: npm --prefix webapp run test:e2e
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm --prefix users/authservice ci
- run: npm --prefix users/userservice ci
- run: npm --prefix gatewayservice ci
- run: npm --prefix webapp ci
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
- run: npm --prefix gatewayservice test -- --coverage
- run: npm --prefix webapp test -- --coverage
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
e2e-tests:
needs: [unit-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm --prefix users/authservice install
- run: npm --prefix users/userservice install
- run: npm --prefix gatewayservice install
- run: npm --prefix webapp install
- run: npm --prefix webapp run build
- run: npm --prefix webapp run test:e2e
docker-push-webapp:
name: Push webapp Docker Image to GitHub Packages
runs-on: ARM64
permissions:
contents: read
packages: write
#needs: [e2e-tests]
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -65,7 +65,7 @@ jobs:
permissions:
contents: read
packages: write
# needs: [e2e-tests]
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -82,7 +82,7 @@ jobs:
permissions:
contents: read
packages: write
#needs: [e2e-tests]
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -99,7 +99,7 @@ jobs:
permissions:
contents: read
packages: write
#needs: [e2e-tests]
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -116,7 +116,7 @@ jobs:
permissions:
contents: read
packages: write
#needs: [e2e-tests]
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand Down
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ docker compose --profile dev up --build
## Meet our Team
We are students of Software Architecture in the University of Oviedo. This web application is the laboratory project of the subject. We hope you like our webapp and we are welcomed to proposals of new content by our Issues.

You can check our Documentation [here](https://arquisoft.github.io/wiq_en1a/) where all the tecnical details are explained
You can check our Documentation [here](https://arquisoft.github.io/wiq_en1a/) where all the tecnical details are explained. Moreover, you can check our API for your free use, using Swagger, [here](http://158.179.217.182:8000/api-doc).

### Developers

Expand Down
52 changes: 26 additions & 26 deletions docs/src/01_introduction_and_goals.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,44 +42,44 @@ Keep these excerpts as short as possible. Balance readability of this document w
See https://docs.arc42.org/section-1/[Introduction and Goals] in the arc42 documentation.

****
The functional requirements have been grouped into the different microservices the web application will have.

The functional requirements are the following:
* The application must be accesible through the web
* Users must be able to register into the system
* Users must be able to see data about their past games (score, correct/wrong answers, number of questions answered...)
* Questions must be automatically generated from Wikidata.
* Questions must be answered before some specific time.
* Each question must have one right answer and several incorrect ones or distractors. Both the right answer and the distractors should be automatically generated.
* The system must give access to the information about the users through an API.
* The system must give access to information about the generated questions through an API.


The functional requirements have been grouped into the different microservices the web application will have:

==== User and Authorization Services
[decimal]
. The User service allows the user to
[arabic]
.. Register.
.. Delete the account.
.. Update the account.
.. Recover the password.
.. Register
. The authorization service allows the user to
[arabic]
.. Log in.
.. Log out.
. A user can retrieve the following information from the User service
.. Log in

==== Ranking Service
. A user can retrieve the following information from the Ranking service
[arabic]
.. Name.
.. Email.
.. Profile picture.
.. Questions answered.
. The system must be able to manage the user's access to the system.
.. Points scored
.. Number of questions answered
.. Correct answers
.. Incorrect answers
. The system must be able to manage the user's access to the system

==== Question Service
[decimal, start=5]
. The Question service retrieves questions generated from wikidata.
. A user can retrieve the following information from the Question service
[arabic]
.. Select a category.
.. Select a difficulty.
.. Select a question.
.. Select an answer.
. Questions must be stored in a database.
. The database used is MongoDB.
. Questions are classified by
. The question service provides the following functionallities
[arabic]
.. Category.
.. Difficulty.
. The questions should be selected randomly.
.. Generate a random question from a given category with 4 options
.. Validate the answer and update the score accordingly

=== Quality Goals

Expand Down
30 changes: 9 additions & 21 deletions docs/src/02_architecture_constraints.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,28 @@ Architects need a clear understanding of the areas where they have creative free
|===
| Constraints | Explanation

| *Privacy (by SOLID)*
| The web application must be able to save in a secure and persistence way.

| *GitHub*
| It will be used to coordinate the projects work, tracks changes and manage workflow.

| *Time*
| The web application will be developed along this course, that means our time is limited and we require an efficient time management.


| *Documentation*
| In order to keep it clean, efficient and simple it will follow Arc42 method.
| In order to keep it clean, efficient and simple, it will follow Arc42 method and be deployed to be able to look at it at any time.


| *Time*
| Since the project will be done in this semester our time is limited, and we need to stick to the deadlines and manage our time in an efficient way.
| *Deployment*
| The project has to be deployed when a release is made


| *Code*
| The code requires a small description of what it does. In addition, we must build it in a clean way and that is easy to expand and can adapt to changes in an easy way.


| *Test*
| The test has to be correctly tested in order to accomplish the desired behavior.
| *Time*
| Since the project will be done in this semester our time is limited, and we need to stick to the deadlines and manage our time in an efficient way.


| Node.js
| Open-source, cross-platform JavaScript runtime environment and library for running web applications outside the client’s browser.
| *Testing*
| We need to have a good coverage of unitary testing (80%+) and some acceptance testing covering all the webapp functionallity

| *Ruby*
| Dynamic, open source programming language with a focus on simplicity and productivity.

| *JavaScript*
| Programming language that allows you to implement complex features on web page.
| *Wikidata*
| It has to be used for the question generation.
|===


13 changes: 9 additions & 4 deletions docs/src/03_system_scope_and_context.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,23 @@ The title of the table is the name of your system, the three columns contain the

****

The player is the only actor in the main system, which is the one that makes use of the different APIs that will be described later.
The player can initially interact with the authentication system to either register or login and then, by playing the game, the question
service will be triggered for either generating the questions or validating the player's answer. The player can also access data about
the past games of all users in a ranking.

[plantuml,"Context Diagram",png]
----
actor Player
[Wikidata] <<external>>

[WIQ Game] <<system>>
[UsersAPI] <<internal>>
[GeneratedQuestionsAPI] <<internal>>
[questionsAPI] <<internal>>
Player ..> (WIQ Game) : register/login
[GeneratedQuestionsAPI] ..> Wikidata
[questionsAPI] ..> Wikidata
[WIQ Game] ..> UsersAPI
[WIQ Game] ..> GeneratedQuestionsAPI
[WIQ Game] ..> questionsAPI
----

[cols="e,2e" options="header"]
Expand All @@ -81,6 +86,6 @@ Player ..> (WIQ Game) : register/login
|Users Info API
|Manages data of users, both registration/login data and their past scores

|Generated Questions API
|questions API
|Manages generation of questions from Wikidata
|===
35 changes: 21 additions & 14 deletions docs/src/05_building_block_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ See https://docs.arc42.org/section-5/[Building Block View] in the arc42 document

****

The system is based on having a player interact with a GUI which makes use of different APIs that hold most of the
important functionallity

=== Whitebox Overall System

[role="arc42help"]
Expand Down Expand Up @@ -71,11 +74,11 @@ actor Player
rectangle "WIQ Game (Level 1)"{
[WIQ Game GUI]
[UsersAPI]
[GeneratedQuestionsAPI] #BurlyWood
[questionsAPI] #BurlyWood
Player ..> (WIQ Game GUI)
[GeneratedQuestionsAPI] ..> Wikidata
[questionsAPI] ..> Wikidata
[WIQ Game GUI] ..> UsersAPI
[WIQ Game GUI] ..> GeneratedQuestionsAPI
[WIQ Game GUI] ..> questionsAPI
}
----

Expand All @@ -92,8 +95,8 @@ Contained Black boxes::
|WIQ Game GUI
|Main window in which questions are shown and can be answered by the player. The latter can also see past scores.

|Generated Questions API
|In charge of generating the questions
|questions API
|In charge of generating the questions and validating the answer

|UsersAPI
|In charge of keeping track of the data of the users (registration and scores)
Expand Down Expand Up @@ -150,25 +153,29 @@ Please prefer relevance over completeness. Specify important, surprising, risky,
Leave out normal, simple, boring or standardized parts of your system
****

==== Generated Questions API (White Box)
==== questions API (White Box)

This is the Component that holds the functionallity for the main purpose of the webapp: Allowing players to see questions and
answer them, getting a consequent score update.

[role="arc42help"]
****
...describes the internal structure of _building block 1_.
****

[plantuml,"Generated Questions API (WhiteBox)",png]
[plantuml,"questions API (WhiteBox)",png]
----
[Wikidata]
[wikibase-sdk] <<library>>
[WIQ Game GUI]
database MongoDB

rectangle "GenedQuestsAPI (Level 2)"{
[GenQuestsService] ..> [wikibase-sdk]
[GenQuestsService] ..> [Wikidata]
[GenQuestsService] <--> MongoDB
[WIQ Game GUI] ..> [GenQuestsService] : new Question
rectangle "questionsAPI (Level 2)"{
[question-service] ..> [wikibase-sdk]
[question-service] ..> [Wikidata]
[question-service] <--> MongoDB
[WIQ Game GUI] ..> [question-service] : new question
[WIQ Game GUI] ..> [question-service] : validate answer
}
----

Expand All @@ -182,8 +189,8 @@ Contained Black boxes::
|===
|Name |Responsibility

|GenQuestsService
|Receives different petitions regarding the generation of questions and responds accordingly.
|question-service
|Receives different petitions regarding the generation of questions and validation of answers and responds accordingly.

|wikibase-sdk
|External library that facilitates and simplifies the use of wikidata for the generation of questions.
Expand Down
Loading