-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
211 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
// For this template purpose it makes sense to define these plugins here | ||
// TODO do not forget to include this plugins when decoupling template modules into their own repositories | ||
allprojects { | ||
// https://docs.gradle.org/current/userguide/idea_plugin.html | ||
apply plugin: 'idea' | ||
// https://docs.gradle.org/current/userguide/idea_plugin.html | ||
apply plugin: 'idea' | ||
|
||
// https://docs.gradle.org/current/userguide/java_plugin.html | ||
apply plugin: 'java' | ||
// https://docs.gradle.org/current/userguide/java_plugin.html | ||
apply plugin: 'java' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Platform Library | ||
|
||
Defines common structural components of the service. | ||
|
||
Typically, this library should define the most generic and general components for any service to use within a company: | ||
|
||
- Web server to handle HTTP requests. | ||
- Configuration reader. | ||
- Database connection pool. | ||
- Message bus connection primitives. | ||
- And many more. | ||
|
||
> It is also a very good idea to create a separate project to maintain Bill of Materials which would define dependency | ||
> versions for additional control. | ||
## Dependencies offered by default | ||
|
||
`build.gradle` in this project defines `api` dependencies split into sections, where seconds commented with | ||
`PREFERENTIAL` can and should be replaced to suit your needs. | ||
|
||
### Core | ||
|
||
- [Javalin](https://javalin.io/) as a web server core: | ||
- Check out [TechEmpower benchmarks](https://www.techempower.com/benchmarks) for more | ||
options. [Jooby](https://jooby.io/) is a very viable replacement here. | ||
- [jOOQ](https://www.jooq.org/) as a way to talk to the database in pure SQL. | ||
- [Flyway](https://www.red-gate.com/products/flyway/) as a database migration tool which also leverages SQL. | ||
|
||
### Optional | ||
|
||
- [Inject](https://github.com/SuppieRK/inject) as a standalone dependency injection library: | ||
- This can be a nice Quality of Life addition, but with enough attention to details can be removed - after all any | ||
direct object creation will be much faster than any reflection-based Dependency Injector. | ||
- If you are adamant on the need for Dependency Injection, as alternative I would personally recommend checking out | ||
a set of libraries from [Avaje](https://avaje.io/inject/). | ||
- [Gestalt](https://gestalt-config.github.io/gestalt/) as a customizable configuration library: | ||
- Alternatively you can directly read and parse configuration file using Jackson / SnakeYaml to reduce clutter. | ||
|
||
### Code health | ||
|
||
- [Spotless](https://github.com/diffplug/spotless) to maintain code formatting rules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Platform Gradle Plugin | ||
|
||
Defines common plugins and dependencies for services. | ||
|
||
It is a good idea to package this plugin with: | ||
|
||
- Platform library. | ||
- Additional glue and settings for the plugins provided. | ||
|
||
## Dependencies offered by default | ||
|
||
### Core | ||
|
||
- [Javalin Swagger](https://javalin.io/tutorials/openapi-example) to provide API documentation for consumers. | ||
- [Google JIB](https://github.com/GoogleContainerTools/jib) to build deployable Docker image artifact. | ||
- [jooq-java-class-generator](https://github.com/SuppieRK/jooq-java-class-generator) to glue Flyway and jOOQ together. | ||
- There are other alternatives to this plugin as well! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
rootProject.name = 'platform-plugin' | ||
|
||
// Refers to a platform library project which allows further decoupling, if needed | ||
includeBuild '../platform-library' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Service | ||
|
||
Defines an example of how typical service implementation can look like. | ||
|
||
The core idea here is to reduce as much setup as we can with platform functionality - leaving developer's focus on a | ||
business task at hand. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
rootProject.name = 'service' | ||
|
||
// Refers to platform projects which allows further decoupling, if needed | ||
includeBuild '../platform-plugin' | ||
includeBuild '../platform-library' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.