Skip to content

YosifKalchev/Ktor-RestApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Custom Ktor Rest API

Kotlin Version AGP Gradle Gradle

The project

The purpose of the project is to create custom Rest API using Ktor,

populate it and use the data via showcase application.

Custom Rest Api

The custom rest api is create with Ktor and populated with simple data -
computer images and information about their processors.

  • Build system used is Gradle Kotlin.

  • Engine is Netty

  • Pluggins for specific backend bahaviour

    • Rounting - to define routes for response
    • Static Content - allow application to call a specific road
    • Content Negotiation - for automatic Json parsing of API response
    • Call Logging - log client request to the server
    • kotlinx.serialization - handles JSON serialization

Showcase Application

The simple showcase Android application is created with JetPack Compose.
The whole app is just main screen with ImageView, TextViews and a Button.
When the button is clicked, application performed a call to the Custom Ktor Rest Api
and retreive the data - information about a random computer. Than just populate
the ImageView and the TextViews with the data

Project characteristics and tech-stack

This project takes advantage of best practices, many popular libraries and tools in the Android ecosystem. Most of the libraries are in the stable version unless there is a good reason to use non-stable dependency.

Getting started

There are a few ways to open this project.

IntelliJ Idea & Android Studio

  1. IntelliJ Idea -> File -> New -> From Version control -> Git
  2. Enter https://github.com/YosifKalchev/Ktor-Rest-Api/tree/main/RestApi into URL field an press Clone button 3.Android Studio -> File -> New -> From Version control -> Git
  3. Enter https://github.com/YosifKalchev/Ktor-Rest-Api/tree/main/ComputersApp into URL field an press Clone button

Command-line + IntelliJ Idea & Android Studio

  1. Run https://github.com/YosifKalchev/Ktor-Rest-Api.git command to clone project
  2. Open IntelliJ Idea and select File | Open... from the menu. Select RestApi folder in cloned directory and press Open button.
  3. Open Android Studio and select File | Open... from the menu. Select ComputersApp folder in cloned directory and press Open button.
NOTE: You need to run the RestApi first

Author

Follow me

About

Custom Ktor Rest Api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published