Giter Site home page Giter Site logo

lucaspozzi / kotlin-ktor-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from initialcapacity/kotlin-ktor-starter

0.0 0.0 0.0 155 KB

kotlin-ktor-starter

License: Apache License 2.0

Kotlin 51.75% CSS 40.18% FreeMarker 6.40% Dockerfile 1.06% Procfile 0.45% Shell 0.16%

kotlin-ktor-starter's Introduction

Kotlin ktor starter

An application continuum style example using Kotlin and Ktor that includes a single web application with two background workers.

  • Basic web application
  • Data analyzer
  • Data collector

Technology stack

This codebase is written in a language called Kotlin that is able to run on the JVM with full Java compatibility. It uses the Ktor web framework, and runs on the Netty web server. HTML templates are written using Freemarker. The codebase is tested with JUnit and uses Gradle to build a jarfile. The pack cli is used to build a Docker container which is deployed to Google Cloud on Google's Cloud Platform.

Getting Started

Development

  1. Build a Java Archive (jar) file.

    ./gradlew clean build
  2. Configure the port that each server runs on.

    export PORT=8881

Run the servers locally using the below examples.

Web application

java -jar applications/basic-server/build/libs/basic-server-1.0-SNAPSHOT.jar

Data collector

java -jar applications/data-collector-server/build/libs/data-collector-server-1.0-SNAPSHOT.jar

Data analyzer

java -jar applications/data-analyzer-server/build/libs/data-analyzer-server-1.0-SNAPSHOT.jar

Production

Building a Docker container and running with Docker.

Buildpacks

  1. Install the pack CLI.

    brew install buildpacks/tap/pack
  2. Build using pack.

    pack build kotlin-ktor-starter --builder heroku/buildpacks:20
  3. Run with docker.

    docker run  -e "PORT=8882" -e "APP=applications/basic-server/build/libs/basic-server-1.0-SNAPSHOT.jar" kotlin-ktor-starter

That's a wrap for now.

kotlin-ktor-starter's People

Contributors

barinek avatar lucaspozzi avatar tygern avatar

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.