diff --git a/README.md b/README.md index 2316d34b..25a08a54 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,48 @@ # wiq_es6c +## Contributors +
+ +| Contributor | Contact | +| ------------- | ------------- | +| Liliana Suárez Díaz | | +| Marco Quintana García | | +| Abel Menéndez Hernández | | +| Marcos Barril Villaverde | | +| Alejandro García Mansilla | | + +
+ +## Links +- [WIQEII](http://158.179.212.42:3000) +- [User's API](http://158.179.212.42:8100) + - [/users](http://158.179.212.42:8100/users) -> Información de los usuarios + - [/history/questions](http://158.179.212.42:8100/history/questions) -> Información de las preguntas generadas + - [/usersStats](http://158.179.212.42:8100/usersStats) -> Información de las estadísticas de los usuarios + +## Code analisis + +
+ [![Deploy on release](https://github.com/Arquisoft/wiq_es6c/actions/workflows/release.yml/badge.svg)](https://github.com/Arquisoft/wiq_es6c/actions/workflows/release.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_wiq_es6c&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Arquisoft_wiq_es6c) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_wiq_es6c&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Arquisoft_wiq_es6c) -This is a base repo for the [Software Architecture course](http://arquisoft.github.io/) in [2023/2024 edition](https://arquisoft.github.io/course2324.html). +
-This repo is a basic application composed of several components. +## Components +This is a repo for the [Software Architecture course](http://arquisoft.github.io/) in [2023/2024 edition](https://arquisoft.github.io/course2324.html) composed of the following components. + +- **Game service**. - **Gateway service**. Express service that is exposed to the public and serves as a proxy to the two previous ones. +- **Question service**. +- **Store question service**. - **User service**. Express service that handles the insertion of new users in the system. - **Auth service**. Express service that handles the authentication of users. +- **User stats service**. - **Webapp**. React web application that uses the gateway service to allow basic login and new user features. -Both the user and auth service share a Mongo database that is accessed with mongoose. ## Quick start guide diff --git a/gatewayservice/gateway-service.js b/gatewayservice/gateway-service.js index 5dfcd8dd..d2338884 100644 --- a/gatewayservice/gateway-service.js +++ b/gatewayservice/gateway-service.js @@ -100,11 +100,11 @@ app.get('/questions', async (req, res) => { app.post('/storeGame', async (req, res) => { try { - var id = req.body.id - var username = req.body.username - var points = req.body.points - var questions = req.body.questions - var avgtime = req.body.avgtime + let id = req.body.id + let username = req.body.username + let points = req.body.points + let questions = req.body.questions + let avgtime = req.body.avgtime console.log("Hacemos la llamada al guardar preguntas") const post = await axios.post(gameService + `/storeGame`, {id, username, points, questions, avgtime}) console.log("Devuelve la llamada") @@ -131,7 +131,7 @@ const YAML = require('yaml') // Read the OpenAPI YAML file synchronously -openapiPath='./openapi.yaml' +let openapiPath='./openapi.yaml' if (fs.existsSync(openapiPath)) { const file = fs.readFileSync(openapiPath, 'utf8'); diff --git a/webapp/src/components/AddUser.js b/webapp/src/components/AddUser.js index 82d9fd15..7e6778a2 100644 --- a/webapp/src/components/AddUser.js +++ b/webapp/src/components/AddUser.js @@ -1,4 +1,3 @@ -// src/components/AddUser.js import React, { useState } from 'react'; import axios from 'axios'; import { Container, Typography, TextField, Snackbar } from '@mui/material'; diff --git a/webapp/src/components/FirstGame.js b/webapp/src/components/FirstGame.js index 0917daae..6cc81393 100644 --- a/webapp/src/components/FirstGame.js +++ b/webapp/src/components/FirstGame.js @@ -23,10 +23,7 @@ const Quiz = () => { let allQuestions = useLocation().state.questions; let haveEnter = false; let id = useLocation().state.gameId; - console.log(id) - // const [currentQuestionIndex, setCurrentQuestionIndex] = useState(storedInt); - // const [isCorrect, setIsCorrect] = useState(false); const [remTime, setRemTime] = useState(0); const [totalTime, setTotalTime] = useState(0); @@ -104,8 +101,7 @@ const Quiz = () => { } else { points = points += 100; } - - + // Pasar a la siguiente pregunta después de responder let indexAnswers = [allQuestions[currentQuestionIndex].options.indexOf(option), numberAnswer] @@ -148,7 +144,7 @@ const Quiz = () => {
-
+
{allQuestions[currentQuestionIndex].question} @@ -156,7 +152,7 @@ const Quiz = () => {
-
+
{allQuestions[currentQuestionIndex].options.map((option, index) => (
) )} diff --git a/webapp/src/components/game/GameConfiguration.test.js b/webapp/src/components/game/GameConfiguration.test.js index e27d5681..3b309d42 100644 --- a/webapp/src/components/game/GameConfiguration.test.js +++ b/webapp/src/components/game/GameConfiguration.test.js @@ -2,10 +2,9 @@ import { render, screen, fireEvent } from '@testing-library/react'; import { ContextFun } from '../Context'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; -import { BrowserRouter as Router, useLocation } from 'react-router-dom'; +import { BrowserRouter as Router } from 'react-router-dom'; import GameConfiguration from './GameConfiguration'; -//const request = require('supertest'); const mockAxios = new MockAdapter(axios); describe("Game Configuration", () => {