This repository has been archived by the owner on Mar 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from IT-REX-Platform/dev
Merge from dev
- Loading branch information
Showing
33 changed files
with
1,737 additions
and
328 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
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 |
---|---|---|
@@ -1,143 +1,37 @@ | ||
# QuizService | ||
|
||
This application was generated using JHipster 6.10.5, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v6.10.5](https://www.jhipster.tech/documentation-archive/v6.10.5). | ||
|
||
This is a "microservice" application intended to be part of a microservice architecture, please refer to the [Doing microservices with JHipster][] page of the documentation for more information. | ||
|
||
This application is configured for Service Discovery and Configuration with the JHipster-Registry. On launch, it will refuse to start if it is not able to connect to the JHipster-Registry at [http://localhost:8761](http://localhost:8761). For more information, read our documentation on [Service Discovery and Configuration with the JHipster-Registry][]. | ||
|
||
## Development | ||
|
||
To start your application in the dev profile, run: | ||
|
||
``` | ||
./gradlew | ||
``` | ||
|
||
For further instructions on how to develop with JHipster, have a look at [Using JHipster in development][]. | ||
|
||
### Doing API-First development using openapi-generator | ||
|
||
[OpenAPI-Generator]() is configured for this application. You can generate API code from the `src/main/resources/swagger/api.yml` definition file by running: | ||
|
||
```bash | ||
./gradlew openApiGenerate | ||
``` | ||
## Architecture Documentation | ||
|
||
Then implements the generated delegate classes with `@Service` classes. | ||
Documentation of the whole IT-Rex system can be found [here](https://github.com/IT-REX-Platform/Wiki/wiki/Application-Architecture). | ||
|
||
To edit the `api.yml` definition file, you can use a tool such as [Swagger-Editor](). Start a local instance of the swagger-editor using docker by running: `docker-compose -f src/main/docker/swagger-editor.yml up -d`. The editor will then be reachable at [http://localhost:7742](http://localhost:7742). | ||
|
||
Refer to [Doing API-First development][] for more details. | ||
|
||
## Building for production | ||
|
||
### Packaging as jar | ||
|
||
To build the final jar and optimize the QuizService application for production, run: | ||
|
||
``` | ||
./gradlew -Pprod clean bootJar | ||
``` | ||
|
||
To ensure everything worked, run: | ||
|
||
``` | ||
java -jar build/libs/*.jar | ||
``` | ||
Especially relevant documentation for the internal data model of this service: | ||
* [User Role Model](https://github.com/IT-REX-Platform/Wiki/wiki/Application-Architecture--Data-Model--User) | ||
* [Quiz Data Model](https://github.com/IT-REX-Platform/Wiki/wiki/Application-Architecture--Data-Model--Quiz) | ||
|
||
Refer to [Using JHipster in production][] for more details. | ||
|
||
### Packaging as war | ||
|
||
To package your application as a war in order to deploy it to an application server, run: | ||
|
||
``` | ||
./gradlew -Pprod -Pwar clean bootWar | ||
``` | ||
|
||
## Testing | ||
|
||
To launch your application's tests, run: | ||
|
||
``` | ||
./gradlew test integrationTest jacocoTestReport | ||
``` | ||
|
||
For more information, refer to the [Running tests page][]. | ||
|
||
### Code quality | ||
|
||
Sonar is used to analyse code quality. You can start a local Sonar server (accessible on http://localhost:9001) with: | ||
|
||
``` | ||
docker-compose -f src/main/docker/sonar.yml up -d | ||
``` | ||
## Development | ||
|
||
You can run a Sonar analysis with using the [sonar-scanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner) or by using the gradle plugin. | ||
Documentation of the recommended development environment setup can be found [here](https://github.com/IT-REX-Platform/Wiki/wiki/Development--Environment-Setup). | ||
|
||
Then, run a Sonar analysis: | ||
To start your application in the dev profile, run: | ||
|
||
``` | ||
./gradlew -Pprod clean check jacocoTestReport sonarqube | ||
./gradlew -Pdev bootRun | ||
``` | ||
|
||
For more information, refer to the [Code quality page][]. | ||
|
||
## Using Docker to simplify development (optional) | ||
|
||
You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the [src/main/docker](src/main/docker) folder to launch required third party services. | ||
|
||
For example, to start a mongodb database in a docker container, run: | ||
The service can be provided as a Docker image. To build the Docker image and load it into your local registry execute: | ||
|
||
``` | ||
docker-compose -f src/main/docker/mongodb.yml up -d | ||
./gradlew -Pdev jibDockerBuild | ||
``` | ||
|
||
To stop it and remove the container, run: | ||
|
||
``` | ||
docker-compose -f src/main/docker/mongodb.yml down | ||
``` | ||
Further documentation on how to start the service can be found [here](https://github.com/IT-REX-Platform/Wiki/wiki/Development--How-to-start-a-backend-service). | ||
|
||
You can also fully dockerize your application and all the services that it depends on. | ||
To achieve this, first build a docker image of your app by running: | ||
|
||
``` | ||
./gradlew bootJar -Pprod jibDockerBuild | ||
``` | ||
## JHipster | ||
|
||
Then run: | ||
This application was generated using JHipster 6.10.5, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v6.10.5](https://www.jhipster.tech/documentation-archive/v6.10.5). | ||
|
||
``` | ||
docker-compose -f src/main/docker/app.yml up -d | ||
``` | ||
This is a "microservice" application intended to be part of a microservice architecture, please refer to the [Doing microservices with JHipster][] page of the documentation for more information. | ||
|
||
For more information refer to [Using Docker and Docker-Compose][], this page also contains information on the docker-compose sub-generator (`jhipster docker-compose`), which is able to generate docker configurations for one or several JHipster applications. | ||
|
||
## Continuous Integration (optional) | ||
|
||
To configure CI for your project, run the ci-cd sub-generator (`jhipster ci-cd`), this will let you generate configuration files for a number of Continuous Integration systems. Consult the [Setting up Continuous Integration][] page for more information. | ||
|
||
[jhipster homepage and latest documentation]: https://www.jhipster.tech | ||
[jhipster 6.10.5 archive]: https://www.jhipster.tech/documentation-archive/v6.10.5 | ||
[doing microservices with jhipster]: https://www.jhipster.tech/documentation-archive/v6.10.5/microservices-architecture/ | ||
[using jhipster in development]: https://www.jhipster.tech/documentation-archive/v6.10.5/development/ | ||
[service discovery and configuration with the jhipster-registry]: https://www.jhipster.tech/documentation-archive/v6.10.5/microservices-architecture/#jhipster-registry | ||
[using docker and docker-compose]: https://www.jhipster.tech/documentation-archive/v6.10.5/docker-compose | ||
[using jhipster in production]: https://www.jhipster.tech/documentation-archive/v6.10.5/production/ | ||
[running tests page]: https://www.jhipster.tech/documentation-archive/v6.10.5/running-tests/ | ||
[code quality page]: https://www.jhipster.tech/documentation-archive/v6.10.5/code-quality/ | ||
[setting up continuous integration]: https://www.jhipster.tech/documentation-archive/v6.10.5/setting-up-ci/ | ||
[openapi-generator]: https://openapi-generator.tech | ||
[swagger-editor]: https://editor.swagger.io | ||
[doing api-first development]: https://www.jhipster.tech/documentation-archive/v6.10.5/doing-api-first-development/ | ||
This application is configured for Service Discovery and Configuration with the JHipster-Registry. On launch, it will refuse to start if it is not able to connect to the JHipster-Registry at [http://localhost:8761](http://localhost:8761). For more information, read our documentation on [Service Discovery and Configuration with the JHipster-Registry][]. |
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,46 @@ | ||
version: "2" | ||
services: | ||
quizservice: | ||
image: quizservice | ||
environment: | ||
- _JAVA_OPTIONS=-Xmx512m -Xms256m | ||
- "SPRING_PROFILES_ACTIVE=prod,swagger" | ||
- MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED=true | ||
- "EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/eureka" | ||
- "SPRING_CLOUD_CONFIG_URI=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/config" | ||
- "SPRING_DATA_MONGODB_URI=mongodb://quizservice-mongodb:27017" | ||
- SPRING_DATA_MONGODB_DATABASE=QuizService | ||
- "SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URI=http://keycloak:9080/auth/realms/jhipster" | ||
- SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID=internal | ||
- SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=internal | ||
- JHIPSTER_SLEEP=5 | ||
- JHIPSTER_REGISTRY_PASSWORD=admin | ||
restart: always | ||
depends_on: | ||
- quizservice-mongodb | ||
networks: | ||
- it-rex | ||
|
||
quizservice-mongodb: | ||
image: mongo:4.2.7 | ||
restart: always | ||
ports: | ||
- 27017:27017 | ||
networks: | ||
- it-rex | ||
|
||
mongo-express: | ||
image: mongo-express | ||
restart: always | ||
ports: | ||
- 8090:8081 | ||
environment: | ||
- ME_CONFIG_MONGODB_SERVER=quizservice-mongodb | ||
# ME_CONFIG_MONGODB_ADMINUSERNAME: root | ||
# ME_CONFIG_MONGODB_ADMINPASSWORD: example | ||
networks: | ||
- it-rex | ||
|
||
networks: | ||
it-rex: | ||
external: true |
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,33 @@ | ||
version: "2" | ||
services: | ||
quizservice: | ||
image: quizservice | ||
environment: | ||
- _JAVA_OPTIONS=-Xmx512m -Xms256m | ||
- SPRING_PROFILES_ACTIVE=prod,swagger | ||
- MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED=true | ||
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/eureka | ||
- SPRING_CLOUD_CONFIG_URI=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/config | ||
- SPRING_DATA_MONGODB_URI=mongodb://quizservice-mongodb:27017 | ||
- SPRING_DATA_MONGODB_DATABASE=QuizService | ||
- SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URI=http://129.69.217.173:9080/auth/realms/jhipster | ||
- SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID=internal | ||
- SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=internal | ||
- JHIPSTER_SLEEP=5 # gives time for other services to boot before the application | ||
restart: always | ||
depends_on: | ||
- quizservice-mongodb | ||
networks: | ||
- it-rex | ||
|
||
quizservice-mongodb: | ||
image: mongo:4.2.7 | ||
restart: always | ||
ports: | ||
- "27017:27017" | ||
networks: | ||
- it-rex | ||
|
||
networks: | ||
it-rex: | ||
external: true |
8 changes: 0 additions & 8 deletions
8
src/main/java/de/uni_stuttgart/it_rex/quiz/domain/enumeration/QUESTIONTYPE.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.