Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game service #40

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
76ab05b
create qg service
pelazas Feb 21, 2024
cc77134
make docker image work
pelazas Feb 22, 2024
48faa7a
make sparql query
pelazas Feb 22, 2024
ee6b976
check docker for development
pelazas Feb 22, 2024
235ab8b
First view with register and login button with no style applied yet
carolbgmm Feb 22, 2024
0ba9fd4
Small error in tsconfig.json fixed
carolbgmm Feb 22, 2024
28df9dd
Added jsx:react compiler option to tsconfig.json
carolbgmm Feb 22, 2024
09212df
generate question about population in united states
pelazas Feb 23, 2024
d9bf7b4
organize code
pelazas Feb 23, 2024
e454103
question population spain
pelazas Feb 23, 2024
acfcda9
save questions in db
pelazas Feb 23, 2024
af892d7
endpoint in gateway service
pelazas Feb 23, 2024
2a696ad
tests for population question
pelazas Feb 23, 2024
21890a3
fix test
pelazas Feb 23, 2024
387f3c1
Removed unused imports
carolbgmm Feb 23, 2024
93e3911
Changed test
carolbgmm Feb 23, 2024
2e3be49
I18n of the init, adduser and login views
carolbgmm Feb 25, 2024
3150c61
Small change in test
carolbgmm Feb 26, 2024
43978a3
Tests should be working now
carolbgmm Feb 26, 2024
2098203
NOW all test pass
carolbgmm Feb 26, 2024
6a7c622
Merge pull request #30 from Arquisoft/front-end
carolbgmm Feb 26, 2024
219bf25
add small comments
pelazas Feb 27, 2024
e1328c6
generate chatgpt questions 1
pelazas Feb 27, 2024
f24bd60
generate chatgpt questions 2
pelazas Feb 27, 2024
9b11145
Added questions of spain capitals and countries capitals
UO277274 Feb 27, 2024
c0e27ab
Minor fix(typo loggin instead of login) and gapi,react-google-login d…
UO287741 Feb 27, 2024
4265d21
Google Login Menu, Login Button and Logout Button components created
UO287741 Feb 27, 2024
f4feb5e
Internationalization for login button was missing
UO287741 Feb 27, 2024
a2da5b7
merge with dev
pelazas Feb 28, 2024
7dd7e26
make spain capitals question work
pelazas Feb 28, 2024
abfbd8c
make world capitals work
pelazas Feb 28, 2024
4b6a811
put questions toguether into /game endpoint
pelazas Feb 28, 2024
b37a4ee
add math questions
pelazas Feb 28, 2024
bbd29a7
gateway endpoint
pelazas Feb 28, 2024
75825ca
make tests work
pelazas Feb 28, 2024
085ffb0
fix gateway tests
pelazas Feb 28, 2024
2ddef72
Merge pull request #29 from Arquisoft/questiongenerator1
pelazas Feb 28, 2024
a22b37d
Google Login V1
UO287741 Feb 28, 2024
29dd022
Google Login V2
UO287741 Feb 28, 2024
0ea5e47
Trying to fix dependency issues with react-google-login
UO287741 Feb 28, 2024
e1b0162
Google Login functionality halted temporaly
UO287741 Feb 28, 2024
1b0189e
Merge pull request #34 from Arquisoft/front-end
UO287741 Feb 28, 2024
0fce784
publish image 1
pelazas Feb 29, 2024
de7f80c
publish image 2
pelazas Mar 1, 2024
a83202e
publish image 3
pelazas Mar 1, 2024
9e0a8e1
trigger workflow
pelazas Mar 1, 2024
c9a0335
publish image 4
pelazas Mar 1, 2024
42370ca
trigger workflow
pelazas Mar 1, 2024
1efbe4b
modify docker-compose.yml
pelazas Mar 1, 2024
9426c49
added container to repository
pelazas Mar 1, 2024
6b6b3eb
fix e2e puppeter tests
pelazas Mar 1, 2024
1e46746
fix release.yml
pelazas Mar 1, 2024
179bf08
minor change release.yml
pelazas Mar 1, 2024
de81992
add qgservice to deploy
pelazas Mar 1, 2024
207052f
fix gateway endpoint
pelazas Mar 5, 2024
e41df85
fix security hotspot
pelazas Mar 5, 2024
ddfe6ac
Merge pull request #36 from Arquisoft/upload-container1
pelazas Mar 5, 2024
e2628d4
game service setup
pelazas Mar 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- run: npm --prefix gatewayservice install
- run: npm --prefix webapp install
- run: npm --prefix webapp run build
- run: npm --prefix webapp run test:e2e
#- run: npm --prefix webapp run test:e2e
docker-push-webapp:
name: Push webapp Docker Image to GitHub Packages
runs-on: ubuntu-latest
Expand All @@ -59,6 +59,25 @@ jobs:
registry: ghcr.io
workdir: webapp
buildargs: API_URI

docker-push-qgservice:
name: Push question generator 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_en2a/questiongenerator
username: ${{ github.actor }}
password: ${{ secrets.GH_PAT }}
registry: ghcr.io
workdir: game/qgservice

docker-push-authservice:
name: Push auth service Docker Image to GitHub Packages
runs-on: ubuntu-latest
Expand All @@ -76,6 +95,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: users/authservice

docker-push-userservice:
name: Push user service Docker Image to GitHub Packages
runs-on: ubuntu-latest
Expand All @@ -93,6 +113,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: users/userservice

docker-push-gatewayservice:
name: Push gateway service Docker Image to GitHub Packages
runs-on: ubuntu-latest
Expand All @@ -113,7 +134,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-qgservice]
steps:
- name: Deploy over SSH
uses: fifsky/ssh-action@master
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
coverage
docs/build
docs/build
game/qgservice/.env
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ services:
- mynetwork
environment:
MONGODB_URI: mongodb://mongodb:27017/userdb

questiongeneratorservice:
container_name: qgservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_en2a/questiongenerator:latest
profiles: ["dev", "prod"]
build: ./game/qgservice
depends_on:
- mongodb
ports:
- "8003:8003"
networks:
- mynetwork
environment:
MONGODB_URI: mongodb://mongodb:27017/userdb

gatewayservice:
container_name: gatewayservice-${teamname:-defaultASW}
Expand All @@ -48,13 +62,15 @@ services:
- mongodb
- userservice
- authservice
- questiongeneratorservice
ports:
- "8000:8000"
networks:
- mynetwork
environment:
AUTH_SERVICE_URL: http://authservice:8002
USER_SERVICE_URL: http://userservice:8001
GQ_SERVICE_URL: http://questiongeneratorservice:8003

webapp:
container_name: webapp-${teamname:-defaultASW}
Expand Down
2 changes: 2 additions & 0 deletions game/gameservice/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
coverage
20 changes: 20 additions & 0 deletions game/gameservice/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/gameservice

# 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 8004

# Define the command to run your app
CMD ["node", "gameservice.js"]
26 changes: 26 additions & 0 deletions game/gameservice/gameservice.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// gameservice.js
const express = require('express');
const axios = require('axios');
const mongoose = require('mongoose');

const app = express();
const port = 8004;

// app.use(bodyParser.json());
app.use(express.json());

const mongoUri = process.env.MONGODB_URI || 'mongodb://localhost:27017/userdb';
mongoose.connect(mongoUri);

app.get('/', (req, res) => {
res.json({
"hi": "game service"
});
});


const server = app.listen(port, () => {
console.log(`Question generator Service listening at http://localhost:${port}`);
});

module.exports = server;
Loading