Write

How to use an in-memory database for testing on Ktor

SERIES: Building a backend with Ktor Part 1: Structuring a Ktor project Part 2: How to persist Ktor logs Part 3: How to use an in-memory database for testing on Ktor Part 4: How to handle database migrations with Liquibase on Ktor Part 5 Generate API documentation from Swagger on Ktor Part 6: How to schedule jobs with Quartz on Ktor Part 7: Moving from mobile to backend development with Ktor Usually, in a backend project, there are different instances of the same database: one for production (or more than one, it depends on the architecture), one for staging, and a local one that runs in the development machine....

Building an XCFramework on Kotlin Multiplatform from Kotlin 1.5.30

A few days ago, Kotlin 1.5.30 has been released. One of the features contained in the release is the official support for XCFrameworks on Kotlin Multiplatform. XCFramework is a binary that can contain multiple platform-specific variants (even for iOS and macOS at the same time). It has been introduced by Apple during the WWDC 2019 as a replacement for FatFrameworks. Before Kotlin 1.5.30, an XCFramework could be created only by running the xcrun command that will pack the frameworks for every different required platform into an XCFramework....

How to build an XCFramework on Kotlin Multiplatform

When you start integrating Kotlin Multiplatform (I’ll call it KMP in the rest of the article) in an existing project you most likely don’t have a mono-repo structure (and making a refactor to achieve this kind of architecture will not be easy). An example of architecture is the following, with a repository for every platform. To understand how to integrate KMP into existing code, give a look at my previous article: “Introducing Kotlin Multiplatform in an existing project”...

Connect to Open VPN during Gitlab Pipeline

Gitlab CI/CD offers the possibility to create a pipeline, which runs when something changes in the repository. A pipeline consists of one or more stages that run in order and in these stages, for example, it is possible to build the project, run the tests, create the artifacts, etc. For more information about Gitlab CI/CD, I suggest you look over the documentation. These out-of-the-box solutions really simplify the work to be done to have a CI up and running....

How to persist Ktor logs

SERIES: Building a backend with Ktor Part 1: Structuring a Ktor project Part 2: How to persist Ktor logs Part 3: How to use an in-memory database for testing on Ktor Part 4: How to handle database migrations with Liquibase on Ktor Part 5 Generate API documentation from Swagger on Ktor Part 6: How to schedule jobs with Quartz on Ktor Part 7: Moving from mobile to backend development with Ktor Logs are a vital part of software development....

Structuring a Ktor project

SERIES: Building a backend with Ktor Part 1: Structuring a Ktor project Part 2: How to persist Ktor logs Part 3: How to use an in-memory database for testing on Ktor Part 4: How to handle database migrations with Liquibase on Ktor Part 5 Generate API documentation from Swagger on Ktor Part 6: How to schedule jobs with Quartz on Ktor Part 7: Moving from mobile to backend development with Ktor It’s been a few months since I’ve started working with Ktor to build the backend of Revelop....

My audio & video setup after 4 years of remote working

I’ve been working remotely for a while and during these years I kept improving my work setup. During the last year, I’ve also increased the overall video and audio quality and now I’m pretty confident I’ve ended up with something worth sharing. A little note before moving on. Some gears I will share are cheap and others are expensive but I think that every product is one of the best that can be found in its price range....

Introducing KMP FatFramework Cocoa, a Gradle plugin for iOS FatFramework

Today I want to share KMP FatFramework Cocoa, a Gradle plugin for Kotlin Multiplatform projects that generate a FatFramework for iOS targets and manages the publishing process in a CocoaPod Repository. The plugin is born from a set of unbundled Gradle tasks that I wrote to manage the building and the publishing process of Kotlin Multiplatform libraries for iOS that we use at Uniwhere and Revelop. The libraries are published in a FatFramework that contains the code for every required architecture (real devices use the Arm64 architecture, while the simulator uses the host computer architecture which in most of the cases is X64)....

Introducing Kotlin Multiplatform in an existing project

After discovering a new interesting technology or framework, you will probably start asking yourself how to integrate it into an existing project. That’s because, the possibility to start with a blank canvas is rare (not impossible, but rare). This is also the case for Kotlin Multiplatform (I’ll call it KMP in the rest of the article). When starting a new blank KMP project it is easier to have a mono-repo structure like this:...

Migrating old artifacts from JCenter to MavenCentral

As you may have heard, JCenter is shutting down in May 2021. Into the Sunset on May 1st: Bintray, JCenter, GoCenter, and ChartCenter https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/ So, if you are using JCenter as the repository for your libraries (as me), it’s time to migrate. In this article, I will not go through the publishing process of a library to MavenCentral, because there are already plenty of resources available. For example, I followed the one written by Márton Braun....

Running a blog with iPad

It’s been a few years since I started writing this blog, and I quite like sharing my thoughts and experiences. After a short while spent on Medium, I decided I wanted to be the sole owner of my content, so I started experimenting with different solutions and ideas. After I finally landed on the “perfect” tech architecture (I know, I’m lying. There’s no perfect solution and Future Me will most likely refactor and (over)re-engineer the current solution), I started to seek the “perfect” writing setup....

Using Retrofit and Alamofire with Kotlin Serialization on Kotlin Multiplatform

If you are starting a project with Kotlin Multiplatform and you want to share the network layer, the best way to go is definitely with Ktor. But if you don’t want to share the entire network layer but maybe only the DTOs? There could be many reasons for wanting this. Maybe you are starting to integrate Kotlin Multiplatform (I’ll call it KMP in the rest of the article) into an existing project and the work for sharing the entire network layer is simply too much....