{"id":24775652,"url":"https://github.com/inseefr/public-enemy-back-office","last_synced_at":"2025-10-12T00:31:28.891Z","repository":{"id":43311307,"uuid":"342548429","full_name":"InseeFr/Public-Enemy-Back-Office","owner":"InseeFr","description":"Back-office services for Public-Enemy","archived":false,"fork":false,"pushed_at":"2025-01-26T20:23:35.000Z","size":1561,"stargazers_count":0,"open_issues_count":3,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-01-26T21:24:17.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InseeFr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-26T10:59:54.000Z","updated_at":"2025-01-08T15:27:34.000Z","dependencies_parsed_at":"2024-02-13T12:41:16.219Z","dependency_job_id":"9e92034e-dddf-4d79-8857-96986103460a","html_url":"https://github.com/InseeFr/Public-Enemy-Back-Office","commit_stats":null,"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InseeFr%2FPublic-Enemy-Back-Office","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InseeFr%2FPublic-Enemy-Back-Office/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InseeFr%2FPublic-Enemy-Back-Office/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InseeFr%2FPublic-Enemy-Back-Office/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InseeFr","download_url":"https://codeload.github.com/InseeFr/Public-Enemy-Back-Office/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236142756,"owners_count":19101664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-29T06:55:07.209Z","updated_at":"2025-10-12T00:31:28.886Z","avatar_url":"https://github.com/InseeFr.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Public-Enemy-Back-Office\nBack-office services for Public-Enemy\nREST API for communication with: \n- [Pogues UI](https://github.com/InseeFr/Pogues)\n- [Pogues Backoffice](https://github.com/InseeFr/Pogues-Back-Office)\n- [Lunatic-pdf-api](https://github.com/InseeFr/lunatic-pdf-api)\n- [Eno](https://github.com/InseeFr/Eno/)\n- [Stromae backoffice](https://github.com/InseeFr/Queen-Back-Office)\n\n## Global project concept\nPublic-Enemy Backoffice 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.\n\nPublic-Enemy's global functionalities for a designer:\n\n- create a questionnaire in public-enemy\n  - retrieve the questionnaire from pogues\n  - create the questionnaire in public-enemy\n  - inject the questionnaire and survey units data (given by the designer when creating questionnaire in public-enemy) in the orchestrators\n- update a questionnaire in public-enemy\n  - synchronise the questionnaire with the orchestrators (when pogues questionnaire has been edited for example, or to change survey units data)\n- delete a questionnaire in public-enemy\n  - delete questionnaire in orchestrators\n- access to questionnaire in orchestrators\n  - designer can access to a questionnaire in orchestrators for a specific survey unit\n  - designer can reset a specific survey unit data\n\n## Requirements\nFor building and running the application you need:\n- [JDK 17](https://jdk.java.net/archive/)\n- Maven 3\n\n## Install and execute unit tests\nUse the maven clean and maven install\n```shell\nmvn clean install\n```  \n\n## Running the application locally\nUse the [Spring Boot Maven plugin](https://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins-maven-plugin.html) like so:\n```shell\nmvn spring-boot:run\n```\n\n## Deploy application on Tomcat server\n### 1. Package the application\nUse the [Spring Boot Maven plugin]  (https://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins-maven-plugin.html) like so:\n```shell\nmvn clean package\n```  \nThe jar will be generate in `/target` repository\n\n### 2. Launch\n```shell\njava -jar public-enemy-api-XXX.jar\n```  \n\n\n#### Properties to edit\nCreate 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\n```shell  \nspring:\n  # public-enemy db\n  datasource:\n    url: jdbc:postgresql://localhost:5432/public-enemy-db\n    username:\n    password: \n    hikari.maximumPoolSize: 2\n  # where logs are stored\nlogging:\n  file:\n    path: /var/log\napplication:\n  # if you need proxy\n  proxy:\n    enable: true\n    url: proxy.xxx.com\n    port: 80\n  # allowed origin: url of your public-enemy frontend\n  cors:\n    allowed-origins: http://localhost:3000\n  # pogues backoffice url\n  pogues:\n    url: https://pogues-back-office.xxx.com\n  # eno ws url\n  eno:\n    url: https://eno.xxx.com\n  # queen backoffice for stromae\n  queen:\n    url: https://stromae-api.xxx.com\n```\n\n### 3. Application Access\nTo access the swagger-ui, use this url : [http://localhost:8080/swagger-ui/index.html](http://localhost:8080/swagger-ui/index.html)\n\n\n## Docker/Kubernetes\n\nA Dockerfile is present on this root project to deploy a container. You can [get docker images on docker hub](https://hub.docker.com/r/inseefr/public-enemy-back-office/tags)\n\n[Helm chart repository](https://github.com/InseeFr/Helm-Charts/) is available for the public-enemy backoffice/frontend\n\nThe repository contains helm charts to deploy pogues/eno/stromae too. \n\n\n## Liquibase\nLiquibase is enabled by default and run changelogs if needed.\n\n### Generate diff changelog between twos databases\n```shell\n#Don't forget to edit configuration properties in pom.xml for this\nmvn liquibase:diff\n```\n\n## Before you commit\nBefore committing code please ensure,  \n1 - README.md is updated  \n2 - A successful build is run and all tests are successful  \n3 - All newly implemented APIs are documented  \n4 - All newly added properties are documented\n  \n## End-Points in /api\n- Modes\n    - `GET /modes` : get the insee questionnaire modes\n\n- Contexts\n    - `GET /contexts` : get the insee questionnaire contexts\n\n- Questionnaires\n  - `POST /questionnaires/{questionnaireId}` : update an existing questionnaire and synchronize it with orchestrators\n  - `POST /questionnaires/add` : create a new questionnaire and inject it to orchestrators (with survey units external data as csv file)\n  - `GET  /questionnaires` : get list of questionnaires \n  - `GET  /questionnaires/{poguesId}/db` : get questionnaire from pogues questionnaire id\n  - `GET  /questionnaires/{id}` : get questionnaire\n  - `GET  /questionnaires/{id}/data` : get survey units data (as csv file)\n  - `GET  /questionnaires/pogues/{poguesId}` : get questionnaire informations coming from pogues\n  - `DELETE /questionnaires/{id}/delete` : delete a questionnaire\n\n- Survey Units\n  - `PUT /survey-units/{surveyUnitId}/reset` : reset collected data from a survey unit (keep external data)\n  - `POST /questionnaires/{poguesId}/checkdata` : check csv data file against variables definition from a questionnaire \n  - `GET /questionnaires/{questionnaireId}/modes/{modeName}/survey-units` : get survey units for a questionnaire\n  - `GET /questionnaires/{poguesId}/csv` : get CSV schema from a questionnaire variables definitions \n\n## Libraries used\n- spring-boot-jpa\n- spring-boot-security\n- spring-boot-web\n- spring-boot-tomcat\n- spring-boot-test\n- postgresql\n- junit\n- springdoc\n- spring-boot-actuator\n- liquibase\n\n## License\nPlease check [LICENSE](https://github.com/InseeFr/Public-Enemy-Back-Office/blob/main/LICENSE) file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finseefr%2Fpublic-enemy-back-office","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finseefr%2Fpublic-enemy-back-office","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finseefr%2Fpublic-enemy-back-office/lists"}