Giter Site home page Giter Site logo

kotlin-spring-8x-template's Introduction

kotlin-spring-8x-flow

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
  • Automatic format before commit when using IDEA commit dialog
    • Enter Preferences -> Version Control -> Commit Dialog
    • Check on all options (exclude copyright)

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-8x-flow .
# inject environment variables, check details in config/application-dev.yml
docker run -p 8080:8080 <environment> kotlin-spring-8x-flow

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

Features

  • 服务模板,用package模拟微服务
    • 4层领域服务模板
      • 黑马考试特供版
    • 8x业务服务模板

kotlin-spring-8x-template's People

Watchers

James Cloos 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.