We may earn an affiliate commission when you visit our partners.
Pragmatic Code School

Kotlin is the Modern, concise and safe programming language and  is one of the popular JVM language in this day and age.

It’s also interoperable with Java and other languages, and provides many ways to reuse code between multiple platforms for productive programming.

This course will focus on using Kotlin for Server-Side Development using SpringBoot framework. This is a pure hands-on oriented course which covers these two topics:

  • Covers Kotlin Fundamentals thats necessary for Java Developers

  • Build RestFul APIs using SpringBoot and Kotlin

Read more

Kotlin is the Modern, concise and safe programming language and  is one of the popular JVM language in this day and age.

It’s also interoperable with Java and other languages, and provides many ways to reuse code between multiple platforms for productive programming.

This course will focus on using Kotlin for Server-Side Development using SpringBoot framework. This is a pure hands-on oriented course which covers these two topics:

  • Covers Kotlin Fundamentals thats necessary for Java Developers

  • Build RestFul APIs using SpringBoot and Kotlin

Section 1: Getting Started With the Course

  • This section covers the course objectives and the prerequisites that are needed to make the most out of this course.

Section 2: Getting Started with Kotlin Programming Language

  • In this section, I will introduce you to Kotlin Programming Language and why its a powerful language for enterprise development.

    • Introduction to Kotlin

    • How Kotlin Works with the JVM?

Section 3: Kotlin Fundamentals

  • In this section, we will explore the fundamentals of Kotlin.

    • val & var variables in Kotlin

    • Basic Types - Int, Long, Double, String

    • Conditionals - If and when block

    • Ranges , Loops

    • while & do-While

    • break, labels and return

Section 4: Functions in Kotlin

  • In this section, we will learn about functions in Kotlin and different ways of declaring and using them

    • Defining and Invoking Functions

    • Default Value Parameters & Named Arguments

    • Top-Level Functions and Top-level Properties

Section 5: Classes, Interfaces and Inheritance

  • In this section, we will learn about classes, inheritance and interfaces in detail.

    • Introduction to class - Creating a class and objects

    • Primary Constructors

    • Secondary Constructors

    • initializer code using init block

    • Data Classes

    • Custom Getters and Setters

    • Inheritance - Extending Classes

    • Inheritance - Override Functions, Variables

    • object keyword for creating instance of the class

    • companion object Keyword

    • Interfaces

    • Interfaces - Handling Conflicting Functions

    • Interfaces - Defining and Overrding Variables

    • Visibility Modifiers

    • Type Checking, Casting and Smart Cast

    • Enum class

Section 6: Nulls in Kotlin

  • In this section, we will learn about handling nulls in Kotlin

    • Nullable & Non-Nullable types in Kotlin

    • Safe Call(?) , Elvis Operator(?:) & Non Null Assertion(. ) to deal with Null Values

    • Invoking or assigning a Nullable Type to a Non-Nullable Type

Section 7: Collections, Arrays & Lamda Expressions

  • In this section, I will introduce you to collections, arrays and lambda expressions in Kotlin

    • Introduction to Collections

    • Introduction to Lamda Expressions

    • Lambdas and Higher Order Functions

    • Filter Operations on Kotlin Collections

    • Map Operations on Kotlin Collections

    • FlatMap Operations in Collections

    • Working With HashMaps

    • Lazy Evaluation of Collections using Sequences

    • Nullability in Collections

Section 8 : Exceptions In Kotlin

  • In this section, I will cover the exceptions in kotlin and the techniques to handle them.

    • Handling Exceptions using try-catch

Section 9 : Scope Functions

  • In this section, I will introduce you all to scope functions in Kotlin and its usage.

    • Introduction to Scope Functions

    • apply & also Scope Function

    • let Scope Function

    • with & run Scope Function

Section 10 : Getting Started with Kotlin and Spring Boot

  • In this section, I will explain the overview of the app we are going to build and build a very simple API.

    • Overview of the app & Project Setup

    • Build a Simple Endpoint - Greeting Controller

    • Constructor Injection in Spring

    • Setting up different profiles in Spring Boot

    • Set up Logging in Kotlin

