Giter VIP home page Giter VIP logo

spring-boot-app's Introduction

Sample Spring Boot Project

The most basic spring boot microservice

Build Tool: Gradle Language: Kotlin Spring Boot Version: 2.4 Tags: REST,OpenApi,Actuator,JIB,ktlint,aciidoc

How to run?

gradle bootRun

Server is running so actuator endpoints are responsive.

GET http://localhost:8080/actuator/info 
{"git":{"branch":"master","commit":{"id":"1adc0ab","time":"2021-02-20T18:33:37Z"}},"build":{"operatingSystem":"Mac OS X (10.16)","artifact":"spring-boot-app","by":"canyaman","group":"me.yaman.can","basePackage":"me.yaman.can.demo","version":"0.0.1-SNAPSHOT","continuousIntegration":"false","build":"0","machine":"Can-MacBook-Pro","name":"spring-boot-app","time":"2021-02-20T19:12:18.116Z"}}
GET http://localhost:8080/actuator/health
{"status":"UP"}

Hot to develop?

First of all, build project after every file changes. As a background task run the task on the console

gradle build --continuous

While continuous build running, run the application (console or IDE)

gradle bootRun

Then you can utilize live reload feature

How to validate?

gradle test
gradle ktlint

How to deploy?

Build local docker registery container image

gradle jibDockerBuild

Then run application inside container

docker run -p 80:8080 spring-boot-app
GET http://localhost/actuator/info   
GET http://localhost/actuator/health  

Documentation

Project is structered as to generate microservice documentation. OpenApi v3 former swagger doc is also included. Swagger-UI is awesome tool but not satisfy all requirements. You can enrich openapi doc output via annotation but I don't perefer that. These annotations contradict the some principles. Without these annotations function name and functional annotation should express the meaning beacuse of that I need another level of layer for the documentation. In addition to that I don't want to write down the same info again and again in another format. At the end code generated openapi doc file converted to asciidoc and enriched by document generation step.

Accessing documentation

You can upload document at the central place like confluence but confluence gradle plugin and cwiki converter has some issue just because of that I prefer self contained version. You can access api doc from swagger doc desctiontion field link or just http://localhost:8080/asciidoc/index.html link.

spring-boot-app's People

Contributors

canyaman avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.