Skip to content

Commit

Permalink
Changes to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
didierrc committed Apr 28, 2024
1 parent 3e6f8db commit 45d7a62
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 16 deletions.
36 changes: 29 additions & 7 deletions docs/src/06_runtime_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,36 @@ an error message showing "Invalid credentials" will appear to the user, and if t
correct, a valid JSON response is created together with the creation of a session token that
allows the user to stay authenticated for a period of time. Finally the user will be able to access the application.

This case scenario is also represented on the following diagram:
This case scenario is also represented on the following diagram (splitted in two for better readability):

[mermaid]
....
sequenceDiagram
actor User as User
User->>WebApp: Enters details (username, password)
WebApp->>Gateway: Sends user details
alt Credentials are incorrect
Gateway-->>WebApp: Sends error message "Invalid credentials"
WebApp-->>User: Displays error message "Invalid credentials"
else Credentials are correct
Gateway-->>WebApp: Sends success response.
WebApp-->>User: Displays the HomePage.
end
....

[mermaid]
....
sequenceDiagram
Gateway->>User Service: Sends user details
User Service->>UserDatabase: Asks for encrypted password by username
UserDatabase-->>User Service: Responds with the encrypted password of the user
User Service-->User Service: Tests if passwords are equal after encryption
alt Credentials are incorrect
User Service-->>Gateway: Sends error message "Invalid credentials"
Gateway-->>WebApp: Sends error message "Invalid credentials"
WebApp-->>User: Displays error message "Invalid credentials"
else Credentials are correct
User Service-->>Gateway: Creates JWT token and sends success response.
Gateway-->>WebApp: Sends success response.
WebApp-->>User: Displays the HomePage.
end
....

Expand Down Expand Up @@ -207,10 +216,23 @@ This case scenario is also represented on the following diagram:
FE->>BE: Indicates correctness of the answer
BE->>HS: Save the user history
HS->>DB: Updates the user history
....

If the user, answers the final question:

[mermaid]
....
sequenceDiagram
actor U as User
participant FE as WebApp
participant BE as Gateway
participant HS as User Service
participant DB as UserDatabase
U->>FE: Answers final Question
FE-->FE: Determines if the answer is correct
FE->>BE: Indicates correctness of the answer and end of game.
FE->>BE: Indicates correctness of the answer.
FE->>BE: Indicates End of game.
BE->>HS: Save the user history with other endgame statistics.
HS->>DB: Updates the user history
....
2 changes: 1 addition & 1 deletion docs/src/07_deployment_view.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Motivation::

Quality and/or Performance Features::

As mentioned earlier, the primary advantage of this architecture lies in the interchangeability of its components. While there are still details to be refined, this represents an initial version with promising potential.
As mentioned earlier, the primary advantage of this architecture lies in the interchangeability of its components.

Mapping of Building Blocks to Infrastructure::

Expand Down
47 changes: 40 additions & 7 deletions docs/src/08_concepts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ erDiagram
String question
Object[] answers
int correctAnswerId
String image_opt
String image
String type
}
QUESTION_TEMPLATE{
Expand All @@ -261,14 +262,15 @@ erDiagram
String name
String query
String[] entities
String typeName
}
....

|===
| Document | Description
| QUESTION_TEMPLATE
| Holds the template needed to query the WikiData API for the Question generation. It
has a reation with *ONE QUESTION_TYPE* document
has a relation with *ONE QUESTION_TYPE* document.
| QUESTION_TYPE
| Represents a category for a question (e.g. Capitals) together with its SPARQL query.
Also, several entities are provided so prior to send SPARQL query into Wikidata Service, it
Expand Down Expand Up @@ -361,11 +363,42 @@ and hold the necessary information without having to reenter the users' credenti
In this way, the user will have to keep on its browser this token to maintain
alive the session.

=== Operation concepts - TBD
=== Operation concepts

==== Monitoring with Graphana & Promotheus
Explained in labs after 2nd delivery
==== Monitoring with Grafana & Promotheus

To provide with quality to the Application, a monitorance system has been applied using
Grafana and Prometheus,to always keep track of how the application is performing. The
work is simple, it has been added Prometheus to "scrap" information from the Gateway Service
like all the petitions it is asked to it.

This information is available at kawgame.xyz:8000/metrics and the Prometheus application,
that manages it, at kawgame.xyz:9091. Although, this is retrival is good, for the "humans"
is not so comfortable to the "eye". For that, Grafana has been set up.

This application help us to see in a graphical way all the load that our Application is
having and how it responds to it. As this is "developers" information, a login has been set
up to prevent other people from knowing this information.

In that way, we would have the following:

[mermaid]
....
sequenceDiagram
Gateway->>Prometheus: GET /...
Gateway->>Prometheus: POST /...
Gateway->>Prometheus: ...
Prometheus->>+Grafana: Send information
actor u as Devs
Grafana-->>-u: Display graphs
....

==== Persisting the Persistance
Explained in labs after 2nd delivery (about mantaining data of volumes and not lost them after new containers
are deployed)

As requested by our shareholders, the application needed to keep all data from previous
deployments. For that, the team has decided to have a simple yet powerful solution with
the usage of Volumes of Docker.

With this approach, each container from the Infrastructure shown before has its own data
stored in those Volumes and it is also independent from it, so any new release will use
the previous data and "persist the persistance".
2 changes: 1 addition & 1 deletion docs/src/10_quality_requirements.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Additionally, the application's color contrast should be enough for people with
| Medium

| Availability
| Users should be able to access the application at any time, with an availability of about 99.9%.
| Users should be able to access the application at any time, with an availability of about 95%.
| Medium

|===
Expand Down

0 comments on commit 45d7a62

Please sign in to comment.