Section 11 : Integration/Unit Testing using Junit 5

  • In this section, I will code and explain about the techniques to write different types of test cases using spring boot and Kotlin.

    • Introduction to Automated Tests & Setting up JUnit5

    • Integration Test for Controller

    • Unit Test for Controller - Using the Mockk Mocking library

Section 12 : Build the Course Catalog Service

  • In this section, we will build the Course Catalog Service to manage the Courses

    • Set up the Course Entity & CourseDTO

    • Create CourseRepository & Configure JPA in application.yml file

    • Build the POST Endpoint for adding new Course I

    • ntegration test for the POST endpoint using JUnit5

    • Build the Get Endpoint to retrieve all Courses

    • Integration test for the GET endpoint to retrieve all the courses

    • Build the Update Endpoint to update a Course

    • Integration test for the PUT endpoint using JUnit5

    • Build the DELETE endpoint to delete a Course

Section 13: Unit Testing Controller layer (Web Tier)

  • In this section, we will code and learn about how to write unit tests for the controller

    • Setting up the Unit Test for the CourseController

    • Unit test for the Post Endpoint in CourseController

    • Unit test for the GET Endpoint in CourseController

    • Unit test for the PUT Endpoint in CourseController

    • Unit test for the DELETE Endpoint in CourseController

Section 14 : Bean Validation using Validators and ControllerAdvice

  • In this section, we will code and learn the different techniques to apply bean validations and handle exceptions using the ControllerAdvice Pattern

    • Name and Category as Mandatory using @NotBlank Annotation

    • Implement Custom Error Handling using ControllerAdvice pattern

    • Handle Global RuntimeException using ControllerAdvice Pattern

Section 15 : Custom JPA queries using Spring Data JPA and DB Layer testing using @DataJpaTest

  • In this lecture, we will learn about the techniques to write custom JPA queries and the techniques to test the DB layer using the DataJpaTest

    • Retrieve Courses By Name using JPA Query Creation Function

    • Retrieve Courses By Name using Native SQL query

    • Testing Mutliple sets of Data using @Parameterized test

Section 16: GET Endpoint to retrieve Courses By Name using @RequestParam

  • In this section, we will code and learn about the usage of RequestParam in the controller endpoint.

    • Use existing GET endpoint to retrieve Courses by Name

    • Write Integration test to retrieve course by Name

Section 17 : Entity RelationShips using Spring Data JPA

  • In this section, I will explain the technique to express the relationships in JPA using Entity and Data classes in Kotlin

    • Adding Instructor Entity in to the Course Catalog Service

    • Adding the relationship in the Entity Class

    • Instructor Controller to Manage Instructor Data

    • Update CourseService to validate Instructor Data

    • Fix the CourseController Integration Tests

    • Fix the CourseController Unit Tests

Section 18 : Integrating with Postgres DB

  • In this section, we will code and learn to integrate the postgres DB in to the course catalog service.

    • Setting up the Postgres DB and App to interact with Postgres

    • Test the app with Postgres DB

Section 19 : Integration Testing using TestContainers

  • In this section, we will code and learn to integrate the testcontainers to run integration test.

    • Setting Up TestContainers for the Integration Test

    • Configure @DataJpaTest with TestContainers

Section 20 : Java & Kotlin Interoperability

  • In this section, we will code and learn about the interoperability between Java and Kotlin.

    • Invoking Kotlin Code from Java Class

    • Invoking Java Code from Kotlin

    • Useful JVM annotations in Kotlin

By the end of this course, you will be comfortable writing code using the Koltin Programming language and Build RestFuL APIs using SpringBoot and Kotlin.

Enroll now

What's inside

Learning objectives

  • Kotlin programming language and its benefits
  • Write code using kotlin programming language
  • Building applications using kotlin
  • Build restful services using springboot and kotlin
  • Test kotlin using junit5
  • Kotlin and java interoperability
  • Integrate spring data jpa with kotlin
  • Integration testing db layer using testcontainers & junit5
  • Unit testing functions calls using mockk library

Syllabus

Getting Started with the Course

