A Modern Kotlin-Spring RESTful API example. Connects to a PostgreSQL database and uses Exposed framework for database operations. Focused on Clean Architecture, SOLID Principles and feature based development.
- Spring Framework
- Kotlin
- Authorization -> JWT
- Database -> PostgreSQL
- ORM SQL Framework -> Exposed
- Ktor Client -> For External API calls
- Build Tool -> Gradle
- Server -> Tomcat
- API Documentation -> Swagger
resources/application.conf
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/$YOUR_DB_NAME"
spring.datasource.username="$YOUR_USERNAME"
spring.datasource.password="$YOUR_PASSWORD"
You can access it via http://localhost:$PORT(8080 default)/swagger-ui/
GET /public-api/v1/healthCheck
Just returns a simple string
POST /public-api/v1/authentication/createUser
Registers a user to the db
POST /public-api/v1/authentication/login
Returns a jwt token if success
GET /api/v1/authentication/userInfo (Needs Authorization token from login as Authorization header : "Bearer
{$token}")
Returns the user information
GET /api/v1/star-wars/movie (Needs Authorization token from login as Authorization header : "Bearer {$token}")
An External API call example. Returns a movie information from an external api