Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SuppieRK committed Dec 25, 2024
0 parents commit d008976
Show file tree
Hide file tree
Showing 32 changed files with 1,962 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Code sample to reproduce the behavior

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEAT]"
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
All Submissions:

* [ ] Have you checked to ensure there aren't other open [Pull Requests](../../../pulls) for the same update/change?

### Changes to Core Features:

* [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
49 changes: 49 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle for general purposes

on:
workflow_dispatch: {}
push:
branches:
- '**'
paths-ignore:
- '**.yml'
- '**.md'
- '**/gradle-wrapper.jar'
- '**/gradle-wrapper.properties'
- '**/gradlew'
- '**/gradlew.bat'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17

- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4

- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Build with Gradle
run: ./gradlew build
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# JIQS

Includes
- Javalin
- jOOQ
- Flyway
- Gestalt
- Inject
- Spotless

Add Swagger (use interface to separate annotations from the actual controller)
198 changes: 198 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
import java.nio.charset.StandardCharsets

plugins {
// https://docs.gradle.org/current/userguide/idea_plugin.html
id 'idea'

// https://docs.gradle.org/current/userguide/java_plugin.html
id 'java'

// https://plugins.gradle.org/plugin/io.github.suppierk.jooq-java-class-generator
id 'io.github.suppierk.jooq-java-class-generator' version "$jooqJavaClassGeneratorVersion"

// https://plugins.gradle.org/plugin/com.diffplug.spotless
id 'com.diffplug.spotless' version "$spotlessVersion"

// https://docs.gradle.org/current/userguide/jacoco_plugin.html
id 'jacoco'

// https://plugins.gradle.org/plugin/com.google.cloud.tools.jib
id 'com.google.cloud.tools.jib' version "$jibVersion"
}

repositories {
mavenCentral()
}

dependencies {
// ===============================
// ===== COMMON DEPENDENCIES =====
// ===============================

// https://mvnrepository.com/artifact/io.javalin/javalin-bundle
implementation group: 'io.javalin', name: 'javalin-bundle', version: javalinVersion

// https://mvnrepository.com/artifact/io.javalin.community.openapi/javalin-openapi-plugin
implementation group: 'io.javalin.community.openapi', name: 'javalin-openapi-plugin', version: javalinVersion

// https://mvnrepository.com/artifact/io.javalin.community.openapi/openapi-annotation-processor
annotationProcessor group: 'io.javalin.community.openapi', name: 'openapi-annotation-processor', version: javalinVersion

// https://mvnrepository.com/artifact/io.javalin.community.openapi/javalin-swagger-plugin
implementation group: 'io.javalin.community.openapi', name: 'javalin-swagger-plugin', version: javalinVersion

// https://mvnrepository.com/artifact/io.github.suppierk/inject
implementation group: 'io.github.suppierk', name: 'inject', version: injectVersion

// https://mvnrepository.com/artifact/com.github.gestalt-config/gestalt-core
implementation group: 'com.github.gestalt-config', name: 'gestalt-core', version: gestaltVersion

// https://mvnrepository.com/artifact/com.zaxxer/HikariCP
implementation group: 'com.zaxxer', name: 'HikariCP', version: hikariVersion

// https://mvnrepository.com/artifact/org.jooq/jooq
implementation group: 'org.jooq', name: 'jooq', version: jooqVersion

// https://mvnrepository.com/artifact/org.flywaydb/flyway-core
implementation group: 'org.flywaydb', name: 'flyway-core', version: flywayVersion

// =====================================
// ===== PREFERENTIAL DEPENDENCIES =====
// =====================================

// https://mvnrepository.com/artifact/com.github.gestalt-config/gestalt-yaml
implementation group: 'com.github.gestalt-config', name: 'gestalt-yaml', version: gestaltVersion

// https://mvnrepository.com/artifact/org.flywaydb/flyway-database-postgresql
implementation group: 'org.flywaydb', name: 'flyway-database-postgresql', version: flywayVersion

// https://mvnrepository.com/artifact/org.postgresql/postgresql
implementation group: 'org.postgresql', name: 'postgresql', version: postgresVersion

// https://mvnrepository.com/artifact/org.postgresql/postgresql
jooqGenerator group: 'org.postgresql', name: 'postgresql', version: postgresVersion

// https://mvnrepository.com/artifact/com.github.f4b6a3/uuid-creator
implementation group: 'com.github.f4b6a3', name: 'uuid-creator', version: uuidCreatorVersion

// =============================
// ===== TEST DEPENDENCIES =====
// =============================

// https://mvnrepository.com/artifact/org.junit/junit-bom
testImplementation platform(group: 'org.junit', name: 'junit-bom', version: junitVersion)

// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter'

// ==========================================
// ===== PREFERENTIAL TEST DEPENDENCIES =====
// ==========================================

// https://mvnrepository.com/artifact/org.testcontainers/postgresql
testImplementation group: 'org.testcontainers', name: 'postgresql', version: testcontainersVersion

// https://mvnrepository.com/artifact/nl.jqno.equalsverifier/equalsverifier-nodep
testImplementation group: 'nl.jqno.equalsverifier', name: 'equalsverifier-nodep', version: equalsVerifierVersion
}

// Setup Flyway database migration
// https://documentation.red-gate.com/fd/gradle-task-184127407.html
flyway {
driver = databaseDriverClassName
}

// Setup jOOQ code generation
// https://github.com/etiennestuder/gradle-jooq-plugin?tab=readme-ov-file#configuring-the-jooq-generation-tool
jooq {
version = jooqVersion

configurations {
main {
generationTool {
logging = org.jooq.meta.jaxb.Logging.WARN

generator {
database {
name = databaseJooqGeneratorClassName
}

generate {
fluentSetters = true
}

target {
packageName = databaseJooqGeneratedClassesPackageName
}
}
}
}
}
}

java {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion

toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}

// Enable Spotless code formatting rules
// https://github.com/diffplug/spotless/tree/main/plugin-gradle
spotless {
java {
target '**/*.java'

// Aligns with Intellij IDEA default settings
toggleOffOn('@formatter:off', '@formatter:on')

googleJavaFormat()
}

groovyGradle {
target '**/*.gradle'

greclipse()
}
}

test {
dependsOn spotlessCheck
finalizedBy jacocoTestReport

useJUnitPlatform()
}

jacocoTestReport {
// Tests are required to run before generating the report
dependsOn test

reports {
html.required = true
xml.required = true
csv.required = false
}

afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: "${databaseJooqGeneratedClassesPackageName.replace('.', '/')}/**")
}))
}
}

