Giter Site home page Giter Site logo

louiscad / kotlin-libraries-playground Goto Github PK

View Code? Open in Web Editor NEW
179.0 11.0 57.0 768 KB

A playground to gain a wider and deeper knowledge of the libraries in the Kotlin ecosystem. Also the official sample for gradle refreshVersions.

License: MIT License

Kotlin 96.74% HTML 3.26%
kotlin-libraries kotlin playground hacktoberfest

kotlin-libraries-playground's Introduction

Kotlin Libraries Playground

A playground to gain a wider and deeper knowledge of the libraries in the Kotlin ecosystem

Also the official sample for gradle refreshVersions

Usage

Run all the samples

$ ./gradlew :kotlin-jvm:run

Run all the tests

$ ./gradlew :kotlin-testing:test

Test tests called FailingXXX are expected to fail

kotlin-libraries-playground_–_versions_properties__kotlin-libraries-playground__and_GitHub_Desktop

❤️ Contributors welcome! #hacktoberfest

We want to collect sample usage of Kotlin libraries, and the more the better!

You are very welcome to contribute your own library sample.

==> CONTRIBUTING.md

🤔How do you keep up with all the new stuff?

There are great resources to learn Kotlin.

But once you master the language, you are not done just yet.

You now face another challenging task: become familiar with its ecosystem of libraries.

With time, you want to both acquire:

  • a wider knowledge of what good libraries are available in the ecosystem in general
  • a deeper knowledge of some specific libraries particulary important for you

There are several inefficient ways to do that:

  • reading tutorial after tutorial and being stuck in a loop where you "learn" about things you don't practice
  • starting a new project from scratch for every libraries you come around - overwhelming
  • trying out the library in your main project at work - a project with a compilation time of 5 minutes, who uses an older version of the library than the tutorial assumes ; not sure your colleagues will be happy that you introduce a dependency you don't yet master.

🦅Widening your knowledge of libraries

The kotlin-libraries-playgound contains samples for a growing number of good Kotlin libraries including Apollo, CliKt, Kodein DI, Kodein DB, Exposed, Fuel, Hoplite, Klaxon, Konad, Konf, Kotlin Collections, Kotlin Faker, Kotlin IO, Kotlinpoet, Kotlin Statistics, Kotlinx Serialization, Ktor Client, Mordant, Moshi, OkHttp, OkIO, Picnic, Retrofit, Skrapeit, SqlDelight, Statemachine, ..., KoTest, Mockk, Spek, Strikt, Mockito, Junit-Jupiter, ... ...

You are very welcome to contribute new samples (see contributing section below).

For each library, we have a sample usage that is:

  • self-contained (own package and main function, usually one file)
  • simple, yet meaningful (no fancy coffee machine with termosiphon)

Here is for example the sample usage for kotlinx.serialization

package playground.kotlinx.serialization

fun main() {
    println("# Kotlin/kotlinx.serialization : Kotlin multiplatform / multi-format serialization")
    val user = User(name = "Robert", age = 42)
    val json = """{"name":"Robert","age":42}"""

    Json.encodeToString(user) shouldBe json
    Json.decodeFromString<User>(json) shouldBe user
}

@Serializable
internal data class User(
    val name: String,
    val age: Int
)

🔭 Deepening your understanding of one library

Clone this repository and make it yours.

Want to learn more about, say, OkHttp?

You don't have the hassle to create a new project.

Create a new branch called okhttp and try out things while you are reading the documentation

🎩 Easy dependency management with gradle refreshVersions

This playground is also the official sample for gradle refreshVersions

It makes it super easy to refresh dependencies

$ ./gradlew refreshVersions

And to add a new dependency without leaving the IDEA and with auto-completion :

❤️ A big thanks to our wonderful contributors !

Let_s_Build_a_Hat_Rack

kotlin-libraries-playground's People

Contributors

