Skip to content

Consolidated full-stack application development library for Kotlin

License

Notifications You must be signed in to change notification settings

spxbhuhb/adaptive

Repository files navigation

Maven Central GitHub License

Adaptive is a consolidated application development library for Kotlin focusing on:

  • expressing our intention,
  • clean code, close to no-boilerplate, minimal dependencies,
  • frontend and backend components with built-in lifecycle and state handling.

Adaptive comes with a compiler plugin that performs many functions to reach the goals above.

Important

Project status: preview

While library already works and provides both client and server side functionality, it is not even close to be ready for general production.

Please note that this is just a preview release, many basic things you would expect to work are still broken, especially around the code transformation.

For example, a simple { counter++ } at the right place can result in a compiler plugin error.

I will clean everything up eventually, but for now I consider these low priority issues, ones I can live with. If anyone starts to play around with the project I'll try to spend some time on these problems. Feel free to open an issue for any error or even inconvenience you experience.

Supported platforms

  • JVM
  • Browser/JS
  • Android
  • iOS (Arm64, Simulator Arm64, X64)

See platforms for details.

Getting Started

There is some documentation.

Check out the adaptive-example project, or jump to the

Project Structure

Component Content
core The fundamental core of the library.
  adat Data classes with many convenience functions, metadata and serialization support.
  foundation Fundamental classes and interfaces for building adaptive structures.
  server Server side adaptive fragments: workers, services, stores, settings.
  service Client-server communication with simple function calls.
  wireformat Serialization (protobuf and Json).
gradle-plugin The Gradle plugin.
kotlin-plugin The Kotlin compiler plugin.
lib Application level libraries such as UI, E-mail, etc.
  email Email worker (JavaMail), tables (Exposed) and service to send emails.
  exposed Integration with Exposed, HikariPool worker.
  ktor Ktor Worker with websockets and static directory serving. Transport for services.
  lib Library sandbox.
sandbox Sandbox project to try things our without booting up the whole example.
ui User interface modules.
  common Basic UI fragments for the supported platforms.

Building Adaptive

Run the build task of the root project.

Note

If you are building with iOS targets you have to run the build on Mac OS X. This is a requirement from Apple, see Multiplatform Setup for details.

To disable iOS targets set the version of ios-support to none in libs.versions.toml. Any value other than none adds support for iOS.

This is also useful when you don't want to wait for the iOS linking during development.

Adaptive uses a composite Gradle build. These tasks are defined for the root project and run the appropriate task for each included project:

  • build
  • clean
  • publishToMavenLocal
  • kotlinUpgradeYarnLock

Everything uses the dependencies defined in libs.versions.toml.

To bump Adaptive version number:

Debugging Adaptive

To see what the plugin does, add this to build.gradle.kts. When pluginDebug is true, the plugin creates files for each compilation in the pluginLogDir directory.

adaptive {
    pluginDebug = true
    pluginLogDir = projectDir.toPath()
}

Credits

Multiplatform

Server side

  • PostgreSQL (by The PostgreSQL Global Development Group, PostgreSQL Licence)
  • Exposed (by the JB Team, Apache 2.0)
  • HikariCP (by Brett Wooldridge, Apache 2.0)
  • LOGBack (by QOS.ch, EPL v1.0 or LGPL 2.1)
  • JavaMail (by Oracle, CDDL 1.0)

Building

  • Gradle (by Gradle Inc., Apache 2.0)

Testing

  • H2 (by multiple contributors, MPL 2.0 or EPL 1.0)
  • SubEtha SMTP (by SubEthaMail.org, Apache 2.0)

Inspiration

License

Copyright (c) 2024 Simplexion Kft, Hungary and contributors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Consolidated full-stack application development library for Kotlin

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages