Kotlin Multimodule Template
A minimal, production-ready Kotlin multimodule template for Spring Boot applications with proper Spring-Kotlin integration, comprehensive testing, and GitHub template features.
π― Overview
This template provides a clean foundation for creating scalable Kotlin microservices with:
- Simple 2-module architecture (service + application layers)
- Spring-Kotlin integration with
allopen
plugin configured - Dependency locking for reproducible builds
- Comprehensive testing setup with unit test grouping
- GitHub template ready with customization scripts
- Production-ready CI/CD and security scanning
π Quick Start
1. Use This Template
Click βUse this templateβ button on GitHub to create your new repository.
2. Customize Your Project
# Linux/Mac
./customize.sh
# Windows PowerShell
./customize.ps1
3. Build and Run
./gradlew build
./gradlew :springboot-application:bootRun
4. Test Your Setup
curl http://localhost:8080/api/example/health
π Documentation Sections
Getting Started
- Template Setup Guide - Step-by-step customization
- Project Structure - Understanding the architecture
- Dependency Management - Gradle locks and versions
Development
- Unit Testing Guide - Testing strategies and grouping
- Spring-Kotlin Integration - Allopen plugin and beans
- Code Quality - Coverage, security, and style
CI/CD & Deployment
- GitHub Workflows - Automated testing and deployment
- Branch Protection - Repository security
- Commit Conventions - Git workflow standards
Reference
- API Documentation - Module APIs and interfaces
- Troubleshooting - Common issues and solutions
ποΈ Architecture
Current Modules
- service-module: Business logic and services with Spring annotations
- springboot-application: REST controllers and application configuration
Key Features
- β
Spring Bean Creation: Kotlin
allopen
plugin configured for Spring annotations - β
Dependency Injection: Works seamlessly with
@Service
,@Controller
annotations - β
Transaction Management:
@Transactional
support with AOP proxies - β Reproducible Builds: Dependency locking enabled
- β Modular Testing: Unit tests grouped by scope and performance
π§ͺ Testing Strategy
This template includes comprehensive testing setup:
# Run all tests
./gradlew test
# Run specific test groups
./gradlew test --tests "*Unit*"
./gradlew test --tests "*Integration*"
# Performance tests
./gradlew jmh
π¦ Dependency Management
Uses Gradle dependency locking for reproducible builds:
# Update locks after adding dependencies
./gradlew resolveAndLockAll --write-locks
# Check for dependency updates
./gradlew dependencyUpdates
π Security
- Dependency vulnerability scanning with OWASP
- License compliance checking
- GPG commit signing (optional)
- Branch protection for main branches
π Getting Help
- π Full Documentation
- π Issue Tracker
- π¬ Discussions
- π§ Contributing