From 0306822a97e8797154e8e4cfd34e31d4cd8e1580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Tru=C3=A9bano?= Date: Sat, 20 Apr 2024 12:12:14 +0200 Subject: [PATCH 01/13] Enhancing documentation --- docs/src/04_solution_strategy.adoc | 7 ++++++- docs/src/07_deployment_view.adoc | 33 ++++++++++++++++++++++++------ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/docs/src/04_solution_strategy.adoc b/docs/src/04_solution_strategy.adoc index e5c9319..054485f 100644 --- a/docs/src/04_solution_strategy.adoc +++ b/docs/src/04_solution_strategy.adoc @@ -42,6 +42,9 @@ See https://docs.arc42.org/section-4/[Solution Strategy] in the arc42 documentat * *npm*: default package manager for Node.js, providing a command-line interface to install, manage, and publish JavaScript packages. With over a million packages available in its registry, npm simplifies adding functionality to Node.js projects by handling dependencies and providing tools for versioning and publishing packages. * *Docker*: platform that will be used for deploying our services inside containers. Containers are lightweight, portable, and self-sufficient units that contain everything needed to run an application, including the code, runtime, system tools, libraries, and settings. Docker enables developers to package their applications along with all dependencies into containers, ensuring consistency across different environments, such as development, testing, and production. * *GitHub Actions*: built-in automation tool on GitHub that allows us to automate some workflows that are triggered after some specific github branches actions at development. It provides as continuous integration of the game functionality. +* *Gatling*: Load test tool that allows us to record some user interaction from our application and simulate it as if various differnet users were accessing the application. +* *Prometheus*: monitoring and alerting toolkit designed for reliability and scalability. It collects metrics from configured targets at specified intervals, stores them efficiently, and provides a powerful query language for analyzing and alerting on these metrics. It's particularly well-suited for dynamic environments like cloud-native applications and microservices architectures. +* *Grafana*: open-source platform for monitoring and observability, providing customizable dashboards and visualization tools for analyzing metrics, logs, and other data sources. It allows users to create dynamic, interactive dashboards to monitor the health and performance of their systems and applications. === Technological decisions @@ -54,7 +57,9 @@ As a conclusion, it was worth spending time making the migration for reducing th * *Microservices*: is an architectural style that structures an application as a collection of loosely coupled services. Each service is independently deployable, scalable, and can be developed using different programming languages, frameworks, or databases. In a microservices architecture, each service typically represents a specific business function or capability and communicates with other services through well-defined APIs. This enables teams to work independently on different parts of the application, allowing us to divide the work into different teams avoiding bottlenecks during production. -* *APIs*: using microservices architecture enforces us to isolate each of the microservices and create well-defined interfaces for accesing those microservices from common gateway, reducing dependencies between services and allowing them to evolve independently. Well-defined interfaces imply not only services independance, but also team members independecance since nobody will need to wait for others for starting working themselves. +* *API Gateway*: centralized service that acts as an intermediary between clients and microservices. It serves as a single entry point for all client requests, providing various functionalities by means of routing and redirecting to the specific service in charge of that request They play a crucial role in building scalable and efficient distributed systems by abstracting away complexities and providing a unified interface for clients to interact with all available services. +* *API*: using microservices architecture enforces us to isolate each of the microservices and create well-defined interfaces for accesing those microservices from common gateway, reducing dependencies between services and allowing them to evolve independently. Well-defined interfaces imply not only services' independance, but also team members independecance since nobody will need to wait for others for starting working themselves. + === Team Organization diff --git a/docs/src/07_deployment_view.adoc b/docs/src/07_deployment_view.adoc index eb5b547..1a7664a 100644 --- a/docs/src/07_deployment_view.adoc +++ b/docs/src/07_deployment_view.adoc @@ -24,9 +24,9 @@ Using your Azure account: ** `DEPLOY_USER` does not need to be changed * Once the virtual machine is created and the repository is configured, go to Network Settings and add extra rules: -** Open port number 3000 for user services -** Open port number 8000 for accessing the web application -*** More services will be available in the future, so discussions will be made for additional ports supporting our services. +** Open port number 80 for accesing the web application, or 443 in case HTTPS is used +** Open port number 8000 for giving access to the API gateway +** Open port number 9091 for giving access to monitoring the application checking some Grafana data * Configure the virtual machine connecting through SSH for using Docker: ** Use some tool for connecting to the server using SSH (PuTTY, MobaXterm...) @@ -145,9 +145,9 @@ frame GitHub{ WebAPP -- APIGateway : port 8000 Wikidata -- WikidataAPI: port 8001 -Users -- UsersAPI : port 8002 +Users -- UsersAPI : port 8003 UsersAPI -- UsersDatabase : MongoDB (port 27017) -client -- WebAPP : Web Browser (port 3000) +client -- WebAPP : Web Browser (port 80) GitHubActions -- UbuntuServer : on release Docker -- wiq_en3a @@ -172,7 +172,7 @@ For now, the project contains: ** Web application service running on port 3000 ** Gateway (middleware) service running on port 8000 ** Wikidata API running on port 8001 -** Users API running on port 8002 +** Users API running on port 8003 ** Mongo DB server running on port 27017 ** Prometheus running on port 9090 for monitoring ** Grafana running on port 9091 for analytics and monitoring @@ -182,6 +182,27 @@ For now, the project contains: GitHub actions will provide us with continuous automatic delivery and integration, automating the deployment phase at each release. +=== Motivation + +In the deployment view of our software architecture, we delineate the physical deployment of our system components across various environments. +At the core of our deployment strategy is the utilization of cloud-based infrastructure, specifically leveraging Azure for its robustness and scalability. +Our server components, including web applications, gateway, user services, and MongoDB servers, are encapsulated within Docker containers to ensure portability and consistency across deployments. +Additionally, we employ Azure's built-in services for auto-scaling, and traffic management to optimize performance and reliability. +Continuous integration and deployment pipelines are established using tools like Jenkins or Azure DevOps, facilitating seamless updates and releases of our system components. +Monitoring and logging solutions, such as Prometheus and Grafana, are integrated to provide insights into system health and performance. +Overall, our deployment view showcases a resilient, scalable, and automated deployment architecture tailored to meet the demands of our system's evolving requirements. + +=== Mapping of Building Blocks into Infrastructure + +[cols="1,2" options="header"] +|=== +| **Name** | **Responsibility** +| Frontend | Web App container opened in port 80. +| User Management | User service container. +| Wikidata Service | Wikidata service container. +| Gateway | API Gateway service opened in port 8000. +|=== + [role="arc42help"] **** From fc809bbae87feddc235ff56c2b67ecb5ea59712d Mon Sep 17 00:00:00 2001 From: sergiollende Date: Sun, 28 Apr 2024 13:06:38 +0200 Subject: [PATCH 02/13] Creating server port 80 --- webapp/e2e/steps/leaderboard.steps.js | 2 +- webapp/e2e/steps/login-form.steps.js | 2 +- webapp/e2e/steps/logout.steps.js | 2 +- webapp/e2e/steps/normal-game.steps.js | 2 +- webapp/e2e/steps/register-form.steps.js | 2 +- webapp/e2e/steps/statistics.steps.js | 2 +- webapp/e2e/steps/trivia-game.steps.js | 2 +- webapp/package.json | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/webapp/e2e/steps/leaderboard.steps.js b/webapp/e2e/steps/leaderboard.steps.js index d367beb..d014640 100644 --- a/webapp/e2e/steps/leaderboard.steps.js +++ b/webapp/e2e/steps/leaderboard.steps.js @@ -18,7 +18,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost:80", { + .goto("http://localhost", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/e2e/steps/login-form.steps.js b/webapp/e2e/steps/login-form.steps.js index 69c0d27..2570518 100644 --- a/webapp/e2e/steps/login-form.steps.js +++ b/webapp/e2e/steps/login-form.steps.js @@ -18,7 +18,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost:80", { + .goto("http://localhost", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/e2e/steps/logout.steps.js b/webapp/e2e/steps/logout.steps.js index 32958cc..cec801e 100644 --- a/webapp/e2e/steps/logout.steps.js +++ b/webapp/e2e/steps/logout.steps.js @@ -18,7 +18,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost:80", { + .goto("http://localhost", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/e2e/steps/normal-game.steps.js b/webapp/e2e/steps/normal-game.steps.js index a826d55..7c514f5 100644 --- a/webapp/e2e/steps/normal-game.steps.js +++ b/webapp/e2e/steps/normal-game.steps.js @@ -18,7 +18,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost:80", { + .goto("http://localhost", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js index 063968a..e2b6122 100644 --- a/webapp/e2e/steps/register-form.steps.js +++ b/webapp/e2e/steps/register-form.steps.js @@ -17,7 +17,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost:80", { + .goto("http://localhost", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/e2e/steps/statistics.steps.js b/webapp/e2e/steps/statistics.steps.js index dfbe84e..e7c3adc 100644 --- a/webapp/e2e/steps/statistics.steps.js +++ b/webapp/e2e/steps/statistics.steps.js @@ -18,7 +18,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost:80", { + .goto("http://localhost", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/e2e/steps/trivia-game.steps.js b/webapp/e2e/steps/trivia-game.steps.js index 0a529dc..3cabb76 100644 --- a/webapp/e2e/steps/trivia-game.steps.js +++ b/webapp/e2e/steps/trivia-game.steps.js @@ -18,7 +18,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost:80", { + .goto("http://localhost", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/package.json b/webapp/package.json index c8563b8..c49b050 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -35,9 +35,9 @@ "scripts": { "start": "set PORT=80 && set HTTP=true && react-scripts start", "build": "set PORT=80 && set HTTP=true && react-scripts build", - "prod": "serve -s build", + "prod": "serve -s build -l 80", "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!axios)/'", - "test:e2e": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod https://localhost:80 \"cd e2e && jest\"", + "test:e2e": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 80 \"cd e2e && jest\"", "eject": "react-scripts eject" }, "eslintConfig": { From e1bf1cb122a6e30edf8207e422483b5a552e7691 Mon Sep 17 00:00:00 2001 From: sergiollende Date: Sun, 28 Apr 2024 13:14:19 +0200 Subject: [PATCH 03/13] prod link --- webapp/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/package.json b/webapp/package.json index c49b050..54236cd 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -37,7 +37,7 @@ "build": "set PORT=80 && set HTTP=true && react-scripts build", "prod": "serve -s build -l 80", "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!axios)/'", - "test:e2e": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 80 \"cd e2e && jest\"", + "test:e2e": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod http://localhost:80 \"cd e2e && jest\"", "eject": "react-scripts eject" }, "eslintConfig": { From 2cad4106803d4224ff5307718cd3c7949e5ae996 Mon Sep 17 00:00:00 2001 From: sergiollende Date: Sun, 28 Apr 2024 14:46:38 +0200 Subject: [PATCH 04/13] E2e test running on 80 --- users/index.js | 2 +- webapp/e2e/jest.config.js | 2 +- webapp/package.json | 6 ++++-- wikidataservice/index.js | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/users/index.js b/users/index.js index a213ef2..367aed9 100644 --- a/users/index.js +++ b/users/index.js @@ -8,7 +8,7 @@ dotenv.config(); // app and port definition const app = express(); -const port = process.env.PORT || 8003; +const port = 8003; // Connect to MongoDB const mongoUri = process.env.MONGODB_URI; diff --git a/webapp/e2e/jest.config.js b/webapp/e2e/jest.config.js index 6e9de15..6adbaf0 100644 --- a/webapp/e2e/jest.config.js +++ b/webapp/e2e/jest.config.js @@ -1,5 +1,5 @@ module.exports = { testMatch: ["**/steps/*.js"], - testTimeout: 40000, + testTimeout: 50000, setupFilesAfterEnv: ["expect-puppeteer"] } \ No newline at end of file diff --git a/webapp/package.json b/webapp/package.json index 54236cd..644ffdb 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -35,9 +35,11 @@ "scripts": { "start": "set PORT=80 && set HTTP=true && react-scripts start", "build": "set PORT=80 && set HTTP=true && react-scripts build", - "prod": "serve -s build -l 80", + "prod": "serve -s build", "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!axios)/'", - "test:e2e": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod http://localhost:80 \"cd e2e && jest\"", + "test:e2e": "cd ../webapp && npm run build && npm run test:e2eci", + "test:e2eci": "cross-env START_SERVER_AND_TEST_INSECURE=1 PORT=80 npm run rune2etests", + "rune2etests": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 80 \"cd e2e && jest\"", "eject": "react-scripts eject" }, "eslintConfig": { diff --git a/wikidataservice/index.js b/wikidataservice/index.js index acff56f..2e7fa31 100644 --- a/wikidataservice/index.js +++ b/wikidataservice/index.js @@ -6,7 +6,7 @@ const cors = require('cors') const { generateQuestions } = require('./src/Services/QuestionGenerator'); const app = express(); -const port = process.env.PORT || 8001; +const port = 8001; const NUMBER_QUESTIONS = 10; // Middleware to parse JSON in request body From 3ee2c7a12f3c89949606854165823c0de9406415 Mon Sep 17 00:00:00 2001 From: sergiollende Date: Sun, 28 Apr 2024 14:55:57 +0200 Subject: [PATCH 05/13] More timeout and config change --- webapp/e2e/jest.config.js | 2 +- webapp/package.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/webapp/e2e/jest.config.js b/webapp/e2e/jest.config.js index 6adbaf0..5dd2b70 100644 --- a/webapp/e2e/jest.config.js +++ b/webapp/e2e/jest.config.js @@ -1,5 +1,5 @@ module.exports = { testMatch: ["**/steps/*.js"], - testTimeout: 50000, + testTimeout: 100000, setupFilesAfterEnv: ["expect-puppeteer"] } \ No newline at end of file diff --git a/webapp/package.json b/webapp/package.json index 644ffdb..5c1a50b 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -37,8 +37,7 @@ "build": "set PORT=80 && set HTTP=true && react-scripts build", "prod": "serve -s build", "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!axios)/'", - "test:e2e": "cd ../webapp && npm run build && npm run test:e2eci", - "test:e2eci": "cross-env START_SERVER_AND_TEST_INSECURE=1 PORT=80 npm run rune2etests", + "test:e2e": "cross-env START_SERVER_AND_TEST_INSECURE=1 PORT=80 npm run rune2etests", "rune2etests": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 80 \"cd e2e && jest\"", "eject": "react-scripts eject" }, From 4c48689bf159f22f02aff91b6667b7ccfef78337 Mon Sep 17 00:00:00 2001 From: sergiollende Date: Sun, 28 Apr 2024 15:05:43 +0200 Subject: [PATCH 06/13] Dependencia instalada --- webapp/package-lock.json | 28 ++++++++++++++++++++++++++++ webapp/package.json | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 0f5e7f7..f4bd56f 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -39,6 +39,7 @@ }, "devDependencies": { "axios-mock-adapter": "^1.22.0", + "cross-env": "^7.0.3", "expect-puppeteer": "^9.0.2", "jest": "^29.3.1", "jest-cucumber": "^3.0.1", @@ -10328,6 +10329,24 @@ "node": ">=8" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-fetch": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", @@ -37147,6 +37166,15 @@ } } }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-fetch": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", diff --git a/webapp/package.json b/webapp/package.json index 5c1a50b..50bbb0d 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -35,7 +35,7 @@ "scripts": { "start": "set PORT=80 && set HTTP=true && react-scripts start", "build": "set PORT=80 && set HTTP=true && react-scripts build", - "prod": "serve -s build", + "prod": "serve -s build", "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!axios)/'", "test:e2e": "cross-env START_SERVER_AND_TEST_INSECURE=1 PORT=80 npm run rune2etests", "rune2etests": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 80 \"cd e2e && jest\"", @@ -61,6 +61,7 @@ }, "devDependencies": { "axios-mock-adapter": "^1.22.0", + "cross-env": "^7.0.3", "expect-puppeteer": "^9.0.2", "jest": "^29.3.1", "jest-cucumber": "^3.0.1", From 9f94ba5539c503168c9a88e5a208ba27d331637e Mon Sep 17 00:00:00 2001 From: sergiollende Date: Sun, 28 Apr 2024 15:19:11 +0200 Subject: [PATCH 07/13] Changin port e2e 3000 --- webapp/e2e/steps/leaderboard.steps.js | 2 +- webapp/e2e/steps/login-form.steps.js | 2 +- webapp/e2e/steps/logout.steps.js | 2 +- webapp/e2e/steps/normal-game.steps.js | 2 +- webapp/e2e/steps/register-form.steps.js | 2 +- webapp/e2e/steps/statistics.steps.js | 2 +- webapp/e2e/steps/trivia-game.steps.js | 2 +- webapp/package.json | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/webapp/e2e/steps/leaderboard.steps.js b/webapp/e2e/steps/leaderboard.steps.js index d014640..e46d389 100644 --- a/webapp/e2e/steps/leaderboard.steps.js +++ b/webapp/e2e/steps/leaderboard.steps.js @@ -18,7 +18,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost", { + .goto("http://localhost:3000", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/e2e/steps/login-form.steps.js b/webapp/e2e/steps/login-form.steps.js index 2570518..9bc1a62 100644 --- a/webapp/e2e/steps/login-form.steps.js +++ b/webapp/e2e/steps/login-form.steps.js @@ -18,7 +18,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost", { + .goto("http://localhost:3000", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/e2e/steps/logout.steps.js b/webapp/e2e/steps/logout.steps.js index cec801e..4a34957 100644 --- a/webapp/e2e/steps/logout.steps.js +++ b/webapp/e2e/steps/logout.steps.js @@ -18,7 +18,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost", { + .goto("http://localhost:3000", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/e2e/steps/normal-game.steps.js b/webapp/e2e/steps/normal-game.steps.js index 7c514f5..fcfcdc4 100644 --- a/webapp/e2e/steps/normal-game.steps.js +++ b/webapp/e2e/steps/normal-game.steps.js @@ -18,7 +18,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost", { + .goto("http://localhost:3000", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js index e2b6122..9eae318 100644 --- a/webapp/e2e/steps/register-form.steps.js +++ b/webapp/e2e/steps/register-form.steps.js @@ -17,7 +17,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost", { + .goto("http://localhost:3000", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/e2e/steps/statistics.steps.js b/webapp/e2e/steps/statistics.steps.js index e7c3adc..c2e3e8f 100644 --- a/webapp/e2e/steps/statistics.steps.js +++ b/webapp/e2e/steps/statistics.steps.js @@ -18,7 +18,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost", { + .goto("http://localhost:3000", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/e2e/steps/trivia-game.steps.js b/webapp/e2e/steps/trivia-game.steps.js index 3cabb76..c4cabfe 100644 --- a/webapp/e2e/steps/trivia-game.steps.js +++ b/webapp/e2e/steps/trivia-game.steps.js @@ -18,7 +18,7 @@ defineFeature(feature, test => { setDefaultOptions({ timeout: 10000 }) await page - .goto("http://localhost", { + .goto("http://localhost:3000", { waitUntil: "networkidle0", }) .catch(() => {}); diff --git a/webapp/package.json b/webapp/package.json index 50bbb0d..82f5410 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -35,10 +35,10 @@ "scripts": { "start": "set PORT=80 && set HTTP=true && react-scripts start", "build": "set PORT=80 && set HTTP=true && react-scripts build", - "prod": "serve -s build", + "prod": "serve -s build -l 3000", "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!axios)/'", "test:e2e": "cross-env START_SERVER_AND_TEST_INSECURE=1 PORT=80 npm run rune2etests", - "rune2etests": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 80 \"cd e2e && jest\"", + "rune2etests": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 3000 \"cd e2e && jest\"", "eject": "react-scripts eject" }, "eslintConfig": { From 3fbdb5a6a3629fcf31ad3f9e9f23a7caadb3ba8e Mon Sep 17 00:00:00 2001 From: sergiollende Date: Sun, 28 Apr 2024 22:11:55 +0200 Subject: [PATCH 08/13] Change http --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ecb626c..a8154b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -105,7 +105,7 @@ jobs: - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@v5 env: - WEBAPP_URI: https://${{ secrets.DEPLOY_HOST }}:80 + WEBAPP_URI: http://${{ secrets.DEPLOY_HOST }}:80 with: name: arquisoft/wiq_en3a/gatewayservice username: ${{ github.actor }} From 53abbe370a6be0ffe106ed031fc56e647b785635 Mon Sep 17 00:00:00 2001 From: sergiollende Date: Sun, 28 Apr 2024 23:45:37 +0200 Subject: [PATCH 09/13] Port 3000 again --- .github/workflows/release.yml | 2 +- docker-compose.yml | 2 +- webapp/Dockerfile | 2 +- webapp/package.json | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8154b5..1661dae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -105,7 +105,7 @@ jobs: - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@v5 env: - WEBAPP_URI: http://${{ secrets.DEPLOY_HOST }}:80 + WEBAPP_URI: http://${{ secrets.DEPLOY_HOST }}:3000 with: name: arquisoft/wiq_en3a/gatewayservice username: ${{ github.actor }} diff --git a/docker-compose.yml b/docker-compose.yml index 6a3667d..0d37a80 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -60,7 +60,7 @@ services: depends_on: - gatewayservice ports: - - "80:80" + - "3000:3000" prometheus: image: prom/prometheus diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 6afce78..e70d91b 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -8,7 +8,7 @@ RUN npm install ARG API_URI="http://localhost:8000" ENV REACT_APP_API_ENDPOINT=$API_URI -ENV PORT=80 +ENV PORT=3000 #Create an optimized version of the webapp RUN npm run build diff --git a/webapp/package.json b/webapp/package.json index 82f5410..d5c4cdb 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -33,11 +33,11 @@ "zustand": "^4.5.2" }, "scripts": { - "start": "set PORT=80 && set HTTP=true && react-scripts start", - "build": "set PORT=80 && set HTTP=true && react-scripts build", + "start": "set PORT=3000 && set HTTP=true && react-scripts start", + "build": "set PORT=3000 && set HTTP=true && react-scripts build", "prod": "serve -s build -l 3000", "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!axios)/'", - "test:e2e": "cross-env START_SERVER_AND_TEST_INSECURE=1 PORT=80 npm run rune2etests", + "test:e2e": "cross-env START_SERVER_AND_TEST_INSECURE=1 PORT=3000 npm run rune2etests", "rune2etests": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 3000 \"cd e2e && jest\"", "eject": "react-scripts eject" }, From 4c6d7a0849e873404906b35e275bf1e1e973827e Mon Sep 17 00:00:00 2001 From: sergiollende Date: Mon, 29 Apr 2024 00:29:17 +0200 Subject: [PATCH 10/13] more changes --- docker-compose.yml | 7 ++++++- webapp/Dockerfile | 1 - webapp/package.json | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0d37a80..34be453 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -56,7 +56,12 @@ services: container_name: webapp-${teamname:-defaultASW} image: ghcr.io/arquisoft/wiq_en3a/webapp:latest profiles: ["dev", "prod"] - build: ./webapp + build: + args: + REACT_APP_API_ENDPOINT: ${API_URI} + context: ./webapp + environment: + - REACT_APP_API_ENDPOINT=${API_URI} depends_on: - gatewayservice ports: diff --git a/webapp/Dockerfile b/webapp/Dockerfile index e70d91b..4865006 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -8,7 +8,6 @@ RUN npm install ARG API_URI="http://localhost:8000" ENV REACT_APP_API_ENDPOINT=$API_URI -ENV PORT=3000 #Create an optimized version of the webapp RUN npm run build diff --git a/webapp/package.json b/webapp/package.json index d5c4cdb..cb5ddbd 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -33,9 +33,9 @@ "zustand": "^4.5.2" }, "scripts": { - "start": "set PORT=3000 && set HTTP=true && react-scripts start", - "build": "set PORT=3000 && set HTTP=true && react-scripts build", - "prod": "serve -s build -l 3000", + "start": "set HTTP=true && react-scripts start", + "build": "set HTTP=true && react-scripts build", + "prod": "serve -s build", "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!axios)/'", "test:e2e": "cross-env START_SERVER_AND_TEST_INSECURE=1 PORT=3000 npm run rune2etests", "rune2etests": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 3000 \"cd e2e && jest\"", From b4b69719e501b6e0e1fe0b151bb8f43279cfa02a Mon Sep 17 00:00:00 2001 From: sergiollende Date: Mon, 29 Apr 2024 01:14:45 +0200 Subject: [PATCH 11/13] Back to another version --- .github/workflows/release.yml | 5 ++--- docker-compose.yml | 2 -- webapp/package.json | 7 +++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1661dae..802729e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -104,15 +104,12 @@ jobs: - uses: actions/checkout@v4 - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@v5 - env: - WEBAPP_URI: http://${{ secrets.DEPLOY_HOST }}:3000 with: name: arquisoft/wiq_en3a/gatewayservice username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io workdir: gatewayservice - buildargs: WEBAPP_URI deploy: name: Deploy over SSH @@ -121,6 +118,8 @@ jobs: steps: - name: Deploy over SSH uses: fifsky/ssh-action@master + env: + API_URI: ${{ secrets.DEPLOY_HOST }} with: host: ${{ secrets.DEPLOY_HOST }} user: ${{ secrets.DEPLOY_USER }} diff --git a/docker-compose.yml b/docker-compose.yml index 34be453..8f8fb95 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,8 +62,6 @@ services: context: ./webapp environment: - REACT_APP_API_ENDPOINT=${API_URI} - depends_on: - - gatewayservice ports: - "3000:3000" diff --git a/webapp/package.json b/webapp/package.json index cb5ddbd..4f6be51 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -33,12 +33,11 @@ "zustand": "^4.5.2" }, "scripts": { - "start": "set HTTP=true && react-scripts start", - "build": "set HTTP=true && react-scripts build", + "start": "react-scripts start", + "build": "react-scripts build", "prod": "serve -s build", "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!axios)/'", - "test:e2e": "cross-env START_SERVER_AND_TEST_INSECURE=1 PORT=3000 npm run rune2etests", - "rune2etests": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 3000 \"cd e2e && jest\"", + "test:e2e": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 3000 \"cd e2e && jest\"", "eject": "react-scripts eject" }, "eslintConfig": { From f3ecb3979e139a97509f7e149570f8fd6998b506 Mon Sep 17 00:00:00 2001 From: Pedro Limeres <113518495+plg22@users.noreply.github.com> Date: Mon, 29 Apr 2024 08:34:55 +0200 Subject: [PATCH 12/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5f4463..325d6af 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ # wiq_en3a Thank you for checking out wiq_en3a! Below are some useful links to get started: -- **[Application](http://51.103.210.249/)**: Click this link to start playing! +- **[Application](http://51.103.210.249:3000/)**: Click this link to start playing! - **[Documentation](https://arquisoft.github.io/wiq_en3a/)**: Explore detailed documentation to learn more about the game and its features. From d77c873543e4dc3ff1770b09b30a9bfc1f515cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Tru=C3=A9bano?= Date: Mon, 29 Apr 2024 13:01:34 +0200 Subject: [PATCH 13/13] Updating documentation --- docs/src/01_introduction_and_goals.adoc | 12 +- docs/src/02_architecture_constraints.adoc | 6 + docs/src/03_system_scope_and_context.adoc | 6 +- docs/src/06_runtime_view.adoc | 5 +- docs/src/07_deployment_view.adoc | 181 +++++++++++----------- docs/src/08_concepts.adoc | 8 +- docs/src/09_architecture_decisions.adoc | 1 + docs/src/10_quality_requirements.adoc | 9 +- 8 files changed, 118 insertions(+), 110 deletions(-) diff --git a/docs/src/01_introduction_and_goals.adoc b/docs/src/01_introduction_and_goals.adoc index c179f5b..5a1d871 100644 --- a/docs/src/01_introduction_and_goals.adoc +++ b/docs/src/01_introduction_and_goals.adoc @@ -64,6 +64,10 @@ See https://docs.arc42.org/section-1/[Introduction and Goals] in the arc42 docum | Reliability | Ensure consistent and accurate question generation and user data management. | Performance | Optimize system response times and capacity to handle multiple user interactions simultaneously. | Security | Implement robust security measures to protect user data and prevent unauthorized access. +| Usability | Provide an intuitive and user-friendly interface to enhance user experience. +| Portability | Enable seamless deployment and operation across different environments and platforms. +| Testability | Facilitate comprehensive testing to ensure software correctness and identify potential issues early. +| Availability | Ensure system uptime and accessibility to meet user demands and minimize downtime. |=== @@ -109,15 +113,15 @@ These stakeholders determine the extent and the level of detail of your work and Table with role names, person names, and their expectations with respect to the architecture and its documentation. **** -[options="header",cols="1,2,2"] +[options="header",cols="1,3,2"] |=== | Role/Name | Contact | Expectations | Users | N/A | Intuitive and enjoyable quiz experience -| Professors | Pablo Gonzalez, Jose Labra | The well-designed web application that fulfills the requirements -| RTVE | Project Manager | Reliable and engaging platform for users -| HappySw Team | Development Team | Clear documentation and reliable system performance +| Professors | Pablo González (gonzalezgpablo@uniovi.es), Jose Emilio Labra (labra@uniovi.es) | The well-designed web application that fulfills the requirements +| RTVE | www.rtve.es | Reliable and engaging platform for users +| Development | Sergio Truébano Robles (uo289930@uniovi.es), Pedro Limeres Granado (uo282763@uniovi.es), Alberto Guerra Rodas (uo282421@uniovi.es), Ángel Macías Rodríguez (uo289362@uniovi.es), Rita Fernández-Catuxo Ortiz (uo284185@uniovi.es), Vira Terletska (uo305097@uniovi.es), Sergio Llenderrozos Piñera (uo283367@uniovi.es) | Clear documentation and reliable, performant and available system |=== diff --git a/docs/src/02_architecture_constraints.adoc b/docs/src/02_architecture_constraints.adoc index 7ba8dea..c55f5a9 100644 --- a/docs/src/02_architecture_constraints.adoc +++ b/docs/src/02_architecture_constraints.adoc @@ -6,6 +6,8 @@ ifndef::imagesdir[:imagesdir: ../images] When designing the WIQ application, there are several constraints that must be taken into consideration, as they will have a significant impact on the overall design of the application and the architectural decisions. These constraints must be considered in order to ensure that the final product meets the needs and expectations of the users and stakeholders. The following table summarizes these constraints and provides a brief explanation for each one divided into technical, organizational and political constraints. === Technical constraints + +[options="header"] |=== |Constraint|Explanation | WikiData | Our application must generate questions automatically getting data from WikiData @@ -15,6 +17,8 @@ When designing the WIQ application, there are several constraints that must be t |=== === Organizational constraints + +[options="header"] |=== |Constraint|Explanation | Team | The project will be done in a team composed of 7 students, so work must be assigned accordingly. @@ -24,6 +28,8 @@ When designing the WIQ application, there are several constraints that must be t |=== === Political constraints + +[options="header"] |=== |Constraint|Explanation | Documentation | We are going to use AsciiDoc and follow the Arc42 template. diff --git a/docs/src/03_system_scope_and_context.adoc b/docs/src/03_system_scope_and_context.adoc index b583855..27c6ea7 100644 --- a/docs/src/03_system_scope_and_context.adoc +++ b/docs/src/03_system_scope_and_context.adoc @@ -50,7 +50,7 @@ The title of the table is the name of your system, the three columns contain the image::03_business_context.png["Business Context Diagram"] -[cols="1,1,1" options="header"] +[cols="1,1,1", options="header"] |=== | **Partner** | **Input** | **Output** | User | The user interacts with the WIQ web application using the front-end of the application. | The display of a page of the application with the questions and statistics. @@ -77,7 +77,7 @@ together with a mapping table showing the relationships between channels and inp **** .Table of the Technical Context -[cols="2,2"] +[cols="2,2", options="header"] |=== | **Component** | **Technologies Used** | Front-end | HTML, CSS (Tailwind), JavaScript (React) @@ -93,7 +93,7 @@ image::3_2-Technical-Context-Diagram-EN.png["Technical Context"] .Mapping Input/Output to Channels -[cols="2,2"] +[cols="2,2", options="header"] |=== | **Component** | **Functionality** | Front-end | User interaction and results display. diff --git a/docs/src/06_runtime_view.adoc b/docs/src/06_runtime_view.adoc index c595a83..3ac1997 100644 --- a/docs/src/06_runtime_view.adoc +++ b/docs/src/06_runtime_view.adoc @@ -55,11 +55,12 @@ collections FrontEnd collections WikidataService database Wikidata -User -> FrontEnd: Start Game -FrontEnd -> WikidataService: "/GetQuestions" + WikidataService-> Wikidata: Sparql query Wikidata-> WikidataService : entitites data WikidataService-> WikidataService: createQuestions() +User -> FrontEnd: Start Game +FrontEnd -> WikidataService: "/GetQuestions" WikidataService-> FrontEnd: Send 10 questions FrontEnd -> User: Question 1 User-> FrontEnd: Answer 1 diff --git a/docs/src/07_deployment_view.adoc b/docs/src/07_deployment_view.adoc index 1a7664a..6b0de86 100644 --- a/docs/src/07_deployment_view.adoc +++ b/docs/src/07_deployment_view.adoc @@ -5,6 +5,44 @@ ifndef::imagesdir[:imagesdir: ../images] == Deployment View +[role="arc42help"] +**** +.Content +The deployment view describes: + + 1. technical infrastructure used to execute your system, with infrastructure elements like geographical locations, environments, computers, processors, channels and net topologies as well as other infrastructure elements and + +2. mapping of (software) building blocks to that infrastructure elements. + +Often systems are executed in different environments, e.g. development environment, test environment, production environment. In such cases you should document all relevant environments. + +Especially document a deployment view if your software is executed as distributed system with more than one computer, processor, server or container or when you design and construct your own hardware processors and chips. + +From a software perspective it is sufficient to capture only those elements of an infrastructure that are needed to show a deployment of your building blocks. Hardware architects can go beyond that and describe an infrastructure to any level of detail they need to capture. + +.Motivation +Software does not run without hardware. +This underlying infrastructure can and will influence a system and/or some +cross-cutting concepts. Therefore, there is a need to know the infrastructure. + +.Form + +Maybe a highest level deployment diagram is already contained in section 3.2. as +technical context with your own infrastructure as ONE black box. In this section one can +zoom into this black box using additional deployment diagrams: + +* UML offers deployment diagrams to express that view. Use it, probably with nested diagrams, +when your infrastructure is more complex. +* When your (hardware) stakeholders prefer other kinds of diagrams rather than a deployment diagram, let them use any kind that is able to show nodes and channels of the infrastructure. + + +.Further Information + +See https://docs.arc42.org/section-7/[Deployment View] in the arc42 documentation. + +**** + + Our project is configurated using GitHub actions in such a way that every release that is made will trigger some unitary and end to end test, and an attempt to deploy the application over a server. This will allow our team to achieve continuous deployment and delivery. @@ -130,6 +168,10 @@ frame Azure { } } +cloud WikidataDB{ + +} + frame GitHub{ frame GitHubActions{ @@ -145,9 +187,10 @@ frame GitHub{ WebAPP -- APIGateway : port 8000 Wikidata -- WikidataAPI: port 8001 +WikidataAPI -- WikidataDB: query.wikidata.org/sparql Users -- UsersAPI : port 8003 UsersAPI -- UsersDatabase : MongoDB (port 27017) -client -- WebAPP : Web Browser (port 80) +client -- WebAPP : Web Browser (port 3000) GitHubActions -- UbuntuServer : on release Docker -- wiq_en3a @@ -156,93 +199,6 @@ Docker -- wiq_en3a === Infrastructure Level 1 - Azure Ubuntu Server -The Ubuntu server allows us to have a isolated machine with the minimal required configuration and installations for running our services. -Having our server on Azure, allows us to minimize the costs of having that machine running, as well as to avoid taking care of some responsabilities such as security, availability or maintainance. - - -=== Infrastructure Level 2 - Docker - -Instead of having a virtual machine for running the whole application by itself, the application is splitted into different services that can be completely isolated. -Docker allows us to create containers with the minimum amount of resources needed for running that specific service, such that resources are not wasted and services that could be more used do not collapse others. Each container contains the specific docker image for running the specific service. -Each implemented service will be isolated at deploy time, so there is no need of making the services at the same programming language or following the same architectural patterns, and responses will be responded through different independent endpoints. - -The virtual machine will contain as many containers as services in the application. - -For now, the project contains: -** Web application service running on port 3000 -** Gateway (middleware) service running on port 8000 -** Wikidata API running on port 8001 -** Users API running on port 8003 -** Mongo DB server running on port 27017 -** Prometheus running on port 9090 for monitoring -** Grafana running on port 9091 for analytics and monitoring - - -=== Infrastructure Level 3 - GitHub actions - -GitHub actions will provide us with continuous automatic delivery and integration, automating the deployment phase at each release. - -=== Motivation - -In the deployment view of our software architecture, we delineate the physical deployment of our system components across various environments. -At the core of our deployment strategy is the utilization of cloud-based infrastructure, specifically leveraging Azure for its robustness and scalability. -Our server components, including web applications, gateway, user services, and MongoDB servers, are encapsulated within Docker containers to ensure portability and consistency across deployments. -Additionally, we employ Azure's built-in services for auto-scaling, and traffic management to optimize performance and reliability. -Continuous integration and deployment pipelines are established using tools like Jenkins or Azure DevOps, facilitating seamless updates and releases of our system components. -Monitoring and logging solutions, such as Prometheus and Grafana, are integrated to provide insights into system health and performance. -Overall, our deployment view showcases a resilient, scalable, and automated deployment architecture tailored to meet the demands of our system's evolving requirements. - -=== Mapping of Building Blocks into Infrastructure - -[cols="1,2" options="header"] -|=== -| **Name** | **Responsibility** -| Frontend | Web App container opened in port 80. -| User Management | User service container. -| Wikidata Service | Wikidata service container. -| Gateway | API Gateway service opened in port 8000. -|=== - - -[role="arc42help"] -**** -.Content -The deployment view describes: - - 1. technical infrastructure used to execute your system, with infrastructure elements like geographical locations, environments, computers, processors, channels and net topologies as well as other infrastructure elements and - -2. mapping of (software) building blocks to that infrastructure elements. - -Often systems are executed in different environments, e.g. development environment, test environment, production environment. In such cases you should document all relevant environments. - -Especially document a deployment view if your software is executed as distributed system with more than one computer, processor, server or container or when you design and construct your own hardware processors and chips. - -From a software perspective it is sufficient to capture only those elements of an infrastructure that are needed to show a deployment of your building blocks. Hardware architects can go beyond that and describe an infrastructure to any level of detail they need to capture. - -.Motivation -Software does not run without hardware. -This underlying infrastructure can and will influence a system and/or some -cross-cutting concepts. Therefore, there is a need to know the infrastructure. - -.Form - -Maybe a highest level deployment diagram is already contained in section 3.2. as -technical context with your own infrastructure as ONE black box. In this section one can -zoom into this black box using additional deployment diagrams: - -* UML offers deployment diagrams to express that view. Use it, probably with nested diagrams, -when your infrastructure is more complex. -* When your (hardware) stakeholders prefer other kinds of diagrams rather than a deployment diagram, let them use any kind that is able to show nodes and channels of the infrastructure. - - -.Further Information - -See https://docs.arc42.org/section-7/[Deployment View] in the arc42 documentation. - -**** - -=== Infrastructure Level 1 - [role="arc42help"] **** Describe (usually in a combination of diagrams, tables, and text): @@ -253,7 +209,6 @@ Describe (usually in a combination of diagrams, tables, and text): * mapping of software artifacts to elements of this infrastructure For multiple environments or alternative deployments please copy and adapt this section of arc42 for all relevant environments. -**** _****_ @@ -267,16 +222,20 @@ __ Mapping of Building Blocks to Infrastructure:: __ +**** +The Ubuntu server allows us to have a isolated machine with the minimal required configuration and installations for running our services. +Having our server on Azure, allows us to minimize the costs of having that machine running, as well as to avoid taking care of some responsabilities such as security, availability or maintainance. -=== Infrastructure Level 2 + +=== Infrastructure Level 2 - Docker [role="arc42help"] **** Here you can include the internal structure of (some) infrastructure elements from level 1. Please copy the structure from level 1 for each selected element. -**** + ==== __ @@ -291,5 +250,45 @@ __ ==== __ __ +**** + +Instead of having a virtual machine for running the whole application by itself, the application is splitted into different services that can be completely isolated. +Docker allows us to create containers with the minimum amount of resources needed for running that specific service, such that resources are not wasted and services that could be more used do not collapse others. Each container contains the specific docker image for running the specific service. +Each implemented service will be isolated at deploy time, so there is no need of making the services at the same programming language or following the same architectural patterns, and responses will be responded through different independent endpoints. + +The virtual machine will contain as many containers as services in the application. + +For now, the project contains: +** Web application service running on port 3000 +** Gateway (middleware) service running on port 8000 +** Wikidata API running on port 8001 +** Users API running on port 8003 +** Mongo DB server running on port 27017 +** Prometheus running on port 9090 for monitoring +** Grafana running on port 9091 for analytics and monitoring + +=== Infrastructure Level 3 - GitHub actions + +GitHub actions will provide us with continuous automatic delivery and integration, automating the deployment phase at each release. +=== Motivation + +In the deployment view of our software architecture, we delineate the physical deployment of our system components across various environments. +At the core of our deployment strategy is the utilization of cloud-based infrastructure, specifically leveraging Azure for its robustness and scalability. +Our server components, including web applications, gateway, user services, and MongoDB servers, are encapsulated within Docker containers to ensure portability and consistency across deployments. +Additionally, we employ Azure's built-in services for auto-scaling, and traffic management to optimize performance and reliability. +Continuous integration and deployment pipelines are established using tools like Jenkins or Azure DevOps, facilitating seamless updates and releases of our system components. +Monitoring and logging solutions, such as Prometheus and Grafana, are integrated to provide insights into system health and performance. +Overall, our deployment view showcases a resilient, scalable, and automated deployment architecture tailored to meet the demands of our system's evolving requirements. + +=== Mapping of Building Blocks into Infrastructure + +[cols="1,2" options="header"] +|=== +| **Name** | **Responsibility** +| Frontend | Web App container opened in port 3000. +| User Management | User service container. +| Wikidata Service | Wikidata service container. +| Gateway | API Gateway service opened in port 8000. +|=== \ No newline at end of file diff --git a/docs/src/08_concepts.adoc b/docs/src/08_concepts.adoc index 6794bf4..09fd3be 100644 --- a/docs/src/08_concepts.adoc +++ b/docs/src/08_concepts.adoc @@ -86,7 +86,7 @@ In our app, the question is always represent as a data structure with the next f We decided to use a color palette of 4 colors: -[cols="1,1"] +[cols="1,1", options="header"] |=== | Name | Color | Background | +++#191919+++ @@ -123,6 +123,8 @@ The application is deployed using Docker. The application will not have configurable features. An early idea was to include a "dark mode". Through the development we decided to postpone these ideas in order to focus on a better application in general. - -... +==== Data access +The development team has followed two different approaches for supporting data access from the running application for development and production. +While developing the application, teh development team decided to create a shared database located in the cloud which allowed us to work locally with the same data by means of a key string. +In order to move our application into production by means of deploying it into an Azure virtual machine running with Docker containers, the development team created a mongodb container with an associated volumen for making the data persistent. diff --git a/docs/src/09_architecture_decisions.adoc b/docs/src/09_architecture_decisions.adoc index 77c6a0a..97dcabf 100644 --- a/docs/src/09_architecture_decisions.adoc +++ b/docs/src/09_architecture_decisions.adoc @@ -9,6 +9,7 @@ If you want a description about each of the technologies we have chosen, go to t The following table contains the most interesting the design decisions that we have taken with their advantages and disadvantages: .Architectural Records +[cols="1,1,2,2", options="header"] |=== |Code|Decision|Advantages|Disadvantages |ADR1| React.js | Quite easy to learn in comparison to other front-end libraries. Increasingly popular in the web.| Not all of us know about its usage diff --git a/docs/src/10_quality_requirements.adoc b/docs/src/10_quality_requirements.adoc index f6a48cd..9cb6f46 100644 --- a/docs/src/10_quality_requirements.adoc +++ b/docs/src/10_quality_requirements.adoc @@ -76,7 +76,7 @@ Tabular or free form text. *Usage scenarios* -[options="header", cols="1,1,1,1"] +[options="header", cols="1,2,2,2"] |=== | Quality goal | Motivation | Usage scenario | Priority @@ -120,7 +120,7 @@ Tabular or free form text. *Change scenarios* -[options="header", cols="1,1,1,1"] +[options="header", cols="1,2,2,2"] |=== | Quality goal | Motivation | Change scenario | Priority | *Maintainability* @@ -128,9 +128,4 @@ Tabular or free form text. | When developers must introduce a new feature to the web, they should be able to do it without changing the software architecture. | High -| *Maintainability* -| An application should be maintainable to remain usable over the years and to be able to improve functionalities and to fix misfunctionalities. -| When fixing errors and bugs on the system, developers should be able to do it without major consequences on the system. -| High - |=== \ No newline at end of file