Back-office services for Coleman
REST API for communication between Coleman DB and Coleman UI.
For building and running the application you need:
- JDK 11
- Maven 3
Use the maven clean and maven install
mvn clean installUse the Spring Boot Maven plugin like so:
mvn spring-boot:runTo access to swagger-ui, use this url : http://localhost:8080/api/swagger-ui.html
To access to h2 console, use this url : http://localhost:8080/api/h2-console
- To start the server on port 8180 execute in the bin folder of your keycloak :
standalone.bat -Djboss.socket.binding.port-offset=100 (on Windows)
standalone.sh -Djboss.socket.binding.port-offset=100 (on Unix-based systems)- Go to the console administration and create role investigator and a user with this role.
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 packageThe war will be generate in /target repository
To deploy the war file in Tomcat, you need to :
Download Apache Tomcat and unpackage it into a tomcat folder
Copy your WAR file from target/ to the tomcat/webapps/ folder
Before to startup the tomcat server, some configurations are needed :
Create colemanbo.properties or colemcobo.properties near war file and complete the following properties:
#Logs configuration
fr.insee.coleman.logging.path=classpath:log4j2.xml
fr.insee.coleman.logging.level=INFO
#Application configuration
fr.insee.coleman.application.mode=noauth
fr.insee.coleman.application.crosOrigin=*
#Database configuration
fr.insee.coleman.persistence.database.host = localhost
fr.insee.coleman.persistence.database.port = 5432
fr.insee.coleman.persistence.database.schema = coleman_api
fr.insee.coleman.persistence.database.user = coleman
fr.insee.coleman.persistence.database.password = coleman
fr.insee.coleman.persistence.database.driver = org.postgresql.Driver
fr.insee.coleman.defaultSchema=public
fr.insee.coleman.ddl-auto=update or create or create-drop or validate (only in dev)
#Keycloak configuration
keycloak.realm=insee-realm
keycloak.resource=coleman
keycloak.auth-server-url=http://localhost:8180/auth
keycloak.public-client=true
keycloak.bearer-only=true
keycloak.principal-attribute:preferred_username
coleman.environnement="environnement local"
fr.insee.coleman.ldap.services.uri.host=https://localhost
fr.insee.coleman.ldap.services.uri.port=2000
fr.insee.coleman.ldap.externe.server.login=coleman
fr.insee.coleman.ldap.externe.server.pw=coleman
fr.insee.coleman.ldap.externe.domaineGestion=coleman
fr.insee.coleman.api.dataloader.load=falseCreate log4j2.xml near war file and define your external config for logs.
From a terminal navigate to tomcat/bin folder and execute
catalina.bat run (on Windows)catalina.sh run (on Unix-based systems)To access to swagger-ui, use this url : http://localhost:8080/swagger-ui.html
To access to keycloak, use this url : http://localhost:8180
Before committing code please ensure,
1 - README.md is updated
2 - A successful build is run and all tests are sucessful
3 - All newly implemented APIs are documented
4 - All newly added properties are documented
-
Rest Basic
- GET /env` : env
- GET /helloworld` : helloWorld
-
Rest Campaign
GET /campaigns: displayCampaignInProgressPOST /campaigns: addCampaignsGET /campaigns/{idCampaign}: displayACampaignPUT /campaigns/{idCampaign}: updateCampaignDELETE /campaigns/{idCampaign}: deleteACampaign
-
Rest Contact
GET /contact/{idContact}/mail: Get mail of contact
-
Rest Management Monitoring Info
POST /campaigns/{idCampaign}/management-monitoring-info: addManagementMonitoringInfoInfosViaBatchPOST /campaigns/{idCampaign}/management-monitoring-infos: addManagementMonitoringInfoViaBatchGET /campaigns/{idCampaign}/survey-units/{idSu}/management-monitoring-infos: displayManagementMonitoringInfoOfOneSurveyUnitGET /management-monitoring-info/{id}: displayManagementMonitoringInfoDELETE /management-monitoring-infos/{id}: deleteAManagementMonitoringInfo
-
Rest Monitoring
GET /campaigns/{idCampaign}/extraction: provideDataForExtractionGET /campaigns/{idCampaign}/monitoring/follow-up: getDataToFollowUpGET /campaigns/{idCampaign}/monitoring/progress: getDataForProgress
-
Rest Survey Unit
POST /campaigns/{idCampaign}/survey-units: initializeSurveyUnitsViaBatchGET /campaigns/{idCampaign}/survey-units/{idSu}: getSurveyUnitByIdCampaignGET /campaigns/{idCampaign}/survey-units/follow-up: displaySurveyUnitsToFollowUpGET /campaigns/survey-units: displaySurveyUnitByFilter
-
Rest Upload
GET /campaigns/{idCampaign}/uploads: displayAllUploadsPOST /campaigns/{idCampaign}/uploads: addManagementMonitoringInfoViaUploadPOST /campaigns/{idCampaign}/uploads/validation: checkManagementMonitoringInfoDELETE /uploads/{id}: deleteOneUpload
- spring-boot-jpa
- spring-boot-security
- spring-boot-web
- spring-boot-tomcat
- spring-boot-test
- postgresql
- junit
- springfox-swagger2
- hibernate
- keycloak
- Benjamin Claudel (benjamin.claudel@keyconsulting.fr)
- Samuel Corcaud (samuel.corcaud@keyconsulting.fr)
- Paul Guillemet (paul.guillemet@keyconsulting.fr)
Please check LICENSE file