A Kotlin Multiplatform and Compose template that allows you to easily set up your project targeting: Android, Desktop, and Web

Overview

alicerce

Hello 🌍 !

a-li-cerce, alicerce (that means foundation in Portuguese) was built to easily allow to setup a project where you're going to share both your business logic and your UI between an Android and a Desktop application. It takes advantage of Kotlin Multiplatform for the fist and Compose for the second.

Setup alicerce

In order to setup alicerce you'll need to install cookiecutter.

Once done you just to need to run over the root folder of this project:

cookiecutter .

You'll be prompted to define a set of variables for the project:

  • project [alicerce]:

Corresponds to your project name.

  • author [@cafonsomota]:

The author of the project: you 🙂 .

  • repo_name [com.cmota.alicerce]:

The package name of your project. Don't forget that you need to add at least a "." since it's mandatory by Android.

  • version [0.1]:

The project version.

  • description [alicerce brings KMP and Compose together so you can share everything between your Android and Desktop apps]:

A description of the project that you're going to build.

Note: The values between brackets are added by default if you don't enter anything.

Once you've filled all of these steps a new folder with the project name that you've defined is created.

You should open this folder in Android Studio.

Running your project

After the setup mentioned above, you need to open the newly created folder with Android Studio (remember that's this new folder and not alicerce root). Wait for the project to synchronize.

This initial synchronization might take a while, since you're going to fetch a lot of dependencies (for Kotlin Multiplatform and Compose).

Running your Android App

Once the synchronization ends, you can compile and run your android app by just clicking on the green arrow near Edit configurations on top.

Running your Desktop App

To run the desktop app you'll need to enter this command on the Terminal (you can use the one built in with Android Studio):

./gradlew :desktopApp:run

Mac OS

You need to have python installed. If you don't, run:

brew install python3

And add to the .bash_profile:

export PATH=$HOME/.local/bin:$PATH

Now to install cookiecutter you just need to run:

pip install --user cookiecutter

Windows

You need to have python installed. If you don't, go over to the official website, download and install the version that's compatible with your system.

When prompted, don't forget to select: "Add Python 3.7 to PATH", otherwise you'll need to do this manually.

You can now install cookiecutter via pip, for that run:

pip install cookiecutter

Note: in order to use this template you need to also have Java installed on your machine.

Project Structure

alicerce is divided into the following modules:

  • androidApp

Contains the AndroidManifest and your Android application activities.

  • desktopApp

Contains your Desktop app main application.

  • gradle

The Gradle wrapper use to compile the project

A library that allows to use ViewModel, LiveData and Navigation components both on Android and Desktop applications

  • shared-logic

The business logic of both applications. Network requests, local storage, etc. they should all be here.

  • shared-ui

The access to shared-logic and all the Composables that are going to be used to design both apps.

A port of the accompanist swiperefresh library that allows it to be use both on android and desktop.

Note: although precompose and swiperefresh are libraries that are published, currently those version don't support either being reused between android and desktop or the latest Compose/Kotlin version.

Contributions

Feel free to contribute! All PR are more than welcome as well as all suggestions to improve this template 🙌 .

You might also like...
An android application for creating a journal for subjects you studied and also you can set timer for break.
An android application for creating a journal for subjects you studied and also you can set timer for break.

Study Journal An android application for creating a journal for subjects you studied and also you can set timer for break between two consecutive subj

Kotlin multiplatform library template.

template-kmp-library Kotlin multiplatform library template. Has a baseline setup for a multiplatform library supporting all kotlin targets except andr

Kotlin Multiplatform Mobile App Template

KMMT : Kotlin Multiplatform Mobile Template Kotlin Multiplatform Mobile Development Simplified KMMT is a KMM based project template designed to simpli

Kotlin multiplatform library template

template-kmp-library Kotlin multiplatform library template. Has a baseline setup for a multiplatform library supporting all kotlin targets except depr

WordMasterKMP - WIP Kotlin Multiplatform sample inspired by Wordle and also Word Master web sample
WordMasterKMP - WIP Kotlin Multiplatform sample inspired by Wordle and also Word Master web sample

WordMasterKMP WIP Kotlin Multiplatform sample inspired by Wordle and also Word M

Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in Kotlin with Jetpack Compose and a backed in Kotlin hosted on AppEngine.

Conferences4Hall Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in K

Arrow Endpoint offers a composable Endpoint datatype, that allows us easily define an Endpoint from which we can derive clients, servers & documentation.

Arrow Endpoint Arrow Endpoint offers a composable Endpoint datatype, that allows us easily define an Endpoint from which we can derive clients, server

Arrow Endpoint offers a composable Endpoint datatype, that allows us easily define an Endpoint from which we can derive clients, servers & documentation.

Arrow Endpoint Arrow Endpoint offers a composable Endpoint datatype, that allows us easily define an Endpoint from which we can derive clients, server

A set of highly-opinionated, batteries-included gradle plugins to get you started building delicious multi-module Kotlin projects

Sourdough Gradle What is Sourdough Gradle? Sourdough is a set of highly opinionated gradle plugins that aim to act as the starter for your Kotlin proj

Owner
Carlos Mota
👨‍💻, 🔭🌖, 🗺, 📸, 🏃‍♂️💨, 🇵🇹, 🖖 - is this how I should use emojis?
Carlos Mota
A Kotlin Multiplatform Project using TMDB Api. Currently supports Android,iOS,Desktop and web platforms

A Kotlin Multiplatform Project using TMDB Api(https://www.themoviedb.org/). Currently this project is implemented in following platforms Andr

Jackson E J 11 Nov 10, 2022
Unsplash application for Android, Desktop and Web. Built using Kotlin Multiplatform and Compose

Unsplash Unsplash application for Android, Desktop and Web. Built using Kotlin Multiplatform and Compose with ❤️ ?? Presentation Set up the environmen

Carlos Mota 15 Nov 11, 2022
Funstuff - Minimal Kotlin Multiplatform project with SwiftUI, Jetpack Compose, Compose for Wear OS, Compose for Desktop

PeopleInSpace Minimal Kotlin Multiplatform project with SwiftUI, Jetpack Compose

Shivam Dhuria 2 Feb 15, 2022
Kotlin Multiplatform Sample - Android, iOS, Web, Desktop

KMP-Sample Kotlin Multiplatform Sample Android iOS Web (Compose for web) Desktop (Compose for desktop) ?? Structure Diagram ?? Build At least android

안홍범 14 Dec 13, 2022
Link-converter - A web service that converts links between web url and deeplink for mobile and web applications

Deep Link Converter Linkleri, mobil ve web uygulamaları için web url ile deeplin

Muhammed Eren DURSUN 2 Apr 9, 2022
This library is a set of simple wrapper classes that are aimed to help you easily access android device information.

SysInfo Simple, single class wrapper to get device information from an android device. This library provides an easy way to access all the device info

Klejvi Kapaj 7 Dec 27, 2022
Arrow-Maven-Template - A template project for Arrow with Maven. It defines an application and a couple small examples

Arrow-Maven-Template A template project for Arrow on Maven. See the official doc

ΛRROW 0 Jan 11, 2022
Spring boot web + Kotlin template project

kotpringboot-multimodule-template Table of Contents Overview How to run Overview How to run Run with profiles: Note that default spring profile would

Hwan Jo 7 Oct 30, 2022
This is a Kotlin multiplatform template project used to generate and deploy a natively compiled AWS lambda function using the custom runtime.

Overview This is a Kotlin multiplatform template project used to generate and deploy a natively compiled AWS Lambda function using a custom runtime. U

Greg Steckman 5 Jun 25, 2022
Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.

Codename One - Cross Platform Native Apps with Java or Kotlin Codename One is a mobile first cross platform environment for Java and Kotlin developers

Codename One 1.4k Jan 9, 2023