akwasiio avatar bekz7 avatar ch8n avatar darthbenro008 avatar dector avatar dustinsand avatar fejd avatar jaspervhaastert avatar jmfayard avatar johannea avatar katerine-sg avatar kswadi avatar larissayasin avatar louiscad avatar lpicanco avatar lucapiccinelli avatar martinbonnin avatar mrclsu avatar nkiesel avatar oscarsequeiros avatar sharkaboi avatar starsep avatar ulrichwinter avatar vinigmoraes avatar virtuoushub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kotlin-libraries-playground's Issues

Sample wanted for JakeWharton/picnic

About the library

  • Description: A Kotlin DSL and Java/Kotlin builder API for constructing HTML-like tables which can be rendered to text.
  • GitHub: JakeWharton/picnic

What the sample could do

Print a HTML-like table to the console :)

Wants to contribute the sample?

  • Say so in a comment here
  • Follow instructions in CONTRIBUTING.md
  • Submit your pull request!

Sample wanted for ReactiveX/RxJava

About the library

What the sample could do

RxJava is yuuuge but the sample should be kept small.

It could contain:

  • a demonstration of how to do an Observable.create() from a fake Websocket stream
  • a demonstration of simple operators .map(), .flatmap(), .filter()
  • a subscription that prints to the console
  • demonstration of interoperability with coroutines, convert from observable to flow and from flow to observable

Wants to contribute the sample?

  • Say so in a comment here
  • Follow instructions in CONTRIBUTING.md
  • Submit your pull request!

Sample wanted for MarkusAmshove/Kluent

About the library

What the sample could do

Add kluent examples in src/test, maybe follow what was done for strikt
https://github.com/LouisCAD/kotlin-libraries-playground/tree/main/kotlin-jvm/src/test/kotlin/framework
See also Atrium #36

Wants to contribute the sample?

  • Say so in a comment here
  • Follow instructions in CONTRIBUTING.md
  • Submit your pull request!

Sample wanted for robstoll/atrium

About the library

What the sample could do

Add kluent examples in src/test, maybe follow what was done for strikt
https://github.com/LouisCAD/kotlin-libraries-playground/tree/main/kotlin-jvm/src/test/kotlin/framework
See also kluent #35

Wants to contribute the sample?

  • Say so in a comment here
  • Follow instructions in CONTRIBUTING.md
  • Submit your pull request!

Sample wanted for cashapp/contour

About the library

What the sample could do

XML had a good ride but times have changed and we should too.

Demo how you can write the equivalent of a ConstraintLayout but in pure Kotlin

Wants to contribute the sample?

This issue is blocked by Kickstart a project kotlin-android #50

But it can already be assigned to if you feel like working on this library once we the kotlin-android project is started.

So if you are interested, say so in a comment here!

Sample wanted for skrapeit/skrape.it

About the library

What the sample could do

Parse an HTML file and verify that we can find a given information in it

Wants to contribute the sample?

  • Say so in a comment here
  • Follow instructions in CONTRIBUTING.md
  • Submit your pull request!

Reformat code

We have code contributed by many people, it needs reformating

Sample wanted for kotest/kotest (assertions only)

About the library

What the sample could do

For kotest, we have good examples of the different testing style from kotest ( StringSpec, FreeSpec, ...)
But we don't have good examples of matchers.

Show case the assertions from kotest much better that we currently do.

Takee inspiration from testing.asserts.KluentTests

It would be nice to have examples of:

  • Core Matchers
  • Arrow Matchers
  • Json Matchers
  • Clues

Assertions_-_Kotest_Test_Framework

Wants to contribute the sample?

  • Say so in a comment here
  • Follow instructions in CONTRIBUTING.md
  • Submit your pull request!

Sample wanted for Konad library

About the library

What the sample could do

  • Provide an example of how to compose independently computed Result<T>.
  • Provide an example of how to compose independently computed nullables.

Wants to contribute the sample?

  • Say so in a comment here
  • Follow instructions in CONTRIBUTING.md
  • Submit your pull request!

