From bd8e555e6e99bf0d95b07e114991b52117a236ff Mon Sep 17 00:00:00 2001 From: uo288231 Date: Tue, 13 Feb 2024 21:33:05 +0100 Subject: [PATCH 01/18] Fixing conflicts --- docs/src/11_technical_risks.adoc | 42 +++++++------------------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/docs/src/11_technical_risks.adoc b/docs/src/11_technical_risks.adoc index cf70ec66..319aea3e 100644 --- a/docs/src/11_technical_risks.adoc +++ b/docs/src/11_technical_risks.adoc @@ -2,37 +2,13 @@ ifndef::imagesdir[:imagesdir: ../images] [[section-technical-risks]] == Risks and Technical Debts - -JavaScript: A dynamic, weakly typed language that can have bugs and problems. -ReactJS: A framework for creating user interfaces, but with difficulties and challenges. A high learning curve is required - -NodeJS: An environment for running JavaScript on the server, but with limitations and risks. - -MongoDB: A NoSQL database that offers scalability, flexibility, and performance, but with trade-offs and challenges. It does not support transactions, joins, or schemas, which can affect the consistency, integrity, and reliability of the data. It has a different language and data model than SQL databases, which implies a paradigm shift. - -Docker: A platform for building and running applications in isolated containers, but with drawbacks and risks. It can increase the complexity and cost of deploying and handling your applications as you need additional tools and configurations. - -The wikidata api, since it is the first time we use it and we will have to learn how to use it to create questions and also learn how to generate templates for those questions - -Communication and group work can be complicated at times, so you should always try to maintain a good working atmosphere with the whole team - -[role="arc42help"] -**** -.Contents -A list of identified technical risks or technical debts, ordered by priority - -.Motivation -“Risk management is project management for grown-ups” (Tim Lister, Atlantic Systems Guild.) - -This should be your motto for systematic detection and evaluation of risks and technical debts in the architecture, which will be needed by management stakeholders (e.g. project managers, product owners) as part of the overall risk analysis and measurement planning. - -.Form -List of risks and/or technical debts, probably including suggested measures to minimize, mitigate or avoid risks or reduce technical debts. - - -.Further Information - -See https://docs.arc42.org/section-11/[Risks and Technical Debt] in the arc42 documentation. - -**** +[options="header"] +|=== +| Priority | Description of Risk/Technical Debt | Suggested Measures +| High | Vulnerabilities in user authentication | Implement additional security measures, such as password encryption +| High | Potential application malfunctions | Implement unit tests for key components and critical functions, along with extensive testing with real users +| Medium | Slow performance of database queries | Optimize database queries, avoid unnecessary queries +| Low | Unoptimized styles | Optimize CSS styles to improve application performance and loading times +| Low | Insufficient documentation | Provide comprehensive documentation of architecture, code structure, development processes, and deployment to facilitate team maintenance and collaboration +|=== From 40588e0c8d458b00ca36cf47b7179bdf6e85bc42 Mon Sep 17 00:00:00 2001 From: iyanfdezz Date: Sat, 17 Feb 2024 15:16:37 +0100 Subject: [PATCH 02/18] Error fixed --- docs/src/10_quality_requirements.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/10_quality_requirements.adoc b/docs/src/10_quality_requirements.adoc index e978d021..20816780 100644 --- a/docs/src/10_quality_requirements.adoc +++ b/docs/src/10_quality_requirements.adoc @@ -51,4 +51,5 @@ These are: | Security / Maintainability | Developers | We want to add the option of logging in with an e-mail instead of an username | Login system is well structured so it is easy to modify it or add new ways of logging in | Normal conditions | The development team implements the new login method easily, ensuring that neither the current data or the new credentials will be compromised | Successful integration of the new login method without compromising data | Security | Developers | The decision is made to transition from MongoDB to another database system | User data migration to a new database system is secured | Database migration phase | The system initiates a secure data migration process, ensuring all user data, including usernames and passwords, is transferred to the new database system intact and encrypted | Successful transfer of user data without compromise | Maintainability | Developers | Developers want to add a new game mode | The game's code is well-structured and documented | Development phase | Due to code being well-structured and documented, it is easy to add new functionality to our system without risking our already implemented functionality | Successful addition of new game mode -| Maintainability | Developers | An error is identified in the game that needs to be corrected. | The game's code is well-structured and documented | Error identification and resolution phase | Due to code being well-structured and documented, developers can easily locate the error and correct it | Successful identification and correction of the error \ No newline at end of file +| Maintainability | Developers | An error is identified in the game that needs to be corrected. | The game's code is well-structured and documented | Error identification and resolution phase | Due to code being well-structured and documented, developers can easily locate the error and correct it | Successful identification and correction of the error +|=== \ No newline at end of file From ecf561a127938060b412125adf398c273d9c6a2a Mon Sep 17 00:00:00 2001 From: uo288231 Date: Sat, 17 Feb 2024 15:21:39 +0100 Subject: [PATCH 03/18] Fixing format --- docs/src/10_quality_requirements.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/10_quality_requirements.adoc b/docs/src/10_quality_requirements.adoc index e978d021..2ed9015e 100644 --- a/docs/src/10_quality_requirements.adoc +++ b/docs/src/10_quality_requirements.adoc @@ -31,7 +31,7 @@ These are: === Quality Scenarios -### Usage Scenarios +#### Usage Scenarios [options="header"] |=== @@ -43,7 +43,7 @@ These are: |=== -### Change Scenarios +#### Change Scenarios [options="header"] |=== From f4add29f918e6953dc598cd3f2e5885dcd743ee6 Mon Sep 17 00:00:00 2001 From: uo288231 Date: Mon, 19 Feb 2024 22:47:11 +0100 Subject: [PATCH 04/18] Really basic prototype to calculate user stats --- stats/partidas.js | 35 +++++++++++++++++++++++++++++++++++ stats/stats-getter.js | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 stats/partidas.js create mode 100644 stats/stats-getter.js diff --git a/stats/partidas.js b/stats/partidas.js new file mode 100644 index 00000000..8c8c418b --- /dev/null +++ b/stats/partidas.js @@ -0,0 +1,35 @@ +// SAMPLE DATA +const partidas=[ + { + username: "vagrant", + points: 200, + nQuestions: 10 + }, + { + username: "vagrant", + points: 400, + nQuestions: 20 + }, + { + username: "jose123", + points: 200, + nQuestions: 10 + }, + { + username: "vagrant", + points: 1000, + nQuestions: 50 + }, + { + username: "rober200", + points: 100, + nQuestions: 5 + }, + { + username: "jose123", + points: 40, + nQuestions: 2 + } +] + +export default partidas; \ No newline at end of file diff --git a/stats/stats-getter.js b/stats/stats-getter.js new file mode 100644 index 00000000..2d508353 --- /dev/null +++ b/stats/stats-getter.js @@ -0,0 +1,40 @@ +import partidas from './partidas.js'; + +class StatsForUser { + + nGamesPlayed = 0; + avgPoints = 0; + maxPoints = 0; + minPoints = 10000; + totalPoints = 0; + nQuestionsAnswered = 0; + questionsPerGame = 0; + + + constructor(username){ + this.username = username; + //si existe el usuario (IMPLEMENTAR COMPROBACION) + this.getStatsForUser(); + } + + getStatsForUser(){ + for (const partida of partidas){ + if (partida.username === this.username){ + this.nGamesPlayed++; + this.totalPoints += partida.points; + this.nQuestionsAnswered += partida.nQuestions; + if (partida.points > this.maxPoints){ + this.maxPoints = partida.points; + } + if (partida.points < this.minPoints){ + this.minPoints = partida.points; + } + } + } + + this.avgPoints = this.totalPoints / this.nGamesPlayed; + this.questionsPerGame = this.nQuestionsAnswered / this.nGamesPlayed; + } +} + +export default StatsForUser; \ No newline at end of file From 8e861fc71a55dccf72c3893e666bef5ee96b693f Mon Sep 17 00:00:00 2001 From: CANCI0 Date: Tue, 20 Feb 2024 19:30:02 +0100 Subject: [PATCH 05/18] =?UTF-8?q?Interfaz=20b=C3=A1sica?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/src/App.js | 47 ++++++++++++++--------------------- webapp/src/pages/Home/Home.js | 4 +-- 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/webapp/src/App.js b/webapp/src/App.js index c382f9b6..48ddd286 100644 --- a/webapp/src/App.js +++ b/webapp/src/App.js @@ -1,37 +1,26 @@ import React, { useState } from 'react'; -import Register from './components/Register/Register'; -import Login from './components/Login/Login'; -import CssBaseline from '@mui/material/CssBaseline'; -import Container from '@mui/material/Container'; -import Typography from '@mui/material/Typography'; -import Link from '@mui/material/Link'; +import Authenticate from './pages/Authenticate/Authenticate.js'; +import Home from './pages/Home/Home.js'; +import Clasico from './pages/Clasico/Clasico.js'; +import WrongRoute from './pages/WrongRoute/WrongRoute.js'; +import './App.css'; + +import {BrowserRouter, Routes, Route} from "react-router-dom"; function App() { - const [showLogin, setShowLogin] = useState(true); + return ( + + + {/** Rutas públicas */} + }/> - const handleToggleView = () => { - setShowLogin(!showLogin); - }; + {/** Rutas privadas */} + } /> + } /> - return ( - - - - Welcome to wiq_es1a - - {showLogin ? : } - - {showLogin ? ( - - Don't have an account? Register here. - - ) : ( - - Already have an account? Login here. - - )} - - + } /> + + ); } diff --git a/webapp/src/pages/Home/Home.js b/webapp/src/pages/Home/Home.js index 679d192e..11c4c312 100644 --- a/webapp/src/pages/Home/Home.js +++ b/webapp/src/pages/Home/Home.js @@ -3,16 +3,14 @@ import "./Home.css"; import Nav from '../../components/Nav/Nav.js'; import Footer from '../../components/Footer/Footer.js'; import { Link } from "react-router-dom"; -import useAuthUser from 'react-auth-kit/hooks/useAuthUser'; const Home = () => { - const auth = useAuthUser() return ( <>