The purpose of the project is to create custom Rest API using Ktor,
populate it and use the data via showcase application.
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
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
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.
-
Tech-stack
- 100% Kotlin + Coroutines - perform background operations
- Retrofit - networking
- Jetpack
- Hilt - dependency injection
- Coil - image loading library
-
Modern Architecture
- Clean Architecture (at feature module level)
- Single activity architecture using Navigation component
- GitHub Actions
- Automatic PR verification including tests, linters and 3rd online tools
-
UI
-
Gradle
There are a few ways to open this project.
IntelliJ Idea
->File
->New
->From Version control
->Git
- Enter
https://github.com/YosifKalchev/Ktor-Rest-Api/tree/main/RestApi
into URL field an pressClone
button 3.Android Studio
->File
->New
->From Version control
->Git
- Enter
https://github.com/YosifKalchev/Ktor-Rest-Api/tree/main/ComputersApp
into URL field an pressClone
button
- Run
https://github.com/YosifKalchev/Ktor-Rest-Api.git
command to clone project - Open
IntelliJ Idea
and selectFile | Open...
from the menu. SelectRestApi
folder in cloned directory and pressOpen
button. - Open
Android Studio
and selectFile | Open...
from the menu. SelectComputersApp
folder in cloned directory and pressOpen
button.
NOTE: You need to run the RestApi first