Back-office services for Queen
REST API used for communication with Queen/Stromae UI
- queen-application: api module for queen
- queen-domain: business logic
- queen-domain-pilotage: business logic for habilitations/interviewer specific features
- queen-domain-depositproof: business logic for deposit proof generation
- queen-infra-db: db access to queen data
- queen-infra-depositproof: deposit proof generation
- queen-infra-pilotage: access to pilotage api (check habilitations, ...)
For building and running the application you need:
- Java 21
- Maven 3
Use the maven clean and maven install
mvn clean install
On queen-application module:
mvn spring-boot:run
Queen-Back-Office uses postgresql as data source
mvn clean package
The jar will be generated in /target
repository
java -jar app.jar
To access the swagger-ui, use this url : http://localhost:8080/swagger-ui/index.html
A Dockerfile is present on this root project to deploy a container. You can get docker images on docker hub
Helm chart repository is available for the queen backoffice/db/frontend
Liquibase is enabled by default and run changelogs if needed.
On queen-infra-db module:
# Don't forget to edit configuration properties in pom.xml for this
mvn liquibase:diff
Minimal configuration for dev purpose only (no auth, no habilitation checks on pilotage api) User is considered as authenticated admin user
application:
corsOrigins: https://test.com #mandatory
# define folder where temp files will be created
# /!\ do not use the OS default temp folder or java.io.tmpdir as it causes security issues
# give only access rights to this folder to the user executing the tomcat process
temp-folder: /opt/app/app-temp
spring:
datasource:
url: jdbc:postgresql://localhost:5432/defaultSchema
username:
password:
driver-class-name: org.postgresql.Driver
jpa:
show-sql: true
jackson:
serialization:
indent_output: true
logging:
file:
name: /path/to/log/folder/queen.log
level:
root: INFO
feature:
oidc:
enabled: false
dataset:
# create demo dataset on startup
load-on-start: true
# display api endpoint to create dataset
display-endpoint: true
# enable swagger
swagger:
enabled: true
# enable pilotage api
pilotage:
enabled: false
# enable cache
cache:
enabled: true
# enable comment endpoints
comments:
enabled: true
# enable interviewer features
interviewer-mode:
enabled: false
Configuration example with OIDC/habilitations/interviewer features enabled
application:
corsOrigins: https://test.com #mandatory
# define folder where temp files will be created
# /!\ do not use the OS default temp folder or java.io.tmpdir as it causes security issues
# give only access rights to this folder to the user executing the tomcat process
temp-folder: /opt/app/app-temp
roles:
interviewer: interviewer_role
reviewer: reviewer_role
admin: admin_role
webclient: webclient_role
reviewer-alternative: reviewer_alternative_role
spring:
datasource:
url: jdbc:postgresql://localhost:5432/defaultSchema
username:
password:
driver-class-name: org.postgresql.Driver
logging:
file:
name: /path/to/log/folder/queen.log
level:
root: INFO
feature:
oidc:
enabled: true
auth-server-host: https://auth-server.host
auth-server-url: ${feature.oidc.auth-server-host}/auth
client-id: my-client-id
realm: my-realm
principal-attribute: id-claim
role-claim: role-claim
dataset:
# create demo dataset on startup
load-on-start: false
# display api endpoint to create dataset
display-endpoint: false
# enable swagger
swagger:
enabled: true
# enable pilotage api
pilotage:
enabled: true
url:
alternative-habilitation:
url: http://alternative.url
campaignids-regex: ((edt)|(EDT))(\d|\S){1,}
# enable cache
cache:
enabled: true
# enable comment endpoints
comments:
enabled: true
# enable interviewer features
interviewer-mode:
enabled: true
-
Campaign
GET /campaigns
: Retrieve the campaigns the current user has access toGET /admin/campaigns
: Retrieve all campaignsPOST /campaigns
: Create a new campaignPOST /campaign/context
: Integrate a full campaign (campaign/nomenclatures/questionnaires. The results of the integration indicate the successful/failed integrationsDELETE /campaign/{id}
: Delete a campaign
-
Questionnaire
GET /questionnaire/{id}
: Retrieve the data structure of a questionnaireGET /campaign/{id}/questionnaires
: Retrieve the data structure of all questionnaires linked to a campaignGET /campaign/{idCampaign}/questionnaire-id
: Retrieve all the questionnaire ids for a campaignPOST /questionnaire-models
: Create a new questionnaire
-
SurveyUnit
GET /survey-units
: Retrieve all survey units idGET /survey-unit/{id}
: Retrieve the survey unitGET /survey-unit/{id}/deposit-prof
: Generate and retrieve a deposit proof (pdf file) for a survey unitGET /campaign/{id}/survey-units
: Retrieve all the survey units of a campaignPUT /survey-unit/{id}
: Update a survey unitGET /survey-units/interviewer
: Retrieve all the survey units of the current interviewerPOST /campaign/{id}/survey-unit
: Create or update a survey unitDELETE /survey-unit/{id}
: Delete a survey unit
-
Data
GET /survey-unit/{id}/data
: Retrieve the data of a survey unitPUT /survey-unit/{id}/data
: Update the data of a survey unit
-
Comment
GET /survey-unit/{id}/comment
: Retrieve the comment of a survey unitPUT /survey-unit/{id}/comment
: Update the comment of a survey unit
-
Nomenclatures
GET /questionnaire/{id}/required-nomenclatures
: Retrieve all required nomenclatures of a questionnaireGET /campaign/{id}/required-nomenclatures
: Retrieve all required nomenclatures of a campaignGET /nomenclature/{id}
: Retrieve the json value of a nomenclaturePOST /nomenclature
: Create/update a nomenclatureGET /nomenclatures
: Retrieve all nomenclatures ids
-
Personalization
GET /survey-unit/{id}/personalization
: Retrieve the personalization of a survey unitPUT /survey-unit/{id}/personalization
: Update the personalization of a survey unit
-
Metadata
GET /campaign/{id}/metadata
: Retrieve campaign metadataGET /questionnaire/{id}/metadata
: Retrieve campaign metadata
-
Paradata
POST /paradata
: Create a paradata event for a survey unit
-
StateData
GET /survey-unit/{id}/state-data
: Retrieve the state-data of a survey unitPUT /survey-unit/{id}/state-data
: Update the state-data of a survey unitPOST /survey-units/state-data
: Get state-data for all survey-units defined in request body
-
DataSet
POST /create-dataset
: Create dataset for demo environments
- spring-boot-data-jpa
- spring-boot-security
- spring-boot-web
- spring-boot-tomcat
- spring-boot-test
- spring-boot-starter-oauth2-resource-server
- liquibase
- postgresql
- junit
- springdoc
- caffeine (cache)
Please check LICENSE file