generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 132-add-a-forget-password-functionality
- Loading branch information
Showing
19 changed files
with
255 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,24 +4,32 @@ | |
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_wiq_en1b&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Arquisoft_wiq_en1b) | ||
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_wiq_en1b&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Arquisoft_wiq_en1b) | ||
|
||
This is a base repo for the [Software Architecture course](http://arquisoft.github.io/) in [2023/2024 edition](https://arquisoft.github.io/course2324.html). | ||
<b>To access the game simply follow the link [here](http://wiqen1b.serveminecraft.net:3000)</b><br> | ||
The documentation of the system can be found [here](https://arquisoft.github.io/wiq_en1b/)<br> | ||
And the API documentation can be seen [here](http://wiqen1b.serveminecraft.net:8000/api-doc/)<br> | ||
|
||
![wiq-icon-improved](https://github.com/Arquisoft/wiq_en1b/assets/124193979/cfa27b39-d039-4502-9299-da424cd04151) | ||
|
||
This repo is a basic application composed of several components. | ||
## Application components | ||
|
||
This repo is an application made from several components. | ||
|
||
- **Gateway service**. Express service that is exposed to the public and serves as a proxy to the two previous ones. | ||
- **User service**. Express service that handles the insertion of new users in the system. | ||
- **Auth service**. Express service that handles the authentication of users. | ||
- **Webapp**. React web application that uses the gateway service to allow basic login and new user features. | ||
- **Record service**. Express service that handles the game results of all the users and shows a ranking. | ||
- **Webapp**. React web application that uses the gateway service to allow users to play the game, in addition to registering, logging in, view the ranking and much more. | ||
- **Question generator**. Java application that generates questions from Wikidata which are later used in the game. | ||
- **Question service**. Express service that handles the database (MongoDB) and retrieves the previously generated question to be used in the game. | ||
|
||
Both the user and auth service share a Mongo database that is accessed with mongoose. | ||
Both the <i>User service</i> and <i>Auth service</i> share a Mongo database that is accessed with mongoose. The <i>Question generator</i> and <i>Question service</i> also share a MongoDB connection. | ||
|
||
## Quick start guide | ||
In order to deployed it locally you can check out the docker configuration below: | ||
|
||
### Using docker | ||
|
||
The fastest way for launching this sample project is using docker. Just clone the project: | ||
If you want to try it out by yourself, the fastest way for launching this project is using docker. Just clone the project: | ||
|
||
```sh | ||
git clone https://github.com/Arquisoft/wiq_en1b.git | ||
|
@@ -33,9 +41,9 @@ and launch it with docker compose: | |
docker compose --profile dev up --build | ||
``` | ||
|
||
### Deployed in Cloud | ||
In order to view the application deploy in the cloud click [here](http://wiqen1b.serveminecraft.net:3000) | ||
### Members | ||
## Members | ||
|
||
The members of the great team that made this incredible application. | ||
|
||
- Lucía Ruiz Núñez [email protected] | ||
- Mario Junquera Rojas [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import { useTranslation } from "react-i18next"; | ||
import '../../custom.css'; | ||
|
||
function About() { | ||
const t = useTranslation("global").t; | ||
|
||
const imageNames = ["person1.jpg", "person2.jpg", "person3.jpg", "person4.jpg", "person5.jpg", "person6.jpg"]; | ||
|
||
return ( | ||
<div> | ||
<h1>{t("about.hello")}</h1> | ||
<h2>{t("about.team")}</h2> | ||
<ul className="person-list"> | ||
{imageNames.map((imageName, index) => ( | ||
<li key={index} className="person-item"> | ||
<img src={`/${imageName}`} alt={`Person ${index + 1}`} className="person-image" /> | ||
{t(`about.name${index + 1}`)} | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
); | ||
} | ||
|
||
export default About; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { BrowserRouter as Router } from 'react-router-dom'; | ||
import About from './About'; | ||
|
||
|
||
// Mocking useTranslation hook | ||
jest.mock('react-i18next', () => ({ | ||
useTranslation: () => ({ t: key => key }), | ||
})); | ||
|
||
describe('About', () => { | ||
test('renders about page', () => { | ||
render( | ||
<Router> | ||
<About /> | ||
</Router> | ||
); | ||
|
||
expect(screen.getByText('about.hello')).toBeInTheDocument(); | ||
|
||
expect(screen.getByText('about.name1')).toBeInTheDocument(); | ||
expect(screen.getByText('about.name2')).toBeInTheDocument(); | ||
expect(screen.getByText('about.name3')).toBeInTheDocument(); | ||
expect(screen.getByText('about.name4')).toBeInTheDocument(); | ||
expect(screen.getByText('about.name5')).toBeInTheDocument(); | ||
expect(screen.getByText('about.name6')).toBeInTheDocument(); | ||
|
||
|
||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import '../../custom.css'; | ||
import { Link } from 'react-router-dom'; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
function Footer() { | ||
const [t] = useTranslation("global"); | ||
|
||
return ( | ||
<footer className="footer-container"> | ||
<div></div> | ||
<a href="http://wiqen1b.serveminecraft.net:8000/api-doc/" className="API" target="_blank" rel="noopener noreferrer"> | ||
<p className='link-text'>{t("footer.API")}</p> | ||
</a> | ||
|
||
<Link to="/about" className="about"> | ||
<p className='link-text'>{t("footer.about")}</p> | ||
</Link> | ||
|
||
<a href="https://arquisoft.github.io/wiq_en1b/" className="ARC" target="_blank" rel="noopener noreferrer"> | ||
<p className='link-text'>{t("footer.ARC")}</p> | ||
</a> | ||
<div></div> | ||
|
||
</footer> | ||
); | ||
} | ||
|
||
export default Footer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { render , screen } from '@testing-library/react'; | ||
import { initReactI18next } from 'react-i18next'; | ||
import i18en from 'i18next'; | ||
|
||
import App from '../../App' | ||
|
||
i18en.use(initReactI18next).init({ | ||
resources: {}, | ||
lng: 'en', | ||
interpolation:{ | ||
escapeValue: false, | ||
} | ||
}); | ||
global.i18en = i18en; | ||
|
||
describe('Footer fragment', () => { | ||
|
||
|
||
|
||
test('Footer renders correctly', async () => { | ||
render( | ||
<App /> | ||
); | ||
expect(screen.getByText('footer.about')).toBeInTheDocument(); | ||
expect(screen.getByText('footer.API')).toBeInTheDocument(); | ||
expect(screen.getByText('footer.ARC')).toBeInTheDocument(); | ||
|
||
|
||
|
||
|
||
|
||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.