package Ġio . github . jo a orre is . user api kotlin . infrastructure . dependency injection Ċ Ċ import Ġcom . mongodb . async . client . Mongo Client Ċ import Ġcom . mongodb . async . client . Mongo Collection Ċ import Ġcom . mongodb . async . client . Mongo Database Ċ import Ġio . github . jo a orre is . user api kotlin . application . services . UserService Ċ import Ġio . github . jo a orre is . user api kotlin . application . services . User ServiceImpl Ċ import Ġio . github . jo a orre is . user api kotlin . data . repository . UserRepository Ċ import Ġio . github . jo a orre is . user api kotlin . data . repository . UserRepository Impl Ċ import Ġio . github . jo a orre is . user api kotlin . domain . model . User Ċ import Ġio . ktor . config . Application Config Ċ import Ġorg . k oin . dsl . context . Context Ċ import Ġorg . k oin . dsl . module . Module Ċ import Ġorg . k oin . dsl . module . application Context Ċ import Ġorg . lit ote . km ongo . async . K Mongo Ċ Ċ class ĠK oin Module Factory ( private Ġval Ġsetup Presentation Dependencies : ĠContext .( Application Config ) Ġ-> ĠUnit ) Ġ{ ĊĊĠĠĠ Ġfun Ġcreate ( config : ĠApplication Config ): ĠModule Ġ= Ġapplication Context Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġmongo Db Con String : ĠString Ġ= Ġconfig . property (" Mongo Db . ConnectionString "). getString () ĊĠĠĠĠĠĠĠ Ġval Ġmongo Db Database Name : ĠString Ġ= Ġconfig . property (" Mongo Db . Database Name "). getString () ĊĊĠĠĠĠĠĠĠ Ġbean Ġ{ ĠUser ServiceImpl ( get ()) Ġas ĠUserService Ġ} ĊĠĠĠĠĠĠĠ Ġbean Ġ{ ĠUser Repository Impl ( get ()) Ġas ĠUser Repository Ġ} ĊĠĠĠĠĠĠĠ Ġbean Ġ{ ĠK Mongo . create Client ( mongo Db Con String ) Ġ} ĊĠĠĠĠĠĠĠ Ġbean Ġ{ Ġget < Mongo Client >(). get Database ( mongo Db Database Name ) Ġas ĠMongo Database Ġ} ĊĠĠĠĠĠĠĠ Ġbean Ġ{ Ġget < Mongo Database >(). get Collection (" users ", ĠUser :: class . java ) Ġas ĠMongo Collection < User > Ġ} ĊĊĠĠĠĠĠĠĠ Ġsetup Presentation Dependencies ( config ) ĊĠĠĠ Ġ} Ċ }