Kotlin Library Structure

Client Library Structure (akn-kotlin-sdk)

UI library package structure
Figure 1. Client library package structure
  • models: This is where all the data objects go like the data transfer objects. Under aggregates the complete models go similar to container in the java backend api and modle in the ts-lib. The dbschema is the raw data classes for the database tables.

  • services: These are the service classes with the structure of network calls for different service needs.

  • utils: Files with common functions and code to be used in the network context go here.

UI Library Structure (akn-kotlin-sdk-mobile-lib)

This library has a dependency on the previous kotlin client sdk library.

UI library package structure
Figure 2. UI library package structure
  • component: This is where all the common jetpack compose UI components used within all the mobile app are placed.

  • core.sharedprefrence: Stores all the relevant files for shared preferences used for data persistance like saving the login state and auth token. This holds all the common preferences for all the mobile apps like login state.

  • destination: The navigation destination definitions for the mobile apps go here.

  • di: This is where all the source code for dependency injection go.

  • repository: This is where all repository classes go which is part of the MVVM design pattern.

  • screens: This is where all the differnt screens in the mobile app go. Each screen has a designated folder with a file for the screen UI and another file for the screen’s corresponding view model which is an android component and part of the MVVM design pattern.

  • utils: Files with common functions and code to be used in the common UI context go here.

  • widgets: Common mobile app UI widgets go here.