In this lecture, I will give an introduction to the course.

Prerequisites
Course Slides are included in this section
Read more

This lecture includes the Course Slides that are used in the course.

This lecture has content that are related to the Source Code thats used in this course

In this section, I will introduce you to Kotlin Programming Language and why its a powerful language for enterprise development.

In this lecture, I will explain about Why Kotlin is a powerful language for software development.

In this lecture, I will explain how Kotlin works with the JVM.

In this section, we will explore the fundamentals of Kotlin.

In this lecture, we will set up the project to explore Kotlin

In this lecture, we will create a simple HelloKotlin Class and print "Hello Kotlin" in the console

In this lecture, we will learn about the val and var type in Kotlin to declare the variables

In this lecture, we will explore the basic types and the basic operations that can be performed on the basic types

In this lecture, we will explore the if-else block and when block in Kotlin

In this lecture, we will explore ranges, loops, while and do-while loops.

In this lecture, we will explore while and do-while loops.

In this lecture, we will explore break, labels, and returns

In this section, we will learn about functions in Kotlin and different ways of declaring and using them

In this lecture, we will code and explore different types of functions in Kotlin.

In this lecture, we will code and learn about the default parameters and the named arguments for Kotlin functions

In this lecture, we will code and learn about the top level functions and variables in Kotlin

In this section, we will learn about classes, inheritance and interfaces in detail.

In this lecture, we will code and learn about creating a class and instance of a class in Kotlin

In this lecture, we will code and learn about the primary constructor in Kotlin.

In this lecture, we will code and learn about the secondary constructor in Kotlin.

In this lecture, we will code and learn about the usage of init block to run some initialization logic during the instance creation

In this lecture, we will code and learn about the data class in kotlin.

Create Employee Data Class

In this lecture, we will code and learn about creating custom getters and setters in kotlin

In this lecture, we will code and learn about implementing inheritance in Kotlin

In this lecture, we will code and learn about overriding functions, variables in Kotlin.

In this lecture, we will code and learn about the object keyword and its usage in Kotlin

In this lecture, we will code and learn about the companion object keyword and its usage in Kotlin

In this lecture, we will code and learn about the Interfaces in Kotlin

In this lecture, we will code and learn about the handling conflicting functions in the implementation class

In this lecture, we will code and learn about using variables in Kotlin Interfaces

In this lecture, we will code and learn about visibility modifiers in Kotlin

In this lectture, we will code and learn about type checking, casting and smart casting in Kotlin

In this lecture, we will code and learn about Enum classes in Kotlin.

In this section, we will learn about handling nulls in Kotlin

In this lecture, we will code and learn about the nullable and non nullable types in Kotlin

In this lecture, we will code and learn about the performing operations on a nullable type using the Safe and Elvis operators

In this lecture, we will code and learn about using a nullable type to deal with Non-Nullable Types

In this section, I will introduce you to collections, arrays and lambda expressions in Kotlin

In this lecture, I will give you all an introduction to collections and learn about the mutable and immutable collections.

In this lecture, I will give you all an introduction to Lambda expressions and explore Lambda expression using different examples

In this lecture, we will code and explore how to create higher order functions using Lambdas

In this lecture, we will code and explore about the filter operator in collections

In this lecture, we will code and explore about the map operator in collections

In this lecture, we will code and explore about the flatMap operator and when it can be used when working with collections

In this lecture, we will code and explore the different operators that can be used when working with HashMaps

In this lecture, we will explore an alternative to work on the collection using sequences for lazy evaluation

In this lecture, we will code and explore the nullability and how it works with Kotlin

In this section, I will cover the exceptions in kotlin and the techniques to handle them.

In this lecture, we will code and learn about the Exceptions in Kotlin and how to handle them.

In this section, I will introduce you all to scope functions in Kotlin and its usage.

In this lecture, I will give an introductions to scope functions in Kotlin.

In this lecture, we will code and explore about the also and apply scope function.

In this lecture, we will code and explore about the let scope function.

In this lecture, we will code and explore about the with and run scope function.

In this section, I will explain the overview of the app we are going to build and build a very simple API.

