Sample Spring Postgres App

Sample spring boot application connecting to a Postgres DB

Local setup

Prerequisites

  • Docker

Startup

  1. Build the docker image locally using
    ./gradlew jibDockerBuild
  1. Start the containers using docker compose
    docker-compose up
  1. Use the provided Postman collection to hit the application endpoints
  2. Alternatively, use the following curl commands
  • Create / Update customer
    curl --location --request PUT 'localhost:8080/customer/' \
        --header 'Content-Type: application/json' \
        --data-raw '{
            "name": "John Smith"
        }'
  • Fetch customer
    curl --location --request GET 'localhost:8080/customer/1'
  • Delete customer
    curl --location --request DELETE 'localhost:8080/customer/1'