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

Christian game #50

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b1186fd
build try one
andrrsin Feb 26, 2024
f98a1de
fixed hosting
andrrsin Feb 26, 2024
1a3be5e
Self host changes
andrrsin Feb 26, 2024
6913dbd
ARM64 added
andrrsin Feb 26, 2024
5b718a3
platforms added to Docker Image
andrrsin Feb 27, 2024
2831267
Platform added
andrrsin Feb 27, 2024
0bd0e4f
Documentation parts 3 and 5 corrected and updated
ChristianFN2 Mar 2, 2024
aa26f46
Merge pull request #32 from Arquisoft/docParts3And5Update
adriiglz Mar 3, 2024
43102e2
Doc 3 and 5 updated (Second try)
ChristianFN2 Mar 3, 2024
1d50fbf
Merge pull request #35 from Arquisoft/docParts3And5Update
ChristianFN2 Mar 3, 2024
e33e27a
ARM64 added
andrrsin Mar 3, 2024
df11c94
Merge pull request #37 from Arquisoft/deployment
adriiglz Mar 4, 2024
475bc2c
Readme updated
andrrsin Mar 4, 2024
73c20b6
hotfix of deployment
andrrsin Mar 4, 2024
58a7509
Merge pull request #38 from Arquisoft/Readme
ChristianFN2 Mar 4, 2024
0461995
Slight mistake in documentation point 5 corrected
ChristianFN2 Mar 5, 2024
20874f0
Added question service and linked it with the gateway service
ChristianFN2 Mar 6, 2024
727c6d8
Question Service
andrrsin Mar 6, 2024
11ebe96
Backend for rankings
adriiglz Mar 8, 2024
c09c98c
Merge branch 'develop' into rankings
adriiglz Mar 8, 2024
bec70f1
Removed token cookie
adriiglz Mar 8, 2024
7d5b21d
Merge pull request #40 from Arquisoft/rankings
andrrsin Mar 8, 2024
50fe55a
Added Rankings component
adriiglz Mar 9, 2024
c94605e
Merge pull request #41 from Arquisoft/rankings
ChristianFN2 Mar 9, 2024
f0044ec
Added navbar
adriiglz Mar 9, 2024
9b98c25
Merge pull request #42 from Arquisoft/navbar
ChristianFN2 Mar 9, 2024
9f07aa7
Documentation points 8, 11 and 12 advanced
ChristianFN2 Mar 9, 2024
5f5e867
Merge branch 'develop' into christian-documentation
ChristianFN2 Mar 9, 2024
1a4c473
Corrected small format mistake in point 11 table
ChristianFN2 Mar 9, 2024
5f46c24
Documentation points 8, 11 and 12 advanced (#43)
ChristianFN2 Mar 9, 2024
6f4c2f4
Merge branch 'develop' into christian-documentation
ChristianFN2 Mar 9, 2024
0711690
Merge pull request #45 from Arquisoft/christian-documentation
ChristianFN2 Mar 9, 2024
2a14b18
Another small mistake done during conflict solving corrected
ChristianFN2 Mar 9, 2024
a2d8be8
Minor correction in the endpoints of the question service: they were …
ChristianFN2 Mar 9, 2024
6f43478
Login Local Storage and backend (#48)
andrrsin Mar 9, 2024
58f4621
docker and login
andrrsin Mar 9, 2024
15c4490
Revert "docker and login"
adriiglz Mar 9, 2024
a41cf2c
Implemented the front end for the game using the question service (Mi…
ChristianFN2 Mar 10, 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
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- run: npm --prefix webapp run test:e2e
docker-push-webapp:
name: Push webapp Docker Image to GitHub Packages
runs-on: ubuntu-latest
runs-on: ARM64
permissions:
contents: read
packages: write
Expand All @@ -61,7 +61,7 @@ jobs:
buildargs: API_URI
docker-push-authservice:
name: Push auth service Docker Image to GitHub Packages
runs-on: ubuntu-latest
runs-on: ARM64
permissions:
contents: read
packages: write
Expand All @@ -78,7 +78,7 @@ jobs:
workdir: users/authservice
docker-push-userservice:
name: Push user service Docker Image to GitHub Packages
runs-on: ubuntu-latest
runs-on: ARM64
permissions:
contents: read
packages: write
Expand All @@ -95,7 +95,7 @@ jobs:
workdir: users/userservice
docker-push-gatewayservice:
name: Push gateway service Docker Image to GitHub Packages
runs-on: ubuntu-latest
runs-on: ARM64
permissions:
contents: read
packages: write
Expand All @@ -112,7 +112,7 @@ jobs:
workdir: gatewayservice
deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
runs-on: ARM64
needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp]
steps:
- name: Deploy over SSH
Expand Down
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
# wiq_en1a
# WIQ
[![Deploy on release](https://github.com/Arquisoft/wiq_en1a/actions/workflows/release.yml/badge.svg)](https://github.com/Arquisoft/wiq_en1a/actions/workflows/release.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_wiq_en1a&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Arquisoft_wiq_en1a)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_wiq_en1a&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Arquisoft_wiq_en1a)
### Members

Welcome to WIQ, your gateway to a world of knowledge exploration! 🚀

WIQ is a dynamic web application that harnesses the power of Wikidata to create an engaging and educational experience. Dive into the vast ocean of information, challenge yourself with thought-provoking questions across various topics, and elevate your learning journey.

Happy exploring! 🌐✨
### Getting Started:
A quick start is using docker compose, so all containers will be created automatically. The web application is hosted on the port 3000 whereas the gateway service is in 8000.

```bash
git clone https://github.com/Arquisoft/wiq_en1a.git
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

### Developers

| Name | Email |
|-----------------------------|--------------------|
| Andrés Cadenas Blanco | [email protected] |
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
- "27017:27017"
networks:
- mynetwork
# platform: linux/arm64

authservice:
container_name: authservice-${teamname:-defaultASW}
Expand All @@ -24,6 +25,7 @@ services:
- mynetwork
environment:
MONGODB_URI: mongodb://mongodb:27017/userdb
# platform: linux/arm64

userservice:
container_name: userservice-${teamname:-defaultASW}
Expand All @@ -38,6 +40,7 @@ services:
- mynetwork
environment:
MONGODB_URI: mongodb://mongodb:27017/userdb
# platform: linux/arm64

gatewayservice:
container_name: gatewayservice-${teamname:-defaultASW}
Expand All @@ -55,6 +58,7 @@ services:
environment:
AUTH_SERVICE_URL: http://authservice:8002
USER_SERVICE_URL: http://userservice:8001
# platform: linux/arm64

webapp:
container_name: webapp-${teamname:-defaultASW}
Expand All @@ -65,6 +69,8 @@ services:
- gatewayservice
ports:
- "3000:3000"
# platform: linux/arm64


prometheus:
image: prom/prometheus
Expand All @@ -79,6 +85,7 @@ services:
- "9090:9090"
depends_on:
- gatewayservice


grafana:
image: grafana/grafana
Expand All @@ -100,6 +107,7 @@ services:
- prometheus



volumes:
mongodb_data:
prometheus_data:
Expand Down
15 changes: 5 additions & 10 deletions docs/src/03_system_scope_and_context.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,15 @@ The title of the table is the name of your system, the three columns contain the

****

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

[WIQ Game] <<system>>
[UsersAPI] <<internal>>
[GeneratedQuestionsAPI] <<internal>>
Player ..> (WIQ Game) : register/login
Client ..> (WIQ Game) : view data
[GeneratedQuestionsAPI] ..> Wikidata
[WIQ Game] ..> UsersAPI
[WIQ Game] ..> GeneratedQuestionsAPI
Expand All @@ -71,21 +69,18 @@ Client ..> (WIQ Game) : view data
|Player
|Plays the game and can consult past scores

|Client
|Can access the data about players and generated questions

|WIQ Game
|Main system in which generated questions are shown and can be answered by players

|Wikidata
|External data repository from which questions are generated using the WikidataAPI
|External data repository from which questions are generated

|MongoDB
|Database for storing generated questions, players' info and scores
|Database for storing players' info and scores

|Users Info API
|Allows clients to see the info about players stored in the database
|Manages data of users, both registration/login data and their past scores

|Generated Questions API
|Allows clients to see the info about generated questions stored in the database
|Manages generation of questions from Wikidata
|===
44 changes: 11 additions & 33 deletions docs/src/05_building_block_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,19 @@ In the best case you will get away with examples or simple signatures.

****

[plantuml,"White box overall system",png]
[plantuml,"Whitebox overall system",png]
----
actor Player
actor Client
[Wikidata]

rectangle "WIQ Game (Level 1)"{
[WIQ Game GUI]
[Data View]
[UsersAPI]
[GeneratedQuestionsAPI] #BurlyWood
Player ..> (WIQ Game GUI)
Client ..> (Data View)
[GeneratedQuestionsAPI] ..> Wikidata
[WIQ Game GUI] ..> UsersAPI
[WIQ Game GUI] ..> GeneratedQuestionsAPI
[Data View] ..> UsersAPI
[Data View] ..> GeneratedQuestionsAPI
}
----

Expand All @@ -97,11 +92,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.

|Data View
|Access to data about users and generated questions for the client.

|Generated Questions API
|In charge of generating the questions and storing their data
|In charge of generating the questions

|UsersAPI
|In charge of keeping track of the data of the users (registration and scores)
Expand Down Expand Up @@ -165,21 +157,18 @@ Leave out normal, simple, boring or standardized parts of your system
...describes the internal structure of _building block 1_.
****

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

rectangle "GenedQuestsAPI (Level 2)"{

[GenQuestsService] ..> wikidatanpm
[GenQuestsService] ..> Wikidata
[GenQuestsService] ..> [wikibase-sdk]
[GenQuestsService] ..> [Wikidata]
[GenQuestsService] <--> MongoDB
[WIQ Game GUI] ..> GenQuestsService : new Question
[Data View] ..> GenQuestsService : get Questions
[WIQ Game GUI] ..> [GenQuestsService] : new Question
}
----

Expand All @@ -194,23 +183,12 @@ Contained Black boxes::
|Name |Responsibility

|GenQuestsService
|Receives different petitions regarding the generation of questions or their retrieval and responds accordingly.
|Receives different petitions regarding the generation of questions and responds accordingly.

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

|MongoDB
|The data of the generated questions is stored here for showing it later to the client.

|===

Additional explanation of relationships::

The service is requested either the generation of a question or the retrieval of a subset (from WIQ Game GUI or
Data View respectively).

For the first case, it makes use of the library to generate the question, retrieves it
for the interface to use and stores the pertinent data in the DB.
|Data about users and their scores is stored here

In the other case, it just makes the query according to the client choosings and retrieves the data of the
questions for the Data View to show.
|===
23 changes: 15 additions & 8 deletions docs/src/08_concepts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,26 @@ image::08-Crosscutting-Concepts-Structure-EN.png["Possible topics for crosscutti
See https://docs.arc42.org/section-8/[Concepts] in the arc42 documentation.
****

=== _Domain model and terminology_

=== _<Concept 1>_

_<explanation>_


=== _Microservice based system_

=== _<Concept 2>_
Different business functionallities will be developed in different independent services.
This will ensure that if one of them fails, the rest are still working (For example,
if the rankings go down that will not affect the main game) as they have their own deployment
as well.
Other benefits are increased maintainability due to separation in small, more readable modules
and the possibillity of using different languages or technologies for each module if needed/prefered
without colliding with the rest.

_<explanation>_

...
=== _Gateway service routing_

=== _<Concept n>_

_<explanation>_
We will use a speciallized service that will route the requests to the corresponding service, acting as
a single entry point for the application. Requests to the services are much simpler as only the api base
endpoint and the action needs to be known and the gateway can also act as a filter to manage requests
conditionally if needed. This approach also favors security as we can control which requests are actually
sent based on its content or the context of the app.
11 changes: 11 additions & 0 deletions docs/src/11_technical_risks.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,14 @@ List of risks and/or technical debts, probably including suggested measures to m
See https://docs.arc42.org/section-11/[Risks and Technical Debt] in the arc42 documentation.

****

[options="header", cols="1,1,1,1"]
|===
|Risk |Why it exists |Severity - Explanation |Possible solutions

|Use of wikibase-sdk version 8 (not final)
|It is the last version that supports 'require', which is needed to use express in the same module
|Low - The difference is, a priori, merely functional, but retains the needed characteristics
|Upgrade only if a newer version supports 'require'

|===
8 changes: 4 additions & 4 deletions docs/src/12_glossary.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ See https://docs.arc42.org/section-12/[Glossary] in the arc42 documentation.
|===
|Term |Definition

|<Term-1>
|<definition-1>
|Microservice
|Small and independent component that performs a specific business function

|<Term-2>
|<definition-2>
|API
|Set of endpoints exposed by the backend server whose purpose is interacting with the client-side
|===
Loading
Loading