Modern backend REST API for a coffee shop application built with Kotlin and Ktor.
- Kotlin
- Ktor
- Exposed ORM
- SQLite database
- JWT Authentication
- OpenAPI & Swagger UI for API documentation
Based on the OpenAPI specification, the following endpoints are available:
-
Category
GET /category- Get all categories
-
Product
GET /product/{id}- Get product by IDGET /product/popular/limit/{limit}/page/{page}- Get popular products with paginationGET /product/newest/limit/{limit}/page/{page}- Get the newest products with paginationGET /product/special-offer/limit/{limit}/page/{page}- Get special offer products with paginationPOST /product/search- Search products with filters
-
User
GET /user/info- Get current user infoGET /user/name- Get usernameGET /user/by-email- Get user by emailGET /user/{id}- Get user by IDDELETE /user/{id}- Delete user by IDPUT /user/edit- Edit user detailsPUT /user/change-password- Change user passwordPOST /user/reset-password- Reset user password
-
Authentication
POST /auth/login- User loginPOST /auth/register- User registrationPOST /auth/refresh-token- Refresh authentication tokenPOST /auth/send-otp/{email}- Send OTP to emailPOST /auth/verify-otp- Verify OTPPOST /auth/resend-otp/{email}- Resend OTP
-
Cart
GET /cart/all- Get all items in cartGET /cart/items-size- Get cart sizePOST /cart/add- Add item to cartPOST /cart/delete- Delete items from cartPOST /cart/apply-promo-code- Apply promo code to cart
-
Favorite
POST /favorite/is-favorite/{product_id}- Check if product is favoritePOST /favorite/add/{product_id}- Add product to favoritesDELETE /favorite/delete/{product_id}- Delete product from favorites
-
Review
GET /review/order/{orderId}- Get reviews by order IDPOST /review/add- Add reviewPUT /review/edit- Edit reviewDELETE /review/delete/{id}- Delete review by ID
-
Order
GET /order/{id}- Get order by IDGET /order/{orderId}/products- Get order productsPUT /order/cancel/{orderId}- Cancel orderDELETE /order/delete/{id}- Delete orderPOST /order/add- Create new order
-
Address
GET /address/all- Get all addressesGET /address/default- Get default addressPOST /address/set-default/{id}- Set default addressPOST /address/delete/{id}- Delete addressPOST /address/add- Add new addressPUT /address/edit- Edit address
-
3D Secure
GET /3d-secure/verification- 3D Secure verificationPOST /3d-secure/callback- 3D Secure callbackGET /3d-secure/success- 3D Secure successGET /3d-secure/failure- 3D Secure failure
-
FAQ
GET /faq/all- Get all FAQsGET /faq/{id}- Get FAQ by IDGET /faq/language-code/{code}- Get FAQs by language codePOST /faq/add-faq- Add new FAQPOST /faq/add-translation- Add FAQ translationPUT /faq/edit- Edit FAQDELETE /faq/delete/{id}- Delete FAQ