In this lecture, I will give an overview of the app and set up the base project for this course

In this lecture, we will build a simple rest endpoint using Kotlin and Spring boot

In this lecture, we will build a service layer and learn to perform constructor injection in Spring boot

In this lecture, we will code and learn to set up different profiles in SpringBoot.

In this lecture, we will set up the logging for the application

In this section, I will code and explain about the techniques to write different types of test cases using spring boot and Kotlin.

In this lecture, I will explain about automated tests and set up test folders for unit and integration tests

In this lecture, we will code and learn to write integration test for the controller endpoint

In this lecture, we will code and learn to write unit test for the controller endpoint

In this section, we will build the Course Catalog Service to manage the Courses

In this lecture, we will code the Entity and DTO for the course catalog service.

In this lecture, we will code and configure the JPA and set up the repository in the project

In this lecture, we will code the POST endpoint to create a new course

In this lecture, we will write the Integration test for the POST endpoint to create a new course

In this lecture, we will code the GET endpoint to retrieve all the courses

In this lecture, we will code the write the integration test for the GET endpoint to retrieve all the courses

In this lecture, we will code the PUT endpoint to update an existing course

In this lecture, we will write the integration test for the PUT endpoint to update an existing course

In this lecture, we will code the Delete endpoint to delete a course using its id.

In this section, we will code and learn about how to write unit tests for the controller

In this lecture, we will set up the unit test for the CourseController

In this lecture, we will write the unit test for the POST endpoint in CourseController

In this lecture, we will write the unit test for the GET endpoint in CourseController

In this lecture, we will write the unit test for the PUT endpoint in CourseController

In this lecture, we will write the unit test for the DELETE endpoint in CourseController

In this section, we will code and learn the different techniques to apply bean validations and handle exceptions using the ControllerAdvice Pattern

In this lecture, we will the bean validation for the CourseDTO by making the name and category as mandatory

In this lecture, we will implement a custom error handler using the ControllerAdvice pattern for handling Bean Validation errors

In this lecture, we will implement a custom error handler using the ControllerAdvice pattern for handling any RuntimeException.

In this lecture, we will learn about the techniques to write custom JPA queries and the techniques to test the DB layer using the DataJpaTest

In this lecture, we will write a custom JPA function to retrieve the courses by their name by using the JPA helper function

In this lecture, we will write a custom JPA function to retrieve the courses by their name by using the Native SQL query.

In this lecture, we will code and learn about testing with multiple sets of data using the @Parameterized test annotation.

In this section, we will code and learn about the usage of RequestParam in the controller endpoint.

In this lecture, we will update the GET endpoint to retrieve the courses by their name using the @RequestParam annotation

In this lecture, we will write the integration test to get the courses by their name

In this section, I will explain the technique to express the relationships in JPA using Entity and Data classes in Kotlin

In this lecture, I will introduce you to the Instructor Entity and its importance

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Covers Kotlin fundamentals, which is helpful for Java developers looking to transition to a modern and concise language
Teaches how to build RESTful APIs using Spring Boot and Kotlin, which are valuable skills for backend development
Includes integration and unit testing using JUnit 5 and Mockk, which are essential practices for software engineers
Explores Java and Kotlin interoperability, which is useful for projects that involve both languages
Demonstrates integrating with a Postgres database and using Testcontainers for integration testing, which are relevant for real-world applications
Requires prior experience with Java, which may exclude learners without a background in JVM-based languages

Save this course

Save Build RESTFUL APIs using Kotlin and Spring Boot to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Build RESTFUL APIs using Kotlin and Spring Boot with these activities:
Review Java Fundamentals
Reinforce your understanding of Java fundamentals, as Kotlin is interoperable with Java and understanding Java concepts will aid in grasping Kotlin's features and how they interact with the JVM.
Show steps
  • Review basic syntax and data types in Java.
  • Practice object-oriented programming concepts in Java.
  • Familiarize yourself with Java collections and streams.
Review 'Spring Boot in Action'
Enhance your understanding of Spring Boot by studying a comprehensive guide that covers framework features and best practices.
Show steps
  • Read the chapters relevant to the course syllabus.
  • Work through the examples provided in the book.
  • Take notes on key concepts and configurations.
