Posts

Showing posts with the label kotlin

Kotlin + Spring Boot + FreeMarker + JPA - CRUD example

Image
Hello everyone, Today we will learn how to develop a Spring Boot CRUD web application, using Kotlin, Spring Boot, FreeMarker template, H2DB, and JPA. Following technologies stack being used: Spring Boot 2.5.5 Spring MVC 5.3.10 Gradle Kotlin FreeMarker 2.3.31 H2DB  Bootstrap Project Structure: Project Dependency(build.gradle.kts) import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id( "org.springframework.boot" ) version "2.5.5" id( "io.spring.dependency-management" ) version "1.0.11.RELEASE" kotlin( "jvm" ) version "1.5.31" kotlin( "plugin.spring" ) version "1.5.31" kotlin( "plugin.jpa" ) version "1.5.31" } group = "com.knf.dev.demo" version = "0.0.1-SNAPSHOT" java.sourceCompatibility = JavaVersion.VERSION_11 repositories { mavenCentral() } dependencies { implementation( "org.springframework.boot:spring-boot-starter-data-jpa"

Kotlin + Spring + Groovy Templates CRUD Example

Image
Hello everyone, Today we will learn how to develop a Spring Boot CRUD web application, using Kotlin, Spring Boot, Groovy template, H2DB, and Spring Data JPA. The Groovy markup template engine provides an innovative templating system based on the builder syntax.   It offers various key features:  hierarchical (builder) syntax to generate XML-like contents (in particular, HTML5)  compilation of templates to bytecode for fast rendering internationalization  layout mechanism for sharing structural patterns  optional type checking and more!  The following technologies stack being used: Spring Boot 2.5.5 Spring MVC 5.3.10 Gradle Kotlin Groovy templates 2.5.5 H2DB  Bootstrap Project Structure Project Dependency(build.gradle.kts) import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id( "org.springframework.boot" ) version "2.5.5" id( "io.spring.dependency-management" ) version "1.0.11.RELEASE" kotlin( "jvm" ) version "

Kotlin + Spring Boot + Keycloak - Securing REST APIs

Image
Hello everyone, In this article, we will learn how to secure the Kotlin + Spring boot REST APIs with Keycloak. GitHub repository link is provided at the end of this tutorial.   Technologies Used: Kotlin Spring Boot 2.5.5 KeyCloak 15.0.2 Gradle Let's begin our journey, Keycloak - Environment Setup Let's download the  Keycloak-15.0.2 Standalone server  distribution from the official source. Once we've downloaded the Standalone server distribution, we can unzip and start Keycloak from the terminal: In Windows unzip  keycloak-12.0.1.zip cd  keycloak-12.0.1/bin/ standalone.bat In Linux / Unix  $  sudo  tar -xvzf keycloak-12.0.1.tar.gz $  cd  keycloak-12.0.1/bin/ $ ./standalone.sh Create Keycloak Server Initial Admin Go to  http://localhost:8090/auth/  and fill the form in the Administrator Console part. For the purpose of this exercise,  knowledgefactory / password  will be enough. Then you should be able to log in to Keycloak Admin Console  http://localhost:8080/auth/admin . An