Giter Site home page Giter Site logo

kotlin-spring-webflux-template's Introduction

kotlin-spring-webflux

More details in tutorial

Run

# set up local db
docker-compose -f docker-compose.local.yml up
# run spring application
./gradlew bootRun
# request
curl http://localhost:8080/hello

Development

  1. generate idea project config
./gradlew idea
  1. enable git hooks
git config --local core.hooksPath .githooks/ 
chmod 700 .githooks/pre-push
  1. config your IDEA
  • Import code style

    • Open IDEA, enter Preferences -> Editor -> Code Style -> Import Schema
    • Choose config/GoogleStyle.xml

      This style is based on GoogleStyle and default Kotlin style of Intellij Team, is suitable for both Java and Kotlin.

  • New line end of file

    • Enter Preferences -> Editor -> General
    • Check on Other: Ensure line feed at file end on Save
  • Set jvm of gradle

    • Enter Build, Execution, Deployment -> Build Tools -> Gradle
    • Select Gradle JVM: Use Project JDK

    If the jvm is different with your project, will cause 'No tests found' error

  • (Optional) Automatic format before commit when using IDEA commit dialog

    • Enter Preferences -> Version Control -> Commit Dialog
    • Check on Reformat/Optimize/Cleanup

Test

  1. init test & integration test
# unit test & lint
./gradlew clean check
# api test (must run after test)
./gradlew clean check apiTest
# (optional) test coverage report
./gradlew jacocoTestReport
  1. container test
# package
./gradlew clean build bootJar
# start in test container
docker-compose -f docker-compose.test.yml up --build

Deploy (locally)

# build image
docker build -t kotlin-spring-webflux .
# inject environment variables, check details in config/application-dev.yml
docker run -p 8080:8080 <environment> kotlin-spring-webflux

Should put this part into CI/CD, DON'T manually deploy in production If you want to check it locally, please try container test

kotlin-spring-webflux-template's People

Contributors

anddd7 avatar

Stargazers

 avatar

Watchers

 avatar  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.