Review 'Kotlin in Action'
Deepen your understanding of Kotlin by studying a comprehensive guide that covers language features and best practices.
Show steps
  • Read the chapters relevant to the course syllabus.
  • Work through the examples provided in the book.
  • Take notes on key concepts and syntax.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Kotlin Koans
Sharpen your Kotlin skills by completing a series of exercises that cover various language features and concepts.
Show steps
  • Access the Kotlin Koans online or through IntelliJ IDEA.
  • Work through the exercises in each section.
  • Review the solutions and explanations for each Koan.
Blog Post: Kotlin vs. Java for APIs
Reinforce your learning by creating a blog post comparing and contrasting Kotlin and Java for building RESTful APIs, highlighting the benefits of Kotlin.
Show steps
  • Research the key differences between Kotlin and Java.
  • Outline the structure of your blog post.
  • Write the content, providing code examples.
  • Edit and proofread your blog post.
  • Publish your blog post on a platform like Medium.
Build a Simple CRUD API
Solidify your understanding of Kotlin and Spring Boot by building a simple CRUD (Create, Read, Update, Delete) API for a basic entity like a 'Task' or 'Product'.
Show steps
  • Set up a new Spring Boot project with Kotlin.
  • Define the entity and DTO classes.
  • Implement the CRUD operations using Spring Data JPA.
  • Create REST endpoints for each operation.
  • Write unit and integration tests for the API.
Contribute to a Kotlin/SpringBoot Project
Deepen your understanding and gain practical experience by contributing to an open-source Kotlin and Spring Boot project on GitHub.
Show steps
  • Find a suitable open-source project on GitHub.
  • Review the project's documentation and contribution guidelines.
  • Identify a bug or feature to work on.
  • Submit a pull request with your changes.
  • Respond to feedback from the project maintainers.

Career center

