A prototypical Java-based microservice demonstrating API-first development approach, and a possible code-organization strategy. This app can serve as a base template and can be extended into a fully-functional microservice.
- The web-application is broken into six modules:
- api - Responsible for defining Api-specification. Current snapshot demonstrates only explicit definition of the Api-spec(i.e. no generators).
- config - Anything which is platform-related can live inside this module. For example- datasource configuration, security config, etc.
- core - This module hosts business services. It exposes its functionality via a set of business services.
- api-impl - It realizes the Api-specification using the business-services provided by the core module.
- deployable - This module acts as a packager and packages the web-app into a deployable artifact.
- db-migration - It is a standalone module which contains scripts for datasource migration. By default, it runs in a detached manner, to decouple app-deployment from datasource-migration.
The application resides in spring-boot ecosystem, thus it takes advantage of spring's autoconfiguration. To be specific it uses following library/framework dependencies-
- HATEOAS
- Spring Data
- Flyway Migration
- JDK 13
- Gradle