Skip to content

itsJohnCnstn/service-template

Repository files navigation

Service Template

Service template for new microservices.

Tech Stack

  • Java 21
  • Gradle
  • Spring Boot (Web, Data JPA)
  • OpenAPI
  • PostgreSQL + Flyway
  • Docker + Docker Compose
  • Spring Test + JUnit 5 + Mockito + AssertJ + Testcontainers
  • Lombok, MapStruct

Architecture

PostgreSQL was chosen as the database. It's is an open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.

Openapi was chosen for designing, building, documenting and consuming REST APIs.

Kotlin was chosen for configuring Gradle.

CheckStyle, Jacoco and Pmd plugins were chosen for supporting quality and reliable code.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Project requires Java 21, Make, Docker.

Installing

Instructions for Java: AdoptOpenJDK installation

Instructions for Docker: Docker installation

Instructions for Make: Install make on Windows

Build the project:

Running with Make

Running infra using docker-compose

make docker-compose-up-infra

Running everything using docker-compose

make docker-compose-up

Contributing

When adding new feature to project make sure code satisfies rules made with CheckStyle, Pmd plugins. Useful documentation:

For CheckStyle: CheckStyle Rules

For Pmd: Pmd Java Rules

Also, minimal test coverage must be 75%. For more information visit Jacoco Documentation