Coder Social home page Coder Social logo

spring-boot-doma2-sample's Introduction

Spring Boot Sample Application

Build Status Documentation Status

ローカル環境

開発環境(IntelliJ)

必要なプラグイン・設定

  • Lombok pluginをインストールする。
    • Settings > Build, Excecution, Deployment > Compiler > Annotation Processor > Enable Annotation ProcessingをONにする。
  • bootRunを実行している場合でもビルドされるようにする。
    • Intellij > Ctrl+Shift+A > type Registry... > compiler.automake.allow.when.app.runningをONにする。
  • Windowsの場合は、コンソール出力が文字化けするため、C:¥Program Files¥JetBrains¥IntelliJ Idea xx.x.x¥binの中にあるidea64.exe.vmoptionsファイルに-Dfile.encoding=UTF-8を追記する。
  • ブラウザにLiveReload機能拡張をインストールする。

Dockerの起動

MySQLなどのサーバーを立ち上げる。

$ cd /path/to/spring-boot-doma2-sample
$ ./gradlew composeUp

アプリケーションの起動

管理側

$ # admin application
$ cd /path/to/spring-boot-doma2-sample
$ ./gradlew :sample-web-admin:bootRun

フロント側

$ # front application
$ cd /path/to/spring-boot-doma2-sample
$ ./gradlew :sample-web-front:bootRun

バッチ

$ # 担当者情報取り込みバッチを起動する
$ cd /path/to/spring-boot-doma2-sample
$ ./gradlew :sample-batch:bootRun -Pargs="--job=importStaffJob"

接続先情報

テストユーザー [email protected] / passw0rd

接続先 URL
管理側画面 http://localhost:18081/admin
管理側API http://localhost:18081/admin/api/v1/users
フロント側 http://localhost:18080/

データベース接続先

mysql -h 127.0.0.1 -P 3306 -uroot -ppassw0rd spring-boot-doma2-sample

ブラウザを用いた自動テスト(結合テスト)

実行方法

テスト対象 実行方法
管理側画面 gradlew :it/sample-web-admin:test
フロント側 gradlew :it/sample-web-front:test

※ IntelliJから起動する場合は他のテストと同様にテストクラスを選択して実行してください

CIなどで結合テストを行わない場合は以下のようにして対象から外します

$ ./gradlew clean test --info -x :it/sample-web-admin:test -x :it/sample-web-front:test

コード自動生成(おまけ)

$ cd /path/to/spring-boot-doma2-sample
$ ./gradlew codegen -PsubSystem=system -Pfunc=client -PfuncStr=取引先 [-Ptarget=dao|dto|repository|service|controller|html]

参考

プロジェクト 概要
Lombok Project 定型的なコードを書かなくてもよくする
Springframework Spring Framework
Spring Security セキュリティ対策、認証・認可のフレームワーク
Doma2 O/Rマッパー
spring-boot-doma2 Doma2とSpring Bootを連携する
Flyway DBマイグレーションツール
Thymeleaf テンプレートエンジン
Thymeleaf Layout Dialect テンプレートをレイアウト化する
WebJars jQueryなどのクライアント側ライブラリをJARとして組み込む
ModelMapper Beanマッピングライブラリ
Ehcache キャッシュライブラリ
Spock テストフレームワーク
Mockito モッキングフレームワーク

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.