bcgov / nr-spar-oracle-api

This repository holds a starting service using Java, that aims to be the reference for future back-end services.
Apache License 2.0
4 stars 0 forks source link
encora encora-brazil java natural-resources spring-boot template-project

Lifecycle:Experimental Coverage Branches Quality Gate Status

Natural Resources SPAR Oracle API

This repository holds a set of policies, standards, guides, and pipelines to get started with a back-end API. Before writing your first line of code, please take a moment and check out our CONTRIBUTING guide.

Note: This repository was generated from greenfield-template and in case you're interested in the original README file, we still have it here.

Our Policy

Stack

Here you can find a comprehensive list of all languages and tools that are been used in this service. And also everything you need to get started, build locally, test and deploy it.

Getting started

Once you have cloned this repository, can get it running by typing: ./mvnw spring-boot:run from the project root directory. You must provide three environment variables for database access configuration:

Then head to http://localhost:8090/actuator/health to check if the system was successfully launched: the status property should have the value UP.

Before writing your first line of code, and learn more about the checks, including tests, please take a moment and check out our CONTRIBUTING guide.

Quick look

But if all you want is to take a quick look on the running service, you can do it by using Docker.

Note that you'll need these environment variables:

NR_SPAR_ORACLE_API_VERSION=local
DATABASE_HOST=<host>
DATABASE_PORT=<port>
SERVICE_NAME=<service-name>
DATABASE_USER=<user>
DATABASE_PASSWORD=<pass>
KEYCLOAK_REALM_URL=<realm-server-address>

Build the service:

docker build -t bcgov/nr-spar-oracle-api:latest .

Then run with:

docker run -p 8090:8090 \
  -e KEYCLOAK_REALM_URL=https://dev.loginproxy.gov.bc.ca/auth/realms/standard \
  -t bcgov/nr-spar-oracle-api-service:latest

However, if you have docker-compose you can do:

docker-compose up --build --force-recreate --no-deps

You'll need to provide the address of the DNS server to be used by the container in the environment variable DNS_ADDRESS: you can find the address of the DNS server you're using right now using nslookup, for instance.

You can then check the API documentation accessing localhost:8090/swagger-ui.html.

Getting help

As mentioned, we're here to help. Feel free to start a conversation on Rocket chat or ask a question on Stackoverflow.