Skip to content

Latest commit

 

History

History
111 lines (86 loc) · 4.24 KB

README.md

File metadata and controls

111 lines (86 loc) · 4.24 KB

Noice Logo

Noice API

Latest release GitHub license API codecov

Configuration

The application.properties file declares all the configuration options that the API server accepts in addition to configuration options of the Spring Framework.

When started using the bootRun Gradle task, the API server loads the application-dev-default.properties and application-dev.properties files. See "Development Configuration" for more details.

Development

Database

Create a PostgreSQL instance before running the API server. The ./scripts directory contains a Docker Compose helper configuration to create PostgreSQL and PGAdmin containers. It also creates a fresh develop database as soon as the PostgreSQL container starts. It is also the default data-source configuration in application-dev-default.properties.

docker-compose -f scripts/postgres-with-docker-compose.yaml up -d

To delete and recreate the development database, restart the postgres-init container.

docker-compose -f scripts/postgres-with-docker-compose.yaml restart postgres-init

Build and Run

Use API run configuration to start the API server from IntelliJ IDEA. Hot-reloading is pre-configured in application-dev-default.properties. Recompile the project source using Ctrl (Cmd) + F9 to hot-reload a running API server instance.

To run from a terminal, use the Gradle wrapper.

./gradlew bootRun

To enable hot-reload, build the source continuously while running the bootRun Gradle task in parallel.

./gradlew build --continuous

Development Configuration

Both the bootRun Gradle task and the API IntelliJ run configuration, activate the dev-default and dev Spring profiles. application-dev-default.properties contains some sensible defaults required for development. application-dev.properties is gitignored and meant to store personal configuration, such as API secrets, etc.

Integration Tests

application-test.properties contains configuration critical for running integration tests. Both, the "Integration Tests" IntelliJ run configuration and the integrationTest Gradle task, enable the test profile to load this configuration.

The test profile configures the application to use the PostgreSQL module of Testcontainers. It requires access to an active Docker daemon. It creates one PostgreSQL container per test class and one database per test.

License

GNU GPL v3

White Noise icon by Juraj Sedlák