Skip to content

jorgecodelia/kotlinApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example kotlin Rest API

Overview

This documentation outlines the endpoints available in the example REST API built with Spring Boot 3 and kotlin.

Dependencies

The following report links work once the api is compiled in local

Resource Documentation Report
kotlin https://kotlinlang.org/ No
Java https://openjdk.org/projects/jdk/17/ No
Gradle https://gradle.org/ No
Spring Boot https://spring.io/projects/spring-boot/ No
JUnit https://junit.org/junit5/ Report
Pitest https://pitest.org/ Report
ArchUnit https://www.archunit.org/ Yes
SpotsBugs https://github.com/spotbugs/spotbugs/ Yes
Checkstyle https://checkstyle.sourceforge.io/ Report
PMD https://pmd.github.io/ Report
Open API https://springdoc.org/ Report

Project Structure

example-kotlin-api/
│
├── config                                              // api main config src
├── gradle/                                             // Gradle configurations file
├── src/
│   ├── main/
│   │   ├── kotlin/
│   │   │   └── com.exmple.kotlin.api/
│   │   │      ├── config/                              // General configurations
│   │   │      ├── controller/                          // REST API controllers
│   │   │      ├── entity/                              // Api general entities
│   │   │      ├── exception/                           // Global custom exceptions
│   │   │      └── repository                           // Repository interfaces
│   │   │      ├── service/                             // Service layer
│   │   │      └── Application.kt                       // Main class to run the application
│   │   │
│   │   └── resources/                                  // Project Resources
│   │
│   └── test/                                           // Project Test sources
│
├── .gitignore                                          // git ignore configuration file
├── build.gradle                                        // Gradle build configuration file
└── README.md                                           // Project MD documentation

Base URL

The base URL for all endpoints is http://localhost:8080/api/fabrik/v1.

API Endpoints

The following endpoints are available:

  • GET /fabrik/api/v1/accounts: Retrieves all accounts.
curl --location 'http://localhost:8080/fabrik/api/v1/accounts' \
--header 'Content-Type: application/json'

Endpoint Documentation

The openApi URL documentation in local environment is http://localhost:8080/api/swagger-ui/index.html.

Important gradle tasks

- `clean`  - clean build results
- `build`  - build public artifact
- `test`   - run unit tests and arch unit tests
- `pitest` - run pitest mutation test

Build

./gradlew clean build test pitest

Run

./gradlew bootRun -Dspring.profiles.active=local

License

This Api is distributed under the terms of the MIT License. See the license for details.

About

Kotlin Rest Api example

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages