Skip to content

This is software responsible for managing wishlist of products for Axsilva MarketPlace customers.

Notifications You must be signed in to change notification settings

axsilva1991/wishlist

Repository files navigation

Wishlist-api-rest

Build codecov

This is software responsible for managing wishlist of products for Axsilva MarketPlace customers.

Frameworks

Usage

Run the app anyway

After download project with git clone command, and install all software required in your machine. Are you able to run wish docker-compose

Docker

Requirements for Run Application

Before start this application it's important you validate if your machine already has:

  • JVM 17
  • Gradle 8.7.0
  • Internet access to download the Gradle dependency and the image Docker
  • Communication port 8081 available on the computer

Run

$ docker-compose up --build -d

Shut down

Atention
Before running shutdown commands, make sure you have performed functional tests of the application.

$ docker-compose down

Kubernetes

Requirements for Run Application

  • Kubernetes cluster and access to docker hub registry

Run the app

Run command for create services and deployments

$ cd .kubernetes
$ /wishlist/.kubernetes> kubectl apply -f .\kubernetes\kubernetes_manifest.yaml

After run this commands access swagger to validate application its ok.

Test

Integration Test on Kubernetes

This application has integration tests running on kubernetes, if you want to see the results of the tests you need to run a kubernetes command below

kubectl logs -f deployment/wishlist-backend-k8s
Gradle Test Executor 1 finished executing tests.

> Task :test
Finished generating test XML results (0.032 secs) into: /usr/src/java-code/build/test-results/test
Generating HTML test report...
Finished generating test html results (0.044 secs) into: /usr/src/java-code/build/reports/tests/test

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 29s
4 actionable tasks: 4 executed

Integration Test on Docker

This project use Karate Framework to integration tests and excecute scenarios you need to start application and run commands start a integration tests image.

Atention
Because it is a integration test, it's work's if you run one time!
if you need to re-execute it, it is recommended to clean the database and restart the application.

Before running the automated tests, make sure your application is running, if necessary you can use the actuator resources.

Actuator health check

$ curl --location 'http://localhost:8081/actuator/health'

Response:

{
"status": "UP"
}

After this part you are able to run integration tests:

Run

$ cd ./integration-test
$ docker-compose up --build

After finishing the tests, this image will be interrupted.

Unit Test

After build application this app running unit tests with Junit, if you want to see results and coverage access codecov or see runner pipeline actions.

Documentation

Swagger

  • This project Using OpenAPI 3.0 specification if you whant to see a doc open swagger-ui in your Browser

Continuous integration

This application used GitHub Actions to inspect and improve code. Your steps are:

  • Build Gradle (Build application and run unit tests)
  • Upload code to Codecov
  • Build Docker Machine
  • Dependency Check Vulnerability's of dependencies.

Architecture

This part represents the C4 model context and container diagram and can help you better understand how the service will work.

Context

Screenshot

Container

Screenshot

Observability

  • To help debug errors, all transactions in this system generate "correlation-id" returned in the header of all calls without the need to capture customer data.
INFO [wishlist 66552f5f60ed62c781cf64d5a5b05541]  30300 --- [wishlist] [io-8081-exec-10] [66552f5f60ed62c781cf64d5a5b05541-81cf64d5a5b05541] b.c.a.m.wishlist.web.ProductController   : GET - /v1/wishlist/products/{clientId}
INFO [wishlist 66552f5f60ed62c781cf64d5a5b05541]  30300 --- [wishlist] [io-8081-exec-10] [66552f5f60ed62c781cf64d5a5b05541-81cf64d5a5b05541] b.c.a.m.w.i.WishListInputBoundary        : WishListUseCase.getProductBy(clientId)
INFO [wishlist 66552f5f60ed62c781cf64d5a5b05541]  30300 --- [wishlist] [io-8081-exec-10] [66552f5f60ed62c781cf64d5a5b05541-81cf64d5a5b05541] b.c.a.m.w.r.impl.WishListRepositoryImpl  : WishListRepositoryImpl.getProductBy(clientId)

Next Features

  • Improve number of the products on wishlist
  • Configure database on Cloud Provider
  • Deploy application on Cloud Provider
  • Use a manage secrets like as SecretManager and Keyvault
  • Create security roles and use an API Gateway
  • Include integration tests on pipeline after deploy

Contact Support

For more information, contact our technical department: anderson.xavier91@gmail.

About

This is software responsible for managing wishlist of products for Axsilva MarketPlace customers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages