NotesApp is a project which demonstrates the power of Kotlin's Ktor in developing powerful REST APIs with all basic as well as advanced features.
Project is live at Heroku Link.
- IntelliJ Idea
Ktor Controller (http) -> Route (business) -> Repository (data)
- Create Notes
- Update Notes
- Fetch Notes
- Delete Notes
- JWT Authentication
- Ktorm ORM for DB + Postgress
- Dependency Injection using Koin
- Automatic and easy deployment to Heroku
- Pagination
- Sorting results using parameters
- Unit Testing
- Middlewares for Validations
- Searching
Use IntelliJ IDEA, community or enterprise edition to open the project and follow these steps to run the Application.
Notes -: Customise the application.conf file. Fill your own
secret, audience, issuer, realm
to configure the JWT.
Similarly,specify your port and host inside the application.conf
file in which you want to run the server. Also mention you database connection string in key jdbc_db_url
You can use whatever db you are comfortable in MySql, Postgres.
POST http://host:port/note
Content-Type: application/json
{
"note": "your-note",
}
GET http://host:port/notes
GET http://host:port/notes/{id}
DELETE http://host:port/notes/{id}
PUT http://host:port/notes/{id}
POST http://host:port/register
Content-Type: application/json
{
"username": "username",
"password": "password"
}
POST http://host:port/login
Content-Type: application/json
{
"username": "username",
"password": "password"
}
GET http://host:port/open
GET http://host:port/download