Skip to content

ivvan62/agile-practices-application

 
 

Repository files navigation

Application architecture

structure

puml
@startuml
frame frontend
frontend -> tomcat

database DB #white
database MQ #white
component [LegacyRestService] #white

frame backend {
  frame tomcat {
    component [SpringMVC] #white
    
    frame spring {
      component [RestTemplate] #white
      component [JpaProvider] #white
      component [JdbcTemplate] #white
      
      frame "application feature" {
        component [Repository] <<codegened>> #lightgray
        [Controller] -> [Service]
        Service -> [Repository]
        Repository --> JpaProvider
        JpaProvider --> JdbcTemplate
        
        Service --> RestTemplate
        RestTemplate -> LegacyRestService
      }
    }
    
    component [DbConnectionPool] #white
    JdbcTemplate --> DbConnectionPool
    DbConnectionPool -> DB
    
    spring ..> Controller
    spring ..> Service
    spring ..> Repository
    spring ..> JpaProvider
  }
  
  tomcat -> SpringMVC
  SpringMVC -> Controller
}


@enduml

Setup Maven configuration [in case of corporate Maven repo]

vi maven-settings.xml
cp maven-settings.xml $M2_HOME/conf/settings.xml

Build with Maven or Gradle

mvn clean verify [-DexcludedGroups="nope" -Dgroups=""]
gradle clean check bootJar [jacocoTestReport pitest -i --scan --no-build-cache -DexcludedGroups='nope' -Dgroups=""]

Run app with embedded DB

java -Dderby.stream.error.file=log/derby.log -jar target/dbo-1.0-SNAPSHOT.jar --spring.profiles.active=qa

open http://localhost:8080/dbo/swagger-ui/

Run app with stand-alone server DB

target/db-derby-10.13.1.1-bin/bin/startNetworkServer &
java -jar target/dbo-1.0-SNAPSHOT.jar --spring.profiles.active=qa2

Run legacy system stub while QA [optional]

cd target/test-classes # cat mappings/legacyAccountingSystemResponse.json
java -jar wiremock-jre8-standalone-2.26.3.jar --verbose --port 8888 # curl localhost:8888/api/account

Build and run Docker container for Application [optional]

docker build -t acme/dbo:1.0-SNAPHOT-it .

docker run -d -p 8080:8080 --name dbo acme/dbo:1.0-SNAPHOT-it
docker exec -it dbo /bin/sh
docker rm dbo -f

Application graceful shutdown

curl --request POST http://localhost:8080/dbo/actuator/shutdown

About

Demo application codebase for Agile Practices training.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 98.2%
  • Gherkin 1.5%
  • Dockerfile 0.3%