Skip to content

Repository files navigation

Here is a sample README.md for your Java 21, Spring Boot, JPA, and Docker microservice project: This was for my final interview with DHL e-commerce for a Senior Software Engineer role. No offer.

Package Rate Microservice

Overview

This simple microservice calculates shipping rates for packages based on order details. Built with Java 21, Spring Boot, JPA, and Docker, it demonstrates best practices for modern Java backend development.

Prerequisites

  • Java 21
  • Gradle 7.x+
  • Docker & Docker Compose

Setup

1. Clone the repository

git clone https://github.com/your-org/your-repo.git
cd your-repo

2. Build the project

./gradlew clean build

3. Run the application

./gradlew bootRun

4. Run tests

./gradlew test

5. Build and run with Docker

docker-compose up --build

6. Stop and remove Docker containers

docker-compose down

7. View application logs

docker-compose logs -f

API Endpoints

Create Package

  • POST /packages
  • Request Body (JSON):
    {
      "date": "2024-06-10T15:30:00",
      "originatingAddress": {
        "addressLine1": "123 Main St",
        "addressLine2": "Apt 1",
        "city": "Springfield",
        "state": "IL",
        "zipCode": 62701
      },
      "destinationAddress": {
        "addressLine1": "456 Elm St",
        "addressLine2": "Suite 200",
        "city": "Chicago",
        "state": "IL",
        "zipCode": 60601
      }
    }

Retrieve Package

  • GET /packages/{packageId}
  • Response (200 OK):
    {
      "packageId": 123,
      "date": "2024-06-10T15:30:00",
      "originatingAddress": {
        "addressLine1": "123 Main St",
        "addressLine2": "Apt 1",
        "city": "Springfield",
        "state": "IL",
        "zipCode": 62701
      },
      "destinationAddress": {
        "addressLine1": "456 Elm St",
        "addressLine2": "Suite 200",
        "city": "Chicago",
        "state": "IL",
        "zipCode": 60601
      },
      "rate": 9.99,
      "currency": "USD",
      "status": "CREATED"
    }

Notes

  • Update endpoint URLs and request/response fields as per your implementation.
  • Use environment variables or application.yml for configuration.
  • For further details, see the source code and comments.

About

This was for my final interview with DHL e-commerce for a Senior Software Engineer role. 2025

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages