Skip to main content
Version: v0.10

Amazon App Platform, Kotlin module structure, and Dependency Injection

We standardize our Kotlin Gradle module structures on Amazon App Platform and use kotlin-inject along with kotlin-inject-anvil for dependency injection. This page provides an overview and links to the official resources.

Amazon App Platform

Amazon App Platform provides opinionated, scalable foundations for modular Kotlin applications (multi-module Gradle setup, conventions, and build tooling).

info

Why we use app platform:

  • Consistent Kotlin Gradle module conventions across the codebase
  • Scaffolding and patterns for modularization and reuse
  • Guidance that plays well with modern DI and codegen

Dependency Injection

We use a lightweight, compile-time DI approach with kotlin-inject, augmented by Amazon's kotlin-inject-anvil integration where appropriate.

kotlin-inject

kotlin-inject is a Kotlin-first, compile-time DI library that generates factories and wiring based on annotations. It avoids runtime reflection and keeps runtime fast.

note

kotlin-inject-anvil (Amazon)

kotlin-inject-anvil provides tooling and integrations that complement kotlin-inject in larger modular setups, aligning well with Amazon App Platform module conventions.

How this fits together

  • Amazon App Platform defines the module structure, build plugins, and conventions we follow.
  • kotlin-inject provides the compile-time DI primitives (annotations, codegen) for our services/components.
  • kotlin-inject-anvil offers additional integration capabilities to scale DI across many modules following the platform conventions.