Skip to content
/ klyfft Public

🚕 kLyfft app - lyft-like event-driven application

License

Notifications You must be signed in to change notification settings

gAmUssA/klyfft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kLyfft

the kLyfft app - event-driven app

A uber-like event-driven application example

Note
inspired by James Ward’s Koober but much better because Kotlin and Spring Boot used (not Scala 🤮 and Play 🤢)

scala 1 kotlin 1

Warning
Flame 🔥 War warning! The demo is written with Groovy (mostly build scripts) and Kotlin. Because why not? 💃

Into

The application consists of Web UI (driver and rider). A rider initiates a, and the driver picks her.

driver picks rider

How to build

./gradlew clean build

How to run

Prerequisites

  • Confluent Platform Enterprise 5.x [1]

    • download it

    • unizip to any folder

    • add folder to PATH variable

      export CONFLUENT_PLATFORM_VERSION=5.1.0
      export CONFLUENT_HOME=~/projects/confluent/confluent-ent/$CONFLUENT_PLATFORM_VERSION
      export PATH=$CONFLUENT_HOME/bin:$PATH
      alias cnfl="confluent" #(1)
      
      cnfl start kafka #(2)
      1. a neat little alias that can save few symbols to type

      2. start Kafka (zookeeper will be started automatically as a dependency)

Web App

  1. Obtain an API key from [mapbox.com](https://www.mapbox.com/)

  2. Start the Play web app: MAPBOX_ACCESS_TOKEN=YOUR-MAPBOX-API-KEY ./gradlew bootRun

  3. on the Rider UI select where do you want to travel

  4. on the Driver UI select rider and enjoy the ride!

Docker

  1. Build a docker image

    ./gradlew jib
  2. Deploy to Kubernetes

    kubectl create -f deployment.yaml

Deployment with Kotlin Kubernetes DSL

Create Application Config
./gradlew :deployment:createApplicationConfig -PconfigPath=$PWD/app/src/main/resources/application.properties #(1)

kubectl get secret application-config -o yaml   #(2)

./gradlew :deployment:deploy        #(3)

kubectl get deployments

./gradlew :deployment:undeploy      #(4)
  1. Deploy application secrets

  2. check the secret

  3. Deploy the app

  4. Undeploy the app

Releases

No releases published

Packages

No packages published