Learners who complete Build RESTFUL APIs using Kotlin and Spring Boot will develop knowledge and skills that may be useful to these careers:
API Developer
An API developer designs, develops, and maintains application programming interfaces that allow different software systems to communicate with each other. The focus of this course on building RESTful APIs using Kotlin and Spring Boot makes it exceptionally relevant for this role. The course takes a practical approach, taking learners through setting up the environment, creating endpoints, handling data, and even setting up testing. An aspiring API developer should take this course because of its direct focus on the core skills required for the role.
Backend Developer
A backend developer builds and maintains the server-side logic of applications, often creating the APIs that frontend applications consume. This course is an excellent starting point for a career as a backend developer because it covers building RESTful APIs using Kotlin and Spring Boot. Through hands-on exercises, the course teaches core concepts like creating endpoints, handling requests and responses, and integrating with databases using Spring Data JPA. A prospective backend developer should take this course to gain direct experience with building server-side applications.
Web Services Developer
A web services developer specializes in building and maintaining web services, which are software systems that enable communication between applications over a network. This course helps build the necessary skills to build RESTful APIs with Kotlin and Spring Boot. It will help a web services developer understand how to design and implement APIs and interact with databases using Spring Data JPA. A web services developer who wants to work with Kotlin for building web services will find benefit from this course.
Software Engineer
A software engineer designs, develops, and maintains software systems. This includes web applications, mobile apps, and complex enterprise systems. While software engineers need broad skills, this course helps build critical skills in backend web development by focusing on Kotlin, Spring Boot, and RESTful APIs. The course teaches developers how to write code using Kotlin, build server side applications, and conduct unit and integration tests. This course may be useful to a software engineer who wants to focus on server-side development.
Full-Stack Developer
A full stack developer works with both the front end (user interface) and the back end (server side) aspects of an application. While this course focuses on the back end, it provides an essential piece of the full stack by teaching how to build RESTful APIs using Kotlin and Spring Boot. The course emphasizes hands-on development skills for building server-side logic; a full stack developer should take this course to solidify their understanding of building API's.
Application Developer
An application developer designs, codes, and tests applications for various platforms. This course provides a specialization in creating back end applications using Kotlin and Spring Boot. It emphasizes hands-on development of RESTful APIs, database integration using Spring Data JPA, and testing with JUnit 5 and Mockk. A prospective application developer with a focus on building back end services may find this course helpful.
Java Developer
A Java developer works with the Java programming language to build and maintain applications. While this course focuses specifically on Kotlin, it is useful to a Java developer because it explains how to leverage Kotlin for server side development. It also shows the interoperability between Java and Kotlin. The course explains Kotlin fundamentals, and many of the concepts covered are transferable from Java. Java developers who want to expand their skill set to include other JVM languages may find this course helpful.
Software Development Manager
A software development manager oversees teams of developers and ensures the quality and delivery of software products. While a manager will not always code directly, practical experience is valuable when leading a team. This course may be useful for a software development manager because it provides hands-on experience with Kotlin and Spring Boot, along with building RESTful APIs and testing practices. This foundational knowledge enables better understanding of the development process.
Cloud Engineer
A cloud engineer is responsible for implementing, managing, and maintaining cloud computing systems. Building API's is often required for cloud-based applications. This course may be useful to a cloud engineer because it provides a hands-on approach to building RESTful APIs with Kotlin and Spring Boot. The course covers testing, and database integration, which are important when building services in the cloud.
Technical Lead
A technical lead is responsible for guiding a development team and making technical decisions on a project. The hands-on development experience with Kotlin and Spring Boot in this course may be useful for a technical lead. The course provides direct experience building RESTful APIs, setting up testing, and integrating with databases using JPA. A technical lead will find this experience helpful when guiding their team.
Database Administrator
A database administrator manages and maintains databases and related systems. While this course does not focus on database administration, it includes experience integrating applications with databases using Spring Data JPA. This experience may be useful for a database administrator as it provides insight into the interplay between applications and databases. This course helps them to understand the perspective of developers.
Systems Architect
A systems architect designs the structure of computer systems, including hardware, software, and networks. This role requires an understanding of how different components interact, including the API layer. This course may be useful to a systems architect because it covers the creation of RESTful APIs using Kotlin and Spring Boot. It provides the architect with practical knowledge of how APIs are built, tested, and integrated with databases using JPA.
DevOps Engineer
A DevOps engineer works to automate software development and deployment processes. While this role is broad, it requires an understanding of the entire software lifecycle, including API development. This course may be useful for a DevOps engineer as it helps build a foundation in backend development through building RESTful APIs using Kotlin and Spring Boot. The understanding of integration and unit testing covered in the course will also be helpful for a DevOps engineer.
Enterprise Architect
An enterprise architect is responsible for designing and governing the overall architecture of an organization's technology systems. It is useful for an enterprise architect to have a practical understanding of how applications are built, including the development of APIs. This course may be helpful to an enterprise architect because it provides a hands-on approach to building RESTful APIs using Kotlin and Spring Boot. The course covers key aspects of back end infrastructure like testing and integration with databases.
Mobile Application Developer
A mobile application developer creates applications for mobile platforms (iOS, Android). Increasingly mobile apps require back end services, and this course provides a starting point for creating those services. While the primary focus is not on mobile applications, this course teaches the skills of building RESTful APIs using Kotlin and Spring Boot, which can be leveraged by a mobile application developer. The course allows mobile developers to expand into backend development.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Build RESTFUL APIs using Kotlin and Spring Boot.
Provides a comprehensive guide to Kotlin, covering its syntax, features, and best practices. It's particularly useful for Java developers transitioning to Kotlin, as it highlights the similarities and differences between the two languages. 'Kotlin in Action' serves as both a tutorial and a reference, making it valuable throughout the course. It expands on the course material by providing in-depth explanations and practical examples.
Provides a comprehensive guide to Spring Boot, covering its core features, auto-configuration, and best practices for building production-ready applications. It's particularly useful for understanding how Spring Boot simplifies the development of RESTful APIs. 'Spring Boot in Action' serves as both a tutorial and a reference, making it valuable throughout the course. It expands on the course material by providing in-depth explanations and practical examples.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser