Code Monkey home page Code Monkey logo

kotlin-ktor-mysql-template's Introduction

AnyChart - Robust JavaScript/HTML5 Chart library for any project

Kotlin Ktor basic template

This example shows how to use AnyChart library with the Kotlin programming language, Ktor framework and MySQL database.

Running

To use this sample you must have Gradle installed on your computer. You can use SDKMAN to install it:

$ curl -s get.sdkman.io | bash
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
$ sdk install gradle

# or simply
$ sudo apt-get install gradle

Also you must have MySQL installed and running. If not, please check out MySQL Download page and follow these instructions.

To check your installations, run the following command in the command line:

$ gradle -version
------------------------------------------------------------
Gradle 2.10
...

$ mysql --version
mysql  Ver 14.14 Distrib 5.5.52, for debian-linux-gnu (x86_64) using readline 6. # sample output

To start this example run commands listed below.

Clone the repository from github.com:

$ git clone [email protected]:anychart-integrations/kotlin-ktor-mysql-template.git

Navigate to the repository folder:

$ cd kotlin-ktor-mysql-template

Set up MySQL database, use -u -p flags to provide username and password:

$  mysql < database_backup.sql

Run application:

$ gradle run

Open browser at http://localhost:8080/

Workspace

Your workspace should look like:

groovy-grails-mysql-template/
    src/
        main/
            kotlin/
                com/
                    anychart/
                        Main.kt   # main Kotlin code
    .gitignore
    build.gradle    #gradle settings
    database_backup.sql   # MySQL database dump
    gradlew
    gradlew.bat
    README.md
    LICENSE

Technologies

Language - Kotlin
Web framework - Ktor
Template engine - kotlinx.html
Build tool - Gradle
Database - MySQL
Database mapping - Exposed

Further Learning

License

AnyChart Kotlin/Ktor/MySQL integration sample includes two parts:

  • Code of the integration sample that allows to use Javascript library (in this case, AnyChart) with Kotlin language, Ktor framework and MySQL database. You can use, edit, modify it, use it with other Javascript libraries without any restrictions. It is released under Apache 2.0 License.
  • AnyChart JavaScript library. It is released under Commercial license. You can test this plugin with the trial version of AnyChart. Our trial version is not limited by time and doesn't contain any feature limitations. Check details here.

If you have any questions regarding licensing - please contact us. [email protected]

Analytics

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.