jib {
from {
image = "eclipse-temurin:$javaVersion-alpine"
}
}

// Configure several tasks additionally for Gradle
tasks.withType(Copy).configureEach {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

tasks.withType(JavaCompile).configureEach {
options.encoding = StandardCharsets.UTF_8.name()
}
33 changes: 33 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Project properties
group=io.github.suppierk
version=1.0-SNAPSHOT
javaVersion=17

# Database properties
databaseDriverClassName=org.postgresql.Driver
databaseJooqGeneratorClassName=org.jooq.meta.postgres.PostgresDatabase
databaseJooqGeneratedClassesPackageName=io.github.suppierk.jiqs.db

# Plugin dependency properties
jooqJavaClassGeneratorVersion=1.0.1
spotlessVersion=6.25.0
jibVersion=3.3.2

# Common dependency properties
javalinVersion=6.4.0
injectVersion=1.1.0
gestaltVersion=0.35.1
hikariVersion=6.2.1
jooqVersion=3.19.16
flywayVersion=11.1.0

# Preferential dependency properties
postgresVersion=42.7.4
uuidCreatorVersion=6.0.0

# Test dependencies properties
junitVersion=5.11.4

# Preferential test dependencies properties
testcontainersVersion=1.20.4
equalsVerifierVersion=3.17.5
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading

0 comments on commit d008976

Please sign in to comment.