Skip to content

Commit

Permalink
Merge branch 'develop' into Generación-de-preguntasV2-#2
Browse files Browse the repository at this point in the history
  • Loading branch information
CANCI0 authored Mar 4, 2024
2 parents 5a58f9d + 40364c7 commit a808bde
Show file tree
Hide file tree
Showing 29 changed files with 1,938 additions and 129 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
- run: npm --prefix users/authservice ci
- run: npm --prefix users/userservice ci
- run: npm --prefix gatewayservice ci
- run: npm --prefix questionservice ci
- run: npm --prefix statsservice ci
- run: npm --prefix webapp ci
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
Expand Down
39 changes: 38 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ jobs:
- run: npm --prefix users/userservice ci
- run: npm --prefix gatewayservice ci
- run: npm --prefix webapp ci
- run: npm --prefix questionservice ci
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
- run: npm --prefix gatewayservice test -- --coverage
- run: npm --prefix webapp test -- --coverage
- run: npm --prefix questionservice test -- --coverage
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
Expand All @@ -37,6 +39,7 @@ jobs:
- run: npm --prefix users/authservice install
- run: npm --prefix users/userservice install
- run: npm --prefix gatewayservice install
- run: npm --prefix questionservice install
- run: npm --prefix webapp install
- run: npm --prefix webapp run build
- run: npm --prefix webapp run test:e2e
Expand Down Expand Up @@ -94,6 +97,40 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: users/userservice
docker-push-statsservice:
name: Push stats service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es1a/statsservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: statsservice
docker-push-questionservice:
name: Push questions service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es1a/questionservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: questionservice
docker-push-gatewayservice:
name: Push gateway service Docker Image to GitHub Packages
runs-on: ubuntu-latest
Expand All @@ -114,7 +151,7 @@ jobs:
deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp]
needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp,docker-push-questionservice, docker-push-statsservice]
steps:
- name: Deploy over SSH
uses: fifsky/ssh-action@master
Expand Down
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,30 @@ services:
networks:
- mynetwork

questionservice:
container_name: questionservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_es1a/questionservice:latest
profiles: ["dev", "prod"]
build: ./questionservice
ports:
- "8003:8003"
networks:
- mynetwork

statsservice:
container_name: statsservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_es1a/statsservice:latest
profiles: ["dev", "prod"]
build: ./statsservice
depends_on:
- mongodb
ports:
- "8004:8004"
networks:
- mynetwork
environment:
MONGODB_URI: mongodb://mongodb:27017/userdb

authservice:
container_name: authservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_es1a/authservice:latest
Expand Down Expand Up @@ -46,13 +70,17 @@ services:
build: ./gatewayservice
depends_on:
- mongodb
- statsservice
- userservice
- authservice
- questionservice
ports:
- "8000:8000"
networks:
- mynetwork
environment:
STATS_SERVICE_URL: http://questionservice:8004
QUESTION_SERVICE_URL: http://questionservice:8003
AUTH_SERVICE_URL: http://authservice:8002
USER_SERVICE_URL: http://userservice:8001

Expand Down
7 changes: 4 additions & 3 deletions docs/src/10_quality_requirements.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ These are:

=== Quality Scenarios

### Usage Scenarios
#### Usage Scenarios

[options="header"]
|===
Expand All @@ -43,12 +43,13 @@ These are:
|===


### Change Scenarios
#### Change Scenarios

[options="header"]
|===
| Aspect | Source | Stimulus | Artefact | Environment | Response | Response Measurement
| 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
| 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
|===
42 changes: 9 additions & 33 deletions docs/src/11_technical_risks.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
|===
2 changes: 2 additions & 0 deletions questionservice/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
coverage
20 changes: 20 additions & 0 deletions questionservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use an official Node.js runtime as a parent image
FROM node:20

# Set the working directory in the container
WORKDIR /usr/src/questionservice

# Copy package.json and package-lock.json to the working directory
COPY package*.json ./

# Install app dependencies
RUN npm install

# Copy the app source code to the working directory
COPY . .

# Expose the port the app runs on
EXPOSE 8003

# Define the command to run your app
CMD ["node", "question-service.js"]
8 changes: 4 additions & 4 deletions questionservice/data/tematicas.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"paises": {
"entity": "Q6256",
"props": ["P36", "P35", "P1344", "P37", "P47", "P2250", "P571", "P122", "P1451", "P41"],
"types": ["str", "str", "str", "str", "str", "num", "date", "str", "str", "photo"],
"props": ["P36", "P35", "P1344", "P37", "P47", "P2250", "P571", "P122", "P1451"],
"types": ["str", "str", "str", "str", "str", "num", "date", "str", "str"],
"preguntas": [
"¿Cuál es la capital de ",
"¿Quién es el jefe de estado de ",
Expand All @@ -12,8 +12,8 @@
"¿Cuál es la esperanza de vida media de ",
"¿En qué fecha se fundó ",
"¿Cuál es la forma de gobierno de ",
"¿Cuál es el lema de ",
"¿Cuál es la bandera de "

"¿Cuál es el lema de "
]
},
"literatura": {
Expand Down
Loading

0 comments on commit a808bde

Please sign in to comment.