#KTOR REST API FOR QUOTE This is simple REST API using ktor framework, demonstration of Project Structure, Code Quality, Architecture Pattern.
...
├── resources
│ ├── db/migration #Contain migration tables (Using Flydb)
│ └── application.conf
└── src
├── authorization
├── data
│ ├── models
│ │ ├── dto
│ │ └── entities
│ ├── repository
│ └── services
├── database
│ ├── dao
│ └── impl
├── errors
├── routes
├── utils
└── vo
...
- Login
- Register
- Users (CRUD)
- Quotes (CRUD)
POST Login / {{base_url}}/api/v1/login
Body: {
"email" : "xyz@email",
"password" : "123456"
}
POST Register / {{base_url}}/api/v1/register
Body: {
"name" : "Syed",
"email" : "xyz@email",
"password" : "123456"
}
GET Users / {{base_url}}/api/v1/users
Header: Authorization bearer {token}
GET Users / {{base_url}}/api/v1/users/{id}
Header: Authorization bearer {token}
POST Users / {{base_url}}/api/v1/users
Body: {
"name" : "Syed",
"email" : "xyz@email",
"password" : "123456"
}
Header: Authorization bearer {token}
PUT Users / {{base_url}}/api/v1/users/{id}
Body: {
"name" : "Syed",
}
Header: Authorization bearer {token}
DELETE Users / {{base_url}}/api/v1/users/{id}
Header: Authorization bearer {token}
GET Quote / {{base_url}}/api/v1/quotes
GET Quote / {{base_url}}/api/v1/quotes/{id}
POST Quote / {{base_url}}/api/v1/quotes
Body: {
"quote" : "Talk is cheap, show me the code",
"author" : "Linus Torvalds"
}
Header: Authorization bearer {token}
PUT Quote / {{base_url}}/api/v1/quotes/{id}
Body: {
"quote" : "Updated quote",
}
Header: Authorization bearer {token}
DELETE Quote / {{base_url}}/api/v1/quotes/{id}
Header: Authorization bearer {token}