Skip to content

lengors/kotlin-service-template

Welcome to Kotlin Service Template · GitHub license Quality Gate Status

Welcome to kotlin-service-template, a flexible starting point for creating service applications written in Kotlin. This template is designed to streamline the setup process for new Kotlin projects, incorporating essential plugins and dependencies to get you up and running quickly.

Features

  • Dependencies: Preconfigured with JUnit.
  • Plugins: Includes Dokka, Kotlinx-kover, Ktlint and Shadow.
  • Branching Strategy: Four branches (main, beta, alpha, and dev) to manage different stages of development and release.
  • CI/CD Pipelines: Automated checks for code style, build, testing, static code analysis, publishing, deployment and documentation updates.

Getting Started

Clone the repository

git clone https://github.com/lengors/kotlin-service-template.git
cd kotlin-service

Build the project

Ensure you have Gradle and JDK installed. Run:

./gradlew clean build

Run tests

./gradlew clean test

Usage

This template is designed to be as customizable as you need. You can modify dependencies, plugins, or other configurations to suit your specific project needs.

Configuration

  • Documentation: Ensure you update all the repository references for the automated generation of documentation via Dokka.
  • Publishing Releases: The publishing action relies on semantic-release and semantic-release-action. The .releaserc.yml file defines the release pipeline and automates versioning based on semantic versioning.
  • Jar Builds: The Gradle's Shadow plugin generates a fat jar. For it to work properly, please update the the main class setting.
  • Dockerfile: A dockerfile in the root directory is used to automatically deploy a docker image to GitHub Packages. Update it as it best fits your use case.

Documentation and Resources

For detailed guides and additional information, please refer to our GitHub Wiki.

If you wish to check an example of the generated API documentation, visit the Dokka generated reference page.

Contributing

Contributions are welcome! Please refer to our Contribution Guidelines for more information on how to get involved.

License

This project is licensed under The Unlicense, which places it in the public domain.