From 6ccd8978ba0d981773529bd2689c2fac40d0fb70 Mon Sep 17 00:00:00 2001 From: Dario Date: Sat, 27 Apr 2024 16:43:51 +0200 Subject: [PATCH] docs: deployment levels --- .../deployment/DeploymentDiagramLevel1.puml | 25 ++++++++++--------- .../deployment/DeploymentDiagramLevel2.puml | 25 +++++++++++++++++++ docs/src/07_deployment_view.adoc | 14 ++++++++--- 3 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 docs/diagrams/deployment/DeploymentDiagramLevel2.puml diff --git a/docs/diagrams/deployment/DeploymentDiagramLevel1.puml b/docs/diagrams/deployment/DeploymentDiagramLevel1.puml index 95445a8b..f361abf8 100644 --- a/docs/diagrams/deployment/DeploymentDiagramLevel1.puml +++ b/docs/diagrams/deployment/DeploymentDiagramLevel1.puml @@ -4,31 +4,32 @@ title WIQ Deployment View legend right |Color| Type | - |<#darkseagreen>| WIQ Server | - |<#darkolivegreen>| External Service | + |<#darkseagreen>| Container | + |<#darkolivegreen>| WIQ Server | + |<#OliveDrab>| External Service | end legend -node "Server Hosting WIQ" #darkseagreen { - node "KIWIQ Proxy" - node "KIWIQ WebApp Server" { +node "Server Hosting WIQ" #darkolivegreen { + node "KIWIQ Proxy" #darkseagreen + node "KIWIQ WebApp Server" #darkseagreen { component "KIWIQ React Application" } - node "KIWIQ API"{ + node "KIWIQ API" #darkseagreen{ component "KIWIQ_API.jar" } - node "PostgreSQL Docker" { + node "PostgreSQL Docker" #darkseagreen{ database "KIWIQ Database" } - node "Question generator" { + node "Question generator" #darkseagreen{ component "Question_Generator.jar" } - node "Grafana" - node "Prometheus" + node "Grafana" #darkseagreen + node "Prometheus" #darkseagreen } -node "User Computer" #darkolivegreen{ +node "User Computer" #OliveDrab { frame "Web Client" } -node "WikiData Server" #darkolivegreen { +node "WikiData Server" #OliveDrab { frame "WikiData REST API" } "Web Client" ..> "KIWIQ Proxy" : "HTTPS" diff --git a/docs/diagrams/deployment/DeploymentDiagramLevel2.puml b/docs/diagrams/deployment/DeploymentDiagramLevel2.puml new file mode 100644 index 00000000..fec796b2 --- /dev/null +++ b/docs/diagrams/deployment/DeploymentDiagramLevel2.puml @@ -0,0 +1,25 @@ +@startuml + +title KIWIQ API Deployment View + +legend right + |Color| Type | + |<#darkseagreen>| WIQ artifact | + |<#OliveDrab>| Package | +end legend + +node "KIWIQ_API.jar" #darkseagreen { + component "auth" #OliveDrab + component "commons"#OliveDrab + component "game" #OliveDrab + component "questions" #OliveDrab + component "statistics" #OliveDrab + +} +"auth" ..> "commons" +"game" ..> "commons" +"questions" ..> "commons" +"statistics" ..> "commons" +"game" ..> "questions" +"game" ..> "statistics" +@enduml \ No newline at end of file diff --git a/docs/src/07_deployment_view.adoc b/docs/src/07_deployment_view.adoc index 19a15f53..d9398810 100644 --- a/docs/src/07_deployment_view.adoc +++ b/docs/src/07_deployment_view.adoc @@ -21,10 +21,13 @@ As stated before, we consider the main advantage of this architecture the interc Mapping of Building Blocks to Infrastructure:: * The webapp/frontend/client is contained within the `webapp` subfolder. - * The API/backend is contained within the `api` subfolder. + * The API/backend is contained within the `quiz-api` subfolder. ** The database will be generated on deployment. ** Wikidata is an external component, so although it is an important part of the deployment architecture, it is something we do not have access to changing. + ** The grafana config is found within the `monitoring/grafana` subdirectory + ** The prometheus config is found within the `monitoring/prometheus` subdirectory * The question generator is a separate component that will be deployed on the server only at the beginning of the system. It is contained within the `questiongenerator` subfolder. + * The configuration for the proxy container is found within the `proxy_conf` subfolder. === Infrastructure Level 2 @@ -33,14 +36,17 @@ Mapping of Building Blocks to Infrastructure:: This component is self-contained and does not require much explanation. ==== API/Backend - +[plantuml,"API Deployment diagram",png] +---- +include::../diagrams/deployment/DeploymentDiagramLevel2.puml[] +---- ===== Server -Our main idea is that the server will be a self-contained .jar file with all the dependencies required within. It will communicate with the database and periodically query Wikidata to generate questions until a certain number has been obtained once per minute to fill up the database and improve speed. +Our main idea is that the server will be a self-contained .jar file with all the dependencies required within. It will communicate with the database to retrieve the questions. ===== Database -The database will contain the data used by the system. Therefore, it will contain user data, as well as the data related to the questions and their answers. The databases to store the questions (and therefore the answers) and the user data might be different, though. +The database will contain the data used by the system. Therefore, it will contain user data, as well as the data related to the questions and their answers. ===== Question Generator The question generator will be run only at the beginning of the application. It will connect with Wikidata using SPARQL to generate questions and answers and store them in the database. This question generation will generate all the questions used by the application at once. It could be run again to generate new questions if they are added.