Skip to content

jonathanlermitage/manon

 
 

Repository files navigation


  1. Project
  2. Author
  3. Compilation and test
  4. License

Project

Some experimentation with Spring Boot 2, JDK8+, JUnit5, TestNG, SQL, NoSQL, Docker, ELK stack, etc. It demonstrates usage of:

  • Maven (latest version) and Gradle build tools
    • migration from Maven to Gradle (but I'll stick to Maven). Stable and functional, but still needs some improvements. See commit cf79b9c (spring5-mvn-to-gradle branch)
  • Spring Boot 2 (Spring Framework 5)
    • you can compare spring4 and spring5 branches to study migration from Spring Boot 1 (Spring Framework 4) to Spring Boot 2
  • built with JDK11 on Travis CI, targets JRE8 bytecode. See commit f778bf0 (spring5-light-jre8-with-jdk11 branch)
  • Spring Web with a REST API
  • Spring Security, to authenticate users via auth_basic and fetch authentication data from SQL database
  • Spring Data to serve data from a MongoDB database
  • Spring Batch to schedule and manage some tasks. See commit c0e3422 (spring5-light-batch branch)
  • Spring Cache via Redis for application, and prefer an embedded cache provider during tests. See commits a911f6a, 7e26822 and ae6e0e6 (spring5-redis branch)
  • integration tests and (some) unit-test via JUnit5 and REST Assured. I prefer TestNG for its keywords, dataproviders and maturity, but JUnit is the most used testing framework. REST Assured helped me to test API without Spring's magic
  • migration from MongoDB (used to store regular and authentication data) to MariaDB. See last commit of spring5-light-mongo-to-sql branch
  • migration to Java 8 new Date and Time API (JSR-310). See last commit of spring5-light-java8-datetime-api branch
  • integration with some free (for open-source) services like AppVeyor (Windows CI), Travis (Linux and MacOS CI), Cirrus (CI), CodeCov (code coverage), SonarCloud (code quality), LGTM (code quality)
  • Maven and Gradle wrappers, and a do Bash script that helps you to launch some usefull commands
  • code coverage thanks to JaCoCo Maven and Gradle plugin
  • some AOP to capture performance of API endpoints
  • Spring Actuator web endpoints configured
  • Swagger UI to provide documentation about REST API endpoints
    • run application and check http://localhost:8080/swagger-ui.html, authenticate with ROOT / woot. See commit 834852c (spring5-swagger branch)
  • Docker builds without Docker daemon thanks to Jib. Docker Compose support. Linux base image is Distroless
  • ELK stack (ElasticSearch Logstash Kibana) via Docker plus Docker Compose to parse application and Nginx logs, and Cerebro to monitor ElasticSearch node
  • integration with SpotBugs (FindBugs)
  • Spring Boot dependency management without Spring Boot parent POM. See last commit of spring5-light-spring-boot-dependencies branch

For fun and to show some skills 🐱

Author

Jonathan Lermitage (jonathan.lermitage@gmail.com)
Linkedin profile: jonathan-lermitage-092711142

Compilation and test

First, install JDK11 and Maven3+.

You can now use the ./do Linux Bash script:

do help         show this help message
do t            test without code coverage (with embedded MongoDB)
do tc           test with code coverage (with embedded MongoDB)
do sc           compute and upload Sonar analysis to SonarCloud
do tsc          similar to "do tc" then "do sc"
do sb           scan with SpotBugs then show GUI
do b            build without testing
do c            clean
do p            package application to manon.jar
do rd           package and run application with dev profile 
do w 3.5.2      set or upgrade Maven wrapper to 3.5.2
do cv           check plugins and dependencies versions
do uv           update plugins and dependencies versions
do dt           show dependencies tree
do rmi          stop Docker application, then remove its containers and images
do cdi          clean up dangling Docker images
do docker       build Docker image with Dockerfile to a Docker daemon
do jib          build Docker image with Jib to a Docker daemon
do jibtar       build and save Docker image with Jib to a tarball
do up           create and start containers via docker-compose
do stop         stop containers via docker-compose
do upelk        create and start ELK containers via docker-compose
do stopelk      stop ELK containers via docker-compose
do upcerebro    create and start Cerebro container via docker-compose
do stopcerebro  stop Cerebro container via docker-compose

Nota: the Linux Bash script can chain parameters, e.g.: ./do cdi rmi w 3.6.0 c tc docker up.
Nota: a Windows do.cmd script exists, but it's limited to some basic features (do t to do dt, no Docker support).

License

MIT License. In other words, you can do what you want: this project is entirely OpenSource, Free and Gratis.

About

🧪 Play with SpringBoot 2&3, JWT, Querydsl, GraphQL, Docker, ELK, PostgreSQL, MariaDB, Redis, MongoDB, Flyway, Maven, Gradle, TestNG, JUnit5, JaCoCo, GreenMail, CI, Quality Gates, Prometheus, Gatling, etc.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages