/Parcel-Delivery-App

Parcel App: a solution of a back-end of the web app implemented as a micro-service architecture that is deployable using container technology.

Primary LanguageJava

Parcel Delivery APP

Gradle Coverage Branches

This is my implementation of the test task with the following assignment:

You’ll be expected to build the back-end of the web app, while the front-end will be built by another developer in the team. To do this, you are expected to implement a solution that enables the user stories provided. This solution must be implemented as a microservice architecture that is deployable using container technology.

TECHNOLOGIES

  • Java 17
  • Gradle
  • Spring Boot
  • Spring Security
  • Spring Cloud Netflix
  • Spring Cloud Gateway
  • Spring Cloud Config (Git/Vault)
  • Kafka, Zookeeper
  • Resilience4j
  • Docker
  • Swagger
  • Actuator, Prometheus, Grafana

SOLUTION DESIGN

App design solution

QUICK START

To begin, you need to build the project using Gradle:

./gradlew clean build

Now, you need to run the following command to launch the microservices in Docker:

docker-compose -f docker/docker-compose.yml up

To facilitate testing, I have prepared test data for you to authenticate as an administrator, which is available at the following path: auth-server/src/main/resources/db/changelog/test_data.sql. Below, I am attaching credentials for admin user.

  • username: admin
  • password: password

Please keep in mind that you can use the following endpoints for user registration/login.

POST /v1/auth/register

{
    "username": "username",
    "email": "email",
    "password": "password"
}

POST /v1/auth/login

{
    "username": "username",
    "password": "password"
}

⚠️ To send a request to any endpoint, use ${host}:8080/api, where by default ${host} = localhost. For example: http://localhost:8080/api/v1/users.


SPRING CLOUD CONFIG

By default, the native profile is used, but you can use either Vault or Git (https://github.com/leonidrakitin/parceldelivery-configs.git).


DOCUMENTATION: SWAGGER UI

img.png

Documentation is available on /swagger-ui.html

config-server/gateway-server.yml:
springdoc:
  swagger-ui:
    disable-swagger-default-url: true
    url: /v3/api-docs/swagger-config
    configUrl: /v3/api-docs/swagger-config
    urls:
      - url: /order-service/v3/api-docs
        name: Orders API
      - url: /delivery-service/v3/api-docs
        name: Deliveries API
      - url: /auth-server/v3/api-docs
        name: Authentication API

TODO:

  • Sonar Qube
  • Spring Cloud Sleuth, Zipkin, ELK
  • Keycloak
  • Spring Email