Kotlin Clothing Webshop is Kotlin Multiplatform application. My main goal with the project to learn more and show that how Kotlin Multiplatform can be used to create complex applications. The project includes:
- A backend created with ktor, providing a GraphQL API, generating recommendations using KotlinDL with an ONNX model, persisting data into a PostgreSQL database using R2DBC API, with asynchronous code implemented with Kotlin Coroutines. The backend and the database management system it uses can be run with Docker compose.
- A Kotlin Multiplatform client with common Compose Multiplatform user interface, and GraphQL communication implemented with Apollo Kotlin library.
- An exploratory data analysis Kotlin Notebook.
- An IPython (Jupyter) Notebook containing recommendation system model inspection created with Pandas, PyTorch, Weights and Biases.
Currently, the repository contains an implementation of the proof of concept demo version of the webshop application.
The next release (1.0.0) will contain:
- Basic authentication and user management
- Clothing article browsing
And the following release (1.1.0) will contain:
- Improvements to the recommendation model inspection Jupyter Notebook
- Update of the usage of the recommendation model on the backend
The backend requires JDK 17 and Docker to be installed.
Both the Android and JVM application requires JDK 17 to be installed. To build and install the Android application it is also recommended to install Android Studio.
To run the web application, you need to have a browser installed with WebAssembly Garbage Collection Support (WasmGC). Please refer to the related official site for more information about supported browsers.
To check that you have the required dependencies to build and run the iOS application, use the KDoctor tool.
Install IntelliJ IDEA and install and enable the Kotlin Notebook and Jupyter IntelliJ IDEA plugins.
Install Python, and the dependencies declared in requirements.txt, and a IPython (Jupyter) Notebook editor software, e.g. PyCharm.
This section provides instructions on how to use the project, including commands to create artifacts or run it. The only supported setup of the system is when the backend and the client application is running on the same host, or in the case mobile applications when the simulator and emulator is running on the same host.
The recommended way to run the backend is to use the Forced build: docker-compose.yaml custom configuration in IntelliJ IDEA or Android Studio. This configuration always rebuilds the backend, and also runs necessary preprocessing gradle tasks (e.g. copying source code into the rootProject folder to make it accessible from Docker build context). If you don't want to rebuild the backend (if not necessary), use Build: docker-compose.yaml configuration.
The backend will be available on http://localhost:5400 and the PostgreSQL database on http://localhost:5432.
Before the client applications could be built, the GraphQL schema must be downloaded to the required place. The easiest way to do this, is to run the downloadKotlinClothingWebshopApolloSchemaFromIntrospection gradle task. Before running the task, make sure that the backend is running.
- Android application
-
The easiest way to run the android configuration in Android Studio. But you can also use gradle tasks from IDE or using the gradlew to generate an apk:
./gradlew android:assemble
The apk will be generated in android/build/outputs/apk/, and in that folder for each build type (currently debug and release is defined) there will be a folder that will contain the apk built with the related build type. And then this apk can be installed onto the running emulator using adb with following command:
adb install android-debug.apk
-
- JVM Desktop application
- To run the JVM Desktop application run the desktop:run gradle task.
- iOS application
- Open the Xcode project from the iosApp folder, and build and run it using Xcode.
- Web application
- To run the Web application run the wasmWebClient:wasmJsBrowserRun gradle task.
Open the notebook in IntelliJ IDEA.
Open your notebook with your preferred Jupyter Notebook editor tool.
This project follows the principles of Semantic Versioning (SemVer).
- The T-Shirt logo in the application's icon is from svgrepo
- The application icon resources were generated using IconKitchen
Thank you for your interest in contributing to this project! At the moment, the repository is not open to external contributions. However, this may change in the future as the project evolves. Stay tuned for updates!