Back-office services for Public-Enemy REST API for communication with:
Public-Enemy Backoffice (& frontend) is a tool used to test questionnaires with data. Questionnaire designer create questionnaire in pogues but can't test them with predefined data directly. Public-Enemy gives to the designer the ability to inject a questionnaire in orchestrators (stromae, queen soon), and add predefined survey units data in the orchestrators for this questionnaire.
Public-Enemy's global functionalities for a designer:
- create a questionnaire in public-enemy
- retrieve the questionnaire from pogues
- create the questionnaire in public-enemy
- inject the questionnaire and survey units data (given by the designer when creating questionnaire in public-enemy) in the orchestrators
- update a questionnaire in public-enemy
- synchronise the questionnaire with the orchestrators (when pogues questionnaire has been edited for example, or to change survey units data)
- delete a questionnaire in public-enemy
- delete questionnaire in orchestrators
- access to questionnaire in orchestrators
- designer can access to a questionnaire in orchestrators for a specific survey unit
- designer can reset a specific survey unit data
For building and running the application you need:
- JDK 17
- Maven 3
Use the maven clean and maven install
mvn clean install
Use the Spring Boot Maven plugin like so:
mvn spring-boot:run
Use the [Spring Boot Maven plugin] (https://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins-maven-plugin.html) like so:
mvn clean package
The jar will be generate in /target
repository
java -jar public-enemy-api-XXX.jar
Create an application profile file (application-dev.yml for example, don't forget to add profile when using spring-boot:run) and override necessary properties from application.yaml
spring:
# public-enemy db
datasource:
url: jdbc:postgresql://localhost:5432/public-enemy-db
username: public-enemy
password: public-enemyPassword
hikari.maximumPoolSize: 2
# where logs are stored
logging:
file:
path: /var/log
application:
# if you need proxy
proxy:
enable: true
url: proxy.xxx.com
port: 80
# allowed origin: url of your public-enemy frontend
cors:
allowed-origins: http://localhost:3000
# pogues backoffice url
pogues:
url: https://pogues-back-office.xxx.com
# eno ws url
eno:
url: https://eno.xxx.com
# queen backoffice for stromae
queen:
url: https://stromae-api.xxx.com
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 public-enemy backoffice/frontend
The repository contains helm charts to deploy pogues/eno/stromae too.
Liquibase is enabled by default and run changelogs if needed.
#Don't forget to edit configuration properties in pom.xml for this
mvn liquibase:diff
Before committing code please ensure,
1 - README.md is updated
2 - A successful build is run and all tests are successful
3 - All newly implemented APIs are documented
4 - All newly added properties are documented
-
Modes
GET /modes
: get the insee questionnaire modes
-
Contexts
GET /contexts
: get the insee questionnaire contexts
-
Questionnaires
POST /questionnaires/{questionnaireId}
: update an existing questionnaire and synchronize it with orchestratorsPOST /questionnaires/add
: create a new questionnaire and inject it to orchestrators (with survey units external data as csv file)GET /questionnaires
: get list of questionnairesGET /questionnaires/{poguesId}/db
: get questionnaire from pogues questionnaire idGET /questionnaires/{id}
: get questionnaireGET /questionnaires/{id}/data
: get survey units data (as csv file)GET /questionnaires/pogues/{poguesId}
: get questionnaire informations coming from poguesDELETE /questionnaires/{id}/delete
: delete a questionnaire
-
Survey Units
PUT /survey-units/{surveyUnitId}/reset
: reset collected data from a survey unit (keep external data)POST /questionnaires/{poguesId}/checkdata
: check csv data file against variables definition from a questionnaireGET /questionnaires/{questionnaireId}/modes/{modeName}/survey-units
: get survey units for a questionnaireGET /questionnaires/{poguesId}/csv
: get CSV schema from a questionnaire variables definitions
- spring-boot-jpa
- spring-boot-security
- spring-boot-web
- spring-boot-tomcat
- spring-boot-test
- postgresql
- junit
- springdoc
- spring-boot-actuator
- liquibase
Please check LICENSE file