The Match Jobs and Manage Applications - Jobs Board API provides backend services Jobs Uploads, Employers Uploads and Candidate Matching.
- The product page on Developer Portal: Match Jobs and Manage Applications
- The high level design on Confluence: Match Jobs & Manage Applications - HLD
This backend application is developed and supported by Education Skills and Work team. They can be contacted via #education-skills-work-employment-dev on Slack.
This backend application has a /health endpoint which indicates the service is up and running.
This backend application depends on several services to run.
| Dependency | Description | Default | Override Env Var |
|---|---|---|---|
| hmpps-auth | OAuth2 API server for authenticating requests | API_BASE_URL_OAUTH |
|
| OS Places API | OS Places API for resolving postcodes | https://api.os.uk/search/places/v1 |
OS_PLACES_API_URL |
| Database | Database server (postgres on local, RDS on live env) |
DATABASE_NAME, DATABASE_ENDPOINT, DATABASE_USERNAME and DATABASE_PASSWORD |
|
Defining env var for local run
| Env. var. | description |
|---|---|
DATABASE_ENDPOINT |
Database Endpoint (address with port) |
DATABASE_NAME |
Database Name |
DATABASE_USERNAME |
Database user's username |
DATABASE_PASSWORD |
Database user's password |
OS_PLACES_API_KEY |
API access key for OS Places API (per given environment) |
* These values can be obtained from k8s secrets on dev env. |
- Run with the Spring profile
devon local- Set active profile via this environmental variable
spring.profiles.active=devorSPRING_PROFILES_ACTIVE=dev
- Set active profile via this environmental variable
- API Spec:
- Goto
http://localhost:8080/swagger-ui/index.htmlto explore the OpenAPI specifications
- Goto
- Checking endpoints
- Goto
http://localhost:8080/healthto check the service is up and running
- Goto
-
Define/Override env var.: define a
.envfile with () required env var from above; Syntax of .env file- provide API key only
PRODUCT_ID=DPS015 OS_PLACES_API_KEY=<API-ACCESS-KEY>
- Specify API key and override Auth URL
PRODUCT_ID=DPS015 OS_PLACES_API_KEY=<API-ACCESS-KEY> API_BASE_URL_OAUTH=https://sign-in-dev.hmpps.service.justice.gov.uk/auth
- Or use
devprofileSPRING_PROFILES_ACTIVE=dev PRODUCT_ID=DPS015 OS_PLACES_API_KEY=<API-ACCESS-KEY>
- provide API key only
-
Run this at CLI
docker compose pull && docker compose up -de.g.
- in
.env.localSPRING_PROFILES_ACTIVE=dev PRODUCT_ID=DPS015 HMPPS_SAR_ADDITIONALACCESSROLE=ROLE_EDUCATION_WORK_PLAN_VIEW OS_PLACES_API_KEY=...
docker compose --env-file .env.local up -d
- in
will build the application and run it with a PostgreSQL database and localstack within local docker.
- Run this at CLI
docker compose pull && docker compose up --scale hmpps-jobs-board-api=0 -d - will just start docker instance of
PostgreSQLdatabase. The application should then be started with adevactive profile in Intellij.- supply required env var, e.g.
spring.profiles.active=dev;os.places.api.key=<API-ACCESS-KEY>
- supply required env var, e.g.
- Build the app jar
- Copy jar to project root
- Build docker image
BUILD_NUMBER=1_0_0 ./gradlew clean assemble && cp ./build/libs/*.jar .BUILD_NUMBER=1_0_0 docker build --build-arg BUILD_NUMBER=$BUILD_NUMBER . -t "hmpps-jobs-board-api:local"Set these in your env file (with actual OS API key)
- In
.env.dockerSPRING_PROFILES_ACTIVE=dev PRODUCT_ID=DPS015 HMPPS_SAR_ADDITIONALACCESSROLE=ROLE_EDUCATION_WORK_PLAN_VIEW OS_PLACES_API_KEY=... # `host.docker.internal` (instead of `localhost`) for connecting the image to local DB of host SPRING_DATASOURCE_URL=jdbc:postgresql://host.docker.internal:5432/job-board
then run this
docker run --name hmpps-jobs-board-api-app --env-file .env.docker -p 8080:8080 -d "hmpps-jobs-board-api:local"