Skip to content

Server applications

2 applications. The application on Ktor is responsible for the API. The application on kotlinx-cli helps the API, makes backups, cleans outdated images, etc. The Kotlin Multiplatform module is connected to both of them, which connects them, gives access to the database and other features.

Build API

A typical application on Ktor. The exception is the general KM module. The module is responsible for the database and can make requests - there is a Ktor client on board. It connects to both the CLI and the API, which gives them both complete freedom of action.

The first thing to add is the Material icon. They are used in the Collections feature. To do this, move the folder with icons called material-icons to the root of the project. You can get them here.

After that, go to the configuration directory and rename the configuration files:

Rename demo configuration
mv _app.properties app.properties
mv dbconfig.properties dbconfig.properties

These files contain keys and various accesses. They are loaded while the application is running. Do not forget to change the keys in the prod. Create a MySql database and a user for it. We register accesses in dbconfig.properties

Go to the directory shop -> server -> api... Application.kt - run the application, it will crash, everything is ok. It will be added to the Build Configuration (you can use the handles if you like). Then we go to the build configuration and add the shared module artifact that will be built with the application. Now everyone can run it - everything should work.

Loading...

You can watch the build process on YouTube

Build CLI

Normal JVM application. Its task is to perform various useful actions, for example, to make a backup, using the * crone * commands. Go to shop -> server -> cli ... Main.kt. Let's start the application. Don't forget to add the artifact shared-jvm to the build.

Loading...

You can watch the build process on YouTube