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 |
Warning
|
Flame |
Into
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
variableexport 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)
-
a neat little alias that can save few symbols to type
-
start Kafka (zookeeper will be started automatically as a dependency)
-
-
Web App
-
Obtain an API key from [mapbox.com](https://www.mapbox.com/)
-
Start the Play web app:
MAPBOX_ACCESS_TOKEN=YOUR-MAPBOX-API-KEY ./gradlew bootRun
-
http://localhost:9090/driver - Driverโs UI
-
http://localhost:9090/rider - Riderโs UI
-
-
on the Rider UI select where do you want to travel
-
on the Driver UI select rider and enjoy the ride!
Docker
-
Build a docker image
./gradlew jib
-
Deploy to Kubernetes
kubectl create -f deployment.yaml
Deployment with Kotlin Kubernetes DSL
./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)
-
Deploy application secrets
-
check the secret
-
Deploy the app
-
Undeploy the app