SpringBoot Kotlin web app for interfacing with the Naomi model for joint small-area estimation of HIV prevalence, ART coverage, and HIV incidence via the hintr package
Requirements:
- Docker
- npm
- openjdk 8
- coreutils or realpath (Mac users only)
- Clone this repo
- Run
npm install
fromsrc/app/static
- Run
./scripts/run-development-dependencies.sh
to start docker instances of hint-db and hintr and add a test user with username[email protected]
and passwordpassword
. - Run
npm run build
fromsrc/app/static
to compile front-end dependencies. - Run app from your IDE or by
cd src && ./gradlew :app:bootRun
to serve the app on port 8080
For more information about developing the front-end see src/app/static/README
Ensure dependencies are running and then execute tests on the command line or through IntelliJ
./scripts/run-development-dependencies.sh
./src/gradlew -p src app::test
To run a specific test alone, add --test
+ the fully qualified class name to the command. For example, the command for running ProjectsControllerTests.kt would be: ./src/gradlew -p src app::test --tests org.imperial.mrc.hint.unit.controllers.ProjectsControllerTests
If the database schema has changed, you can regenerate the database interface code (in /src/databaseInterface)
by running ./src/gradlew -p src :generateDatabaseInterface:run
while the database container is running.
HINT Versions are recorded here. The latest version should match the value of currentHintVersion in
src/app/static/src/app/hintVersion.ts
If you make any change to the application which affects its functionality (i.e. anything other than a refactor, or documentation or CI change, you should update the version by adding an entry to NEWS.md and setting currentHintVersion).
Versions should follow the semantic versioning format, so you should update the:
- MAJOR version when you make incompatible changes (e.g. a change to serialised version state format),
- MINOR version when you add functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes.
This may cause relatively frequently conflicts since more than one person is likely to be working on a new version at a time. In this case, you should give your branch its own new version number, rather than rolling your changes into the same version number as changes from another branch.
A docker image containing the app is created as part of the BuildKite build. To create such an image locally,
run ./buildkite/make-build-env.sh
followed by ./buildkite/build.sh
. A CLI image is also created as part of
the BuildKite build, using ./buildkite/build-cli.sh
.
Run docker run -p 8080:8080 --name hint mrcide/hint:branch_name
to run a built image. The app will not start until
config is provided at /etc/hint/config.properties
. This config is added during deployment with
hint-deploy