Skip to content

Commit

Permalink
v1.0 release
Browse files Browse the repository at this point in the history
Master update
  • Loading branch information
andrrsin authored Apr 27, 2024
2 parents 4876433 + a1c5a65 commit 1530142
Show file tree
Hide file tree
Showing 54 changed files with 23,157 additions and 851 deletions.
51 changes: 25 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,29 @@ jobs:
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
# env:
# CI: ""
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: CI=false npm --prefix webapp run build
- run: CI=true 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: [unit-tests]
needs: [e2e-tests]
# needs: [unit-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -68,8 +67,8 @@ jobs:
permissions:
contents: read
packages: write
# needs: [e2e-tests]
needs: [unit-tests]
needs: [e2e-tests]
# needs: [unit-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -86,8 +85,8 @@ jobs:
permissions:
contents: read
packages: write
# needs: [e2e-tests]
needs: [unit-tests]
needs: [e2e-tests]
# needs: [unit-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -104,8 +103,8 @@ jobs:
permissions:
contents: read
packages: write
# needs: [e2e-tests]
needs: [unit-tests]
needs: [e2e-tests]
# needs: [unit-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -122,8 +121,8 @@ jobs:
permissions:
contents: read
packages: write
# needs: [e2e-tests]
needs: [unit-tests]
needs: [e2e-tests]
# needs: [unit-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ services:
prometheus:
image: prom/prometheus
container_name: prometheus-${teamname:-defaultASW}
profiles: ["dev"]
profiles: ["dev","prod"]
networks:
- mynetwork
volumes:
Expand All @@ -107,7 +107,7 @@ services:
grafana:
image: grafana/grafana
container_name: grafana-${teamname:-defaultASW}
profiles: ["dev"]
profiles: ["dev","prod"]
networks:
- mynetwork
volumes:
Expand Down
11 changes: 8 additions & 3 deletions docs/src/01_introduction_and_goals.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ These include
* quality goals for the architecture and
* relevant stakeholders and their expectations
****
In these points, the main goals and functional requirements will be explained. In order to give context on how the webapp will be developed.

This project's aim, in summary, is developing a public web application which has a game consisting on answering multiple choice questions
with one correct answer generated using Wikidata. For reference of the general mechanic, see the spanish quiz program 'Saber y Ganar' and
its game mode 'Descartando'

Next, important basic aspects of the project will be described in order to give context on how the webapp will be developed.

=== Requirements Overview

Expand Down Expand Up @@ -44,6 +49,7 @@ See https://docs.arc42.org/section-1/[Introduction and Goals] in the arc42 docum
****

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...)
Expand Down Expand Up @@ -141,10 +147,9 @@ Table with role names, person names, and their expectations with respect to the

[options="header",cols="1,2,2"]
|===
|Role/Name|Contact|Expectations
|Role/Name|Members|Expectations
| *Students* | Andrés Cadenas Blanco, Christian Fernandez Noriega , Adrián González Guadalupe and Luis Salvador Ferrero | Are the ones in charge of web development. They will work together to make the application.
| *Teachers* | Pablo González | In charge of supervising the student's teamwork, ensuring the work accomplishes the goals in the best way possible and helping in the development and solving doubts.
| *Bussineses* | RTve has hired software development company HappySw | Emphasis the SOLID part of the web and have a high understanding of this area
| *Users* | Anyone that wants to use the web | They should be able to understand how to use and move around the web with ease
|===

16 changes: 9 additions & 7 deletions docs/src/03_system_scope_and_context.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ the past games of all users in a ranking.
----
actor Player
[Wikidata] <<external>>
database MongoDB
[WIQ Game] <<system>>
[UsersAPI] <<internal>>
[questionsAPI] <<internal>>
[QuestionsAPI] <<internal>>
Player ..> (WIQ Game) : register/login
[questionsAPI] ..> Wikidata
[QuestionsAPI] ..> Wikidata
[WIQ Game] ..> UsersAPI
[WIQ Game] ..> questionsAPI
[WIQ Game] ..> QuestionsAPI
[UsersAPI] <--> MongoDB
----

[cols="e,2e" options="header"]
Expand All @@ -80,12 +82,12 @@ Player ..> (WIQ Game) : register/login
|Wikidata
|External data repository from which questions are generated

|MongoDB
|Database for storing players' info and scores

|Users Info API
|Manages data of users, both registration/login data and their past scores

|questions API
|Questions API
|Manages generation of questions from Wikidata

|MongoDB
|Database for storing players' info and scores
|===
13 changes: 9 additions & 4 deletions docs/src/04_solution_strategy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@ ifndef::imagesdir[:imagesdir: ../images]

[[section-solution-strategy]]
== Solution Strategy
The system will follow *MERN Stack* as they key technologies for its development. MERN Stack is composed of four technologies: MongoDB, Express,
React and Node.
The web application is based on MERN stack, a full-stack combination of technologies for developing JavaScript applications fast.

* *Node:* the JavaScript runtime environment.
* *MongoDB:* chosen technology for the persistance of the system, that provides a non-relational database approach.
* *Express and Node:* they make up the middle tier of the application, providing a powerful server platform.
* *React:* front-end framework that will solve the client interfaces of the application.

Regarding the deployment of the application, the strategy chosen is a *cloud-based* system. This decision was motivated because of the nature of
the project, since a web application needs to be live and accesible at any moment.
The server will be an ARM *Linux VM on Oracle*, where some *containers* for different charasteristics of the system will be *deployed with
Docker* (MongoDB database for example)
The server will be an ARM *Linux VM on Oracle*, where some *dockerized microservices* will be deployed:

* users service
* authentication service
* questions service
* web application
* gateway

[role="arc42help"]
****
Expand Down
15 changes: 5 additions & 10 deletions docs/src/05_building_block_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ actor Player
rectangle "WIQ Game (Level 1)"{
[WIQ Game GUI]
[UsersAPI]
[questionsAPI] #BurlyWood
[QuestionsAPI] #BurlyWood
Player ..> (WIQ Game GUI)
[questionsAPI] ..> Wikidata
[QuestionsAPI] ..> Wikidata
[WIQ Game GUI] ..> UsersAPI
[WIQ Game GUI] ..> questionsAPI
[WIQ Game GUI] ..> QuestionsAPI
}
----

Expand Down Expand Up @@ -153,7 +153,7 @@ Please prefer relevance over completeness. Specify important, surprising, risky,
Leave out normal, simple, boring or standardized parts of your system
****

==== 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.
Expand All @@ -163,17 +163,15 @@ answer them, getting a consequent score update.
...describes the internal structure of _building block 1_.
****

[plantuml,"questions API (WhiteBox)",png]
[plantuml,"Questions API (WhiteBox)",png]
----
[Wikidata]
[wikibase-sdk] <<library>>
[WIQ Game GUI]
database MongoDB
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 @@ -195,7 +193,4 @@ Contained Black boxes::
|wikibase-sdk
|External library that facilitates and simplifies the use of wikidata for the generation of questions.

|MongoDB
|Data about users and their scores is stored here

|===
75 changes: 45 additions & 30 deletions docs/src/06_runtime_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,59 @@ ifndef::imagesdir[:imagesdir: ../images]
* Users will log in through the web interface of the application.
* The system stores in database (MongoDB) the users of the application. Any data relative to them is accessed via the database of the system and displayed to them on the web interface.

=== Access to user data via API
* Clients access the users data through an API
=== Rankings
* Users can see the rankings for a specific category

[plantuml,"users diagram",png]
[plantuml,"rankings_diagram",png]
----
entity Client
database API as "Users API"
Client -> API: Data querying request
API --> Client: Retrieved data
entity User
entity WEBC as "Web Client"
entity GW as "Gateway"
entity USERS as "Users service"
database DB as "MongoDB"
User -> WEBC: Navigate to rankings page
WEBC -> GW: Get global statistics
GW -> USERS: Get global statistics
USERS -> DB: Get statistics matching the specified category
USERS -> GW: Send global statistics
GW -> WEBC: Send global statistics
User -> WEBC: Select a category
WEBC -> GW: Get category statistics
GW -> USERS: Get category statistics
USERS -> DB: Get statistics matching the specified category
USERS -> GW: Send category statistics
GW -> WEBC: Send category statistics
----

=== Access to questions data via API
* Clients access the questions data through an API
=== Playing
* An overview of the runtime scenario of a game.

[plantuml,"questions diagram",png]
----
entity Client
database API as "Questions API"
Client -> API: Data querying request
API --> Client: Retrieved data
----

=== Game
* Users can play a Q&A game

[plantuml,"game diagram",png]
[plantuml, "playing_diagram", png]
----
actor User
entity App
database QAPI as "Questions API"
database UAPI as "Users API"
User -> App: Start Game
App -> QAPI: Get Questions
QAPI --> App: Send Questions
App -> User: Show Question
User --> App: Answer Question
App -> UAPI: Update User Data
entity WEBC as "Web Client"
entity GW as "Gateway"
entity QU as "Questions API"
entity USERS as "Users Service API"
database DB as "MongoDB"
User -> WEBC: Select a category to play
WEBC -> GW: Get a question
GW -> QU: Get a question
QU -> QU: Store question and answer
QU -> GW: Send question to client
GW -> WEBC: Send question to client
User -> WEBC: Answer question
WEBC -> GW: Send answer
GW -> QU: Send answer
QU -> QU: Check answer
QU -> USERS: Update user points
USERS -> DB: Modify user data
QU -> GW: Send result and new question
GW -> WEBC: Send result and new question
----

[role="arc42help"]
****
.Contents
Expand Down
3 changes: 0 additions & 3 deletions docs/src/07_deployment_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ MDB-[dashed]->AS
US-[dashed]->MDB
MDB-[dashed]->US
QS-[dashed]->MDB
MDB-[dashed]->QS
----
The architecture of WIQ is based on microservices. Gateway service is the main entry point for the system. The web application is the main interface for the user to interact with the system. The user service is responsible for managing users. The authorization service is responsible for managing user permissions. The question service is responsible for generating questions. The mongo database is used to store data.

Expand Down
9 changes: 9 additions & 0 deletions docs/src/08_concepts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ image::08-Crosscutting-Concepts-Structure-EN.png["Possible topics for crosscutti
See https://docs.arc42.org/section-8/[Concepts] in the arc42 documentation.
****

=== _Continuous integration and development_

Our way of working with github is having one developing branch towards which all pull requests are done
and have to be reviewed by at least one team member.
Sonar Cloud is set up so we know the testing coverage and whether we pass the quality gate with every pull request.
Once there is enough change in the develop branch with respect to the main one and it has enough quality we can
merge them and make a release.


=== _Microservice based system_

Different business functionallities will be developed in different independent services.
Expand Down
Loading

0 comments on commit 1530142

Please sign in to comment.