# Let Koin Shape your Application Architecture

DevFeed: [Let Koin Shape your Application Architecture](<https://devfeed.tech/articles/let-koin-shape-your-application-architecture-22974.md>)

Original publisher: [Read original article](<https://blog.insert-koin.io/let-koin-shape-your-application-architecture-9cd60b1e02b0?source=rss----925561f2ecdf---4>)

Author: Gabriel Bronzatti Moro

Published: 2026-07-06T12:01:01Z

Content type: tutorial

Language: en

Sources: [Koin developers - Medium](<https://devfeed.tech/sources/koin-developers-medium.md>)

Topics: [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>), [coding](<https://devfeed.tech/topics/coding.md>), [Software](<https://devfeed.tech/topics/software.md>), [Ktor](<https://devfeed.tech/topics/ktor.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [clean-architecture](<https://devfeed.tech/tags/clean-architecture.md>), [developer](<https://devfeed.tech/tags/developer.md>), [koin](<https://devfeed.tech/tags/koin.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [ktor](<https://devfeed.tech/tags/ktor.md>), [software](<https://devfeed.tech/tags/software.md>), [software-architecture](<https://devfeed.tech/tags/software-architecture.md>), [software-design](<https://devfeed.tech/tags/software-design.md>)

## AI overview

This tutorial explains how Koin can support application architecture based on Clean Architecture and software design practices. It describes using Koin to create and manage object instances, including singleton and factory definitions, with Ktor's HttpClient as an example.

## Source excerpt

Hey, friends! 👋 Today we're going to explore application architecture and how Koin can help us build scalable, maintainable applications by applying the principles of Clean Architecture and other software design best practices. Application architecture is a fundamental skill for every software engineer. A well-designed architecture makes applications easier to understand, test, extend, and maintain as they grow over time. A collection of LEGO towers in various stages of construction -- Unsplash by richard_heFoundation When we think about software architecture, we often picture layered diagrams -- data, domain, and presentation -- along with classes such as use cases, handlers, repositories, and helpers. But how do all these components work together? How do we establish a reliable communication protocol between them? Architecture is more than just organizing classes into packages. It's about defining how objects communicate and collaborate working toward a common goal. With that in mind, let's begin our journey with a simple principle: Every object instance should be created by Koin. My only responsibility as a developer is to describe how each object should be instantiated, while Koin takes care of the creation process.SingletonSingleton Café generated by ChatGPT Koin makes it easy to define singletons, whether you're using the @Single annotation or the single { ... } DSL. By declaring a singleton, you're telling Koin to create and manage a single instance of that object for the lifetime of the application. In the example below, we define an HttpClient as a singleton: @Module class NetworkModule { @Single fun provideHttpClient(): HttpClient { return HttpClientBuilder.build( baseUrl = BuildKonfig.HOST, ) } ... } HttpClient is a class provided by Ktor, and it should typically be instantiated only once. By declaring it as a singleton, Koin ensures that the same HttpClient instance is shared throughout the application. The Singleton pattern is commonly used for objects tha