You can find here how to:
- configure build files to build for Web, Android, iOS, Linux, MacOS and Windows
- release your application with GitHub actions
- write and use multiplatform clients and share model code with the backend of your application with the beauty of Kotlin Multiplatform
You can find project description in Essay.
You can go directly to the Mini Games website, where the static client of the application is deployed.
MiniGames.local.demo.mp4
Android released version is available on Google Play.
You can download compiled version of application from release page.
Client applications are configured to work with the server deployed on test server. You can download them to play with "production" version of application - to run it locally, you should compile server and clients by yourself.
Please note that for running unsigned version of macOS application, you need to temporarily disable Gatekeeper, so executing command
sudo xattr -dr com.apple.quarantine /Applications/MiniGames.app
is required to be able to run the app on macOS. You can learn more about this here.
To install Linux version run:
sudo dpkg -i minigames.deb
You can try playing with default login credentials which are publicly available:
- user: user
- password: pass
You need a fast internet connection to have a good play experience in SnakeIO game.
Project contains two parts - client app and the server app.
Intellij Ultimate is highly recommended when working with server app.
In both cases, open main project directory when importing the project (
not the android-app
, desktop-app
nor server
etc.) as the main directory contains the
configuration common to both projects and has to be loaded.
Remember: When working with project use Rebase strategy as long as you can not to create extra merge commits. You'll be asked by the IDE probably during first push when some other developer also made changes.
To compile client application you need Android SDK as well as JDK 17 (corretto version was used).
There is a docker environment configured in docker-compose.yml required to run server application. It contains Postgres database for server data. You can start it with
./start.sh
on linux or some equivalent commands on other platform.
The easiest way to run the instance of server is to start it from terminal by running Gradle
./gradlew server:run
from the root directory of project.
To run the server from the Intellij, go to the Server
class and run the main
function (starting database manually before).
Notice: You need to have environment variables loaded to build configuration to start application correctly. The easiest way is to copy the content of .env file and paste it in the build configuration in Intellij as committed version contains the definition of developer environment.
Just run ./gradlew stage
to build the server distribution. Build
result will be located in server/build/libs/
. You can run it with java -jar
command, but you have to manually set the needed env variables to make application
working.
The easiest way to run the instance of desktop client is to start it from terminal by running Gradle
./gradlew desktop-app:runDistributable
from the root directory of project.
To run iOS version of client cocoapods pod needs to be compiled and installed to XCode project
located in ios-app
. The easiest way to compile and link all ios targets is to run
./gradlew linkPodReleaseFrameworkIosFat linkPodDebugFrameworkIosFat
from the root directory of project and then
./gradlew podInstall
to install the compiled resources to XCode.
The last step is to set up the XCode project by first changing the value of TEAM_ID
in
ios-app/Configuration/Config.xcconfig
to your own and then open XCode workspace available
in ios-app
.
The easiest way to run the instance of android client is to start it from Android Studio by running
Gradle the generated build configuration android-app
. It should build the debug version of application
and deploy it on available emulator of android device. This is the only advised method of running the
client application for android platform.
The easiest way to run the instance of wev client is to start it from terminal by running Gradle
./gradlew web-app:wasmJsBrowserProductionRun
from the root directory of project.
Projects is configured as Gradle modules that may depend on each other.
E.g. it contains module that is compiled to .jar
distribution file of server
for the application and some other module that can be compiled to Android .apk
file.
build-src
- contains configuration of build logic (it's compiled before Gradle build of the other modules even starts)shared
- contains common logic forserver
andshared-client
like domain model or rest api model, depends onbuild-src
shared-client
- contains common logic forandroid-app
(and futureios-app
) like rest client, depends onbuild-src
andshared
android-app
- targets Android, depends onshared-client
desktop-app
- targets any JVM desktop, depends onshared-client
web-app
- targets web, depends onshared-client
server
- targets JVM, depends onbuild-src
andshared
dev-env
- useful tools that should be used by developers that are working locally to test their current code and solutions- docker environment with Postgres database can be run with
start.sh
http
contains http requests definitions that can be run from Intellij. They're configured by thehttp-client.env.json
to switch between different environments
- docker environment with Postgres database can be run with