diff --git a/docs/images/Level1-.png b/docs/images/Level1-.png new file mode 100644 index 00000000..a06326a4 Binary files /dev/null and b/docs/images/Level1-.png differ diff --git a/docs/images/Level2-History-.png b/docs/images/Level2-History-.png new file mode 100644 index 00000000..ccd3b1f8 Binary files /dev/null and b/docs/images/Level2-History-.png differ diff --git a/docs/images/Level2-Question-.png b/docs/images/Level2-Question-.png new file mode 100644 index 00000000..823b3d6f Binary files /dev/null and b/docs/images/Level2-Question-.png differ diff --git a/docs/images/Level2-Users-.png b/docs/images/Level2-Users-.png new file mode 100644 index 00000000..23c0a0f4 Binary files /dev/null and b/docs/images/Level2-Users-.png differ diff --git a/docs/images/level1.png b/docs/images/level1.png deleted file mode 100644 index 3d9cdc3b..00000000 Binary files a/docs/images/level1.png and /dev/null differ diff --git a/docs/images/level2-History.png b/docs/images/level2-History.png deleted file mode 100644 index 370d5212..00000000 Binary files a/docs/images/level2-History.png and /dev/null differ diff --git a/docs/images/level2-Question.png b/docs/images/level2-Question.png deleted file mode 100644 index b5623206..00000000 Binary files a/docs/images/level2-Question.png and /dev/null differ diff --git a/docs/images/level2-Users.png b/docs/images/level2-Users.png deleted file mode 100644 index a7dd874b..00000000 Binary files a/docs/images/level2-Users.png and /dev/null differ diff --git a/docs/images/scopeAndContext.png b/docs/images/scopeAndContext.png index 1c8a1d0a..9c16078b 100644 Binary files a/docs/images/scopeAndContext.png and b/docs/images/scopeAndContext.png differ diff --git a/docs/src/05_building_block_view.adoc b/docs/src/05_building_block_view.adoc index 9b84f466..4433a9b0 100644 --- a/docs/src/05_building_block_view.adoc +++ b/docs/src/05_building_block_view.adoc @@ -3,13 +3,13 @@ ifndef::imagesdir[:imagesdir: ../images] [[section-building-block-view]] -== Building Block View (In progress) +== Building Block View image::scopeAndContext.png["Scope and Context"] === Whitebox WIQ -image::level1.png["Level 1"] +image::Level1-.png["Level 1"] Motivation:: @@ -21,13 +21,13 @@ Contained Building Blocks:: [cols="1,2" options="header"] |=== | **Name** | **Responsibility** -| Webapp | Provides the interface to register, play and check participation history -| Gateway service | Facilitates communication between the different ports of the application -| Authservice | Allows a user to create an account in our application -| Userservice | Allows a user to access our application to play and view their history -| Roomservice | Service that handles multiplayer gaming in rooms -| Historyservice | Service that is responsible for saving and returning the history of user games -| Questionservice | It calls the Wikidata API using queries to retrieve questions, then stores them in the database. Additionally, it retrieves questions from the database when needed. +| Webapp | Provides the interface to do everything necessary in the application, sign in, sign up, sign out, play the different game modes, view the history and the ranking of the daily questions +| Gateway service | The API Gateway is a server that handles many functionalities in a single place for the clients to interact. In also works as a reverse proxy between your client applications and the back-end microservices architecture. +| Authservice | Microservice that is responsible of checking the credentials of the user who wants to log in and storing the last game of the daily question for the correct operation of that game mode +| Userservice | Microservice that is responsible to check the correct validity of the data entered by the user and add the user if everything is correct +| Roomservice | Microservice that is responsible to manage the questions in the room, the users and the rooms. +| Historyservice | Microservice that is responsible for saving and returning the history of user games, update the user daily question history and return a ranking of the daily history. +| Questionservice | Microservice that is responsible to generate the different Wikidata questions through an automatic generation using Wikidata, returns the generated questions from the database and generates the daily question. | Databases | Stores information about users, games, questions and history |=== @@ -36,35 +36,35 @@ Contained Building Blocks:: ==== White Box Users Services -image::level2-Users.png["Level 2 Users Services"] +image::Level2-Users-.png["Level 2 Users Services"] [cols="1,2" options="header"] |=== | **Name** | **Responsibility** -| authservice | The authentication service validates user credentials by verifying their existence in the database and ensuring the correctness of the provided password. -| userservice | The registration service validates user registration details by checking the uniqueness of the email and username in the database, as well as verifying the format and correctness of the provided password, ensuring it matches the repeated entry. -| userdb | The user database stores user information, including their email, username, and hashed password. Each user have their credentials securely stored for authentication purposes. +| authservice | Exposes API endpoints that enable the authentication of a user by verifying their existence in the database and ensuring the correctness of the provided password and update the date of the last daily game. +| userservice | Exposes API endpoint that enable the registration of a user. It validates user registration details by checking the uniqueness of the email and username in the database, as well as verifying the format and correctness of the provided password, ensuring it matches the repeated entry. +| userdb | The user database stores user information, including their email, username, hashed password and the last day the user played the daily. Each user have their credentials securely stored for authentication purposes. |=== ==== White Box Questionservice -image::level2-Question.png["Level 2 Questionservice"] +image::Level2-Question-.png["Level 2 Questionservice"] [cols="1,2" options="header"] |=== | **Name** | **Responsibility** -| questionservice | The questionservice automatically generates questions by making a call to the Wikidata API, retrieving relevant information, and subsequently saving the generated question in the database. Additionally, it is responsible for providing questions tailored for each type of game available in the application. -| questionsdb | Database that stores the question along with their correct answer, the category to which the question belongs, the type of the question and the answers to those questions. +| questionservice | Exposes API endpoints that enable generate questions by making a call to the Wikidata, retrieving relevant information, and subsequently saving the generated question in the database. Additionally, it is responsible for providing questions tailored for each type of game available in the application. +| questionsdb | The questions database stores the question along with their correct answer, the category to which the question belongs, the type of the question and the answers to those questions. |=== ==== White Box Historyservice -image::level2-History.png["Level 2 Historyservice"] +image::Level2-History-.png["Level 2 Historyservice"] [cols="1,2" options="header"] |=== | **Name** | **Responsibility** -| historyservice | The historyservice is responsible for storing data for each normal game played and providing access to this data in two formats. It offers two types of data retrieval: one that returns all normal games played with their respective data, and another that returns the complete history, encompassing all data related to every game played. +| historyservice | Exposes API endpoints that enable the storage of data for each normal game played and providing access to this data in two formats. It offers two types of data retrieval: one that returns all normal games played with their respective data, and another that returns the complete history, encompassing all data related to every game played. | historydb | The historydb stores user data and maintains a record of each normal game played. For every game, it saves essential details including the game number, the number of correct questions, the number of failed questions, the time taken to complete the game, and the date on which it was played. |=== diff --git a/users/authservice/gatewayservice/package-lock.json b/users/authservice/gatewayservice/package-lock.json deleted file mode 100644 index db722426..00000000 --- a/users/authservice/gatewayservice/package-lock.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "gatewayservice", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "authservice": "file:.." - } - }, - "..": { - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "bcrypt": "^5.1.1", - "body-parser": "^1.20.2", - "express": "^4.18.2", - "jsonwebtoken": "^9.0.2", - "mongoose": "^8.0.4" - }, - "devDependencies": { - "jest": "^29.7.0", - "mongodb-memory-server": "^9.1.5", - "supertest": "^6.3.4" - } - }, - "node_modules/authservice": { - "resolved": "..", - "link": true - } - } -} diff --git a/users/authservice/gatewayservice/package.json b/users/authservice/gatewayservice/package.json deleted file mode 100644 index b02c2a0a..00000000 --- a/users/authservice/gatewayservice/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "authservice": "file:.." - } -} diff --git a/users/authservice/historyservice/package-lock.json b/users/authservice/historyservice/package-lock.json deleted file mode 100644 index 71daee3b..00000000 --- a/users/authservice/historyservice/package-lock.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "historyservice", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "authservice": "file:.." - } - }, - "..": { - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "bcrypt": "^5.1.1", - "body-parser": "^1.20.2", - "express": "^4.18.2", - "jsonwebtoken": "^9.0.2", - "mongoose": "^8.0.4" - }, - "devDependencies": { - "jest": "^29.7.0", - "mongodb-memory-server": "^9.1.5", - "supertest": "^6.3.4" - } - }, - "node_modules/authservice": { - "resolved": "..", - "link": true - } - } -} diff --git a/users/authservice/historyservice/package.json b/users/authservice/historyservice/package.json deleted file mode 100644 index b02c2a0a..00000000 --- a/users/authservice/historyservice/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "authservice": "file:.." - } -} diff --git a/users/authservice/questionservice/package-lock.json b/users/authservice/questionservice/package-lock.json deleted file mode 100644 index b34a275a..00000000 --- a/users/authservice/questionservice/package-lock.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "questionservice", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "authservice": "file:.." - } - }, - "..": { - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "bcrypt": "^5.1.1", - "body-parser": "^1.20.2", - "express": "^4.18.2", - "jsonwebtoken": "^9.0.2", - "mongoose": "^8.0.4" - }, - "devDependencies": { - "jest": "^29.7.0", - "mongodb-memory-server": "^9.1.5", - "supertest": "^6.3.4" - } - }, - "node_modules/authservice": { - "resolved": "..", - "link": true - } - } -} diff --git a/users/authservice/questionservice/package.json b/users/authservice/questionservice/package.json deleted file mode 100644 index b02c2a0a..00000000 --- a/users/authservice/questionservice/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "authservice": "file:.." - } -} diff --git a/users/authservice/roomservice/package-lock.json b/users/authservice/roomservice/package-lock.json deleted file mode 100644 index 09e120fc..00000000 --- a/users/authservice/roomservice/package-lock.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "roomservice", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "authservice": "file:.." - } - }, - "..": { - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "bcrypt": "^5.1.1", - "body-parser": "^1.20.2", - "express": "^4.18.2", - "jsonwebtoken": "^9.0.2", - "mongoose": "^8.0.4" - }, - "devDependencies": { - "jest": "^29.7.0", - "mongodb-memory-server": "^9.1.5", - "supertest": "^6.3.4" - } - }, - "node_modules/authservice": { - "resolved": "..", - "link": true - } - } -} diff --git a/users/authservice/roomservice/package.json b/users/authservice/roomservice/package.json deleted file mode 100644 index b02c2a0a..00000000 --- a/users/authservice/roomservice/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "authservice": "file:.." - } -} diff --git a/users/authservice/users/authservice/package-lock.json b/users/authservice/users/authservice/package-lock.json deleted file mode 100644 index 2c1eb950..00000000 --- a/users/authservice/users/authservice/package-lock.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "authservice", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "authservice": "file:../.." - } - }, - "../..": { - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "bcrypt": "^5.1.1", - "body-parser": "^1.20.2", - "express": "^4.18.2", - "jsonwebtoken": "^9.0.2", - "mongoose": "^8.0.4" - }, - "devDependencies": { - "jest": "^29.7.0", - "mongodb-memory-server": "^9.1.5", - "supertest": "^6.3.4" - } - }, - "node_modules/authservice": { - "resolved": "../..", - "link": true - } - } -} diff --git a/users/authservice/users/authservice/package.json b/users/authservice/users/authservice/package.json deleted file mode 100644 index 81b6679f..00000000 --- a/users/authservice/users/authservice/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "authservice": "file:../.." - } -} diff --git a/users/authservice/users/userservice/package-lock.json b/users/authservice/users/userservice/package-lock.json deleted file mode 100644 index 51941bbe..00000000 --- a/users/authservice/users/userservice/package-lock.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "userservice", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "authservice": "file:../.." - } - }, - "../..": { - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "bcrypt": "^5.1.1", - "body-parser": "^1.20.2", - "express": "^4.18.2", - "jsonwebtoken": "^9.0.2", - "mongoose": "^8.0.4" - }, - "devDependencies": { - "jest": "^29.7.0", - "mongodb-memory-server": "^9.1.5", - "supertest": "^6.3.4" - } - }, - "node_modules/authservice": { - "resolved": "../..", - "link": true - } - } -} diff --git a/users/authservice/users/userservice/package.json b/users/authservice/users/userservice/package.json deleted file mode 100644 index 81b6679f..00000000 --- a/users/authservice/users/userservice/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "authservice": "file:../.." - } -} diff --git a/users/authservice/webapp/package-lock.json b/users/authservice/webapp/package-lock.json deleted file mode 100644 index 2dedd8e9..00000000 --- a/users/authservice/webapp/package-lock.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "webapp", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "authservice": "file:.." - } - }, - "..": { - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "bcrypt": "^5.1.1", - "body-parser": "^1.20.2", - "express": "^4.18.2", - "jsonwebtoken": "^9.0.2", - "mongoose": "^8.0.4" - }, - "devDependencies": { - "jest": "^29.7.0", - "mongodb-memory-server": "^9.1.5", - "supertest": "^6.3.4" - } - }, - "node_modules/authservice": { - "resolved": "..", - "link": true - } - } -} diff --git a/users/authservice/webapp/package.json b/users/authservice/webapp/package.json deleted file mode 100644 index b02c2a0a..00000000 --- a/users/authservice/webapp/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "authservice": "file:.." - } -}