Sample wanted for kotlin-stdlib/kotlin.io

About the library

What the sample could do

The stdlib has really useful little things to work with the filesystem, not sure everyone is aware of them.

Show how to use FileTreeWalk, File.readText(), File.writeText(), File.appendText(), File.lines(), File.useLines(), File.rootName`, ...

Wants to contribute the sample?

  • Say so in a comment here
  • Follow instructions in CONTRIBUTING.md
  • Submit your pull request!

Sample wanted for dropbox/Store

About the library

What the sample could do

A store that combines networking, data in-memory and on disk

Wants to contribute the sample?

This issue is blocked by Kickstart a project kotlin-android #50

But it can already be assigned to if you feel like working on this library once we the kotlin-android project is started.

So if you are interested, say so in a comment here!

Sample wanted for apollographql/apollo-android

About the library

What the sample could do

Use the sample from the Apollo tutorial

query LaunchList {
  launches {
    cursor
    hasMore
  }
}

https://www.apollographql.com/docs/tutorial/introduction/
https://apollo-fullstack-tutorial.herokuapp.com/

Wants to contribute the sample?

  • Say so in a comment here
  • Follow instructions in CONTRIBUTING.md
  • Submit your pull request!

Kickstart a project kotlin-server

Currently all samples are inside kotlin-jvm and are self-contained in their own package, with each having its main() function.

But what about servers?

Ideally I would like to have a new directory/project kotlin-server that will contain an implementation of the same simple server spec in ktor but also later spring boot, http4k, javalin or whatever people want to contribute.

For a real project, one would use a multimodule Gradle build for that, but for pedagogy simplicity is key so if that's possible to put all implementations in a single module, that's better!

Sample wanted for kotlin-stdlib/kotlin.collections

About the library

What the sample could do

As a user coming from Java,
I use loops for while, ... everywhere
and I would like to see what's the loop-less alternative
with the most useful functions of kotlin-stdlib/kotlin.collections

Wants to contribute the sample?

  • Say so in a comment here
  • Follow instructions in CONTRIBUTING.md
  • Submit your pull request!

Sample wanted for Kodein-Framework/Kodein-DI

About the library

What the sample could do

Definitely not the meaningless example of the fancy coffee machine with a thermosiphon.

Try to find something simple you could use in the real world.

Wants to contribute the sample?

  • Say so in a comment here
  • Follow instructions in CONTRIBUTING.md
  • Submit your pull request!

Sample wanted for sksamuel/hoplite

About the library

What the sample could do

Show how the configuration can be read in a Json, Hocon or Java Properties format
Show how the library works with cascading config files
Show the beautiful errors from the library when a configuration is missing

Wants to contribute the sample?

  • Say so in a comment here
  • Follow instructions in CONTRIBUTING.md
  • Submit your pull request!

Most dependencies listed twice in kotlin-jvm/build.gradle.kts

I see e.g.

    implementation("org.jetbrains.exposed:exposed-core:_")
    implementation("org.jetbrains.exposed:exposed-core:_")
...
    implementation(KotlinX.html.jvm)
    implementation(KotlinX.html.jvm)

Is there a specific reason for that or should that just be clean up?

Kickstart a project kotlin-android

Currently all samples are inside kotlin-jvm and are self-contained in their own package, with each having its main() function.

But what about Android? There are lots of good libraries to demo there.

The challenge would be to keep things simple.

Ideally a sample for a given library would be contained in a single file like it's done in kotlin-jvm, and then called from a RecyclerView

I will also create issues for Android samples. It won't make sense to work on them yet, but if someone feels like working on it once kotlin-android is created, we can already assign it to her.

Sample wanted for coil-kt/coil

About the library

What the sample could do

Show how to load image with coil and apply some basic transformation to it

Wants to contribute the sample?

This issue is blocked by Kickstart a project kotlin-android #50

But it can already be assigned to if you feel like working on this library once we the kotlin-android project is started.

So if you are interested, say so in a comment here!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.