Skip to content

A simple REST APIs made with ktor for performing CRUD operation and authenticating users. It manages notes created by the users.

Notifications You must be signed in to change notification settings

sDevPrem/ktor-notes-api

Repository files navigation

ktor-notes-api

A simple REST APIs made with ktor for performing CRUD operation and authenticating users. It manages notes created by the users.

Features

  1. User Login / Signup
  2. Perform CRUD operation on notes
  3. JWT Authentication
  4. Ktorm ORM for DB
  5. Dependency Injection using Koin
  6. Password Hashing using Bcrypt

Build With

ktor server : Framework for building REST APIs.
JSON Web Token : To access the authenticated ends.
Ktorm : ORM for SQL database.
Docker : For Containerizing.
Jackson : For serialization and deserialization of JSON.
Koin : For dependency injection.
Bcrypt: For password hashing.

Installation

  1. Create tables in your sql database (because ktorm not creates table if they don't exist) according to the ktorm tables located in data/schema package.
  2. Introduce these environment variables in your server to integrate with sql database and configure jwt token.
    1. DB_URL - URL of your database.
    2. DB_USER - database username.
    3. DB_PWD - database password.
    4. JWT_SECRET - secret for jwt token.
    5. JWT_REALM - jwt realm
    6. PORT - (optional) For the port to use
      OR you can edit the variables name according to your server in /src/main/resources/application.conf file.
  3. Deploy to the server that supports FatJar or Docker OR open this project in IntelliJ IDEA, community or enterprise edition and follow these steps to run the Application.

More info on Deployment of ktor project.

More info

This is the server side implementation. The client side is an android app which you can find here to see this REST API in action.