- Programming language : Kotlin
- Framework : Spring Boot 2.1
- Data sources : MongoDB
- Java JDK 8
- IntelliJ Idea (Community Edition)
- Import the project in IntelliJ :
- File ; New Project for existing sources
- Choose
Gradle
when asked
- Setup the Ktlint linter tools with
./gradlew setupProject
- Configures intelliJ code formatter
- Adds a git commit prehook to check code format with ktlint
- Note: Needs ktlint to be installed first
brew install shyiko/ktlint/ktlint
- To ensure sourcetree works with ktlint, add
export PATH=/usr/local/bin:$PATH
in.git/hooks/pre-commit
- Start the application :
- Right-click on file
IkarBackendApplication.kt
; Run
- Right-click on file
- Set an active profile :
- Application is most likely to crash without a Spring Boot active profile
- Run ; Edit Configurations
- Add
-Dspring.profiles.active=local
inVM options
configuration
You can use the docker-compose for local devs : support/docker-dev/docker-compose.yml
It will run a mongoDB container running on the default port and smtp4dev (local smtp server with a web UI) : http://127.0.0.1:8081
#####################################################################################
##################################################################################### add this plugin in gradle config :
plugins {
id("com.github.ben-manes.versions") version "0.22.0"
}
then generate the report : ./gradlew dependencyUpdates -Drevision=release
#####################################################################################
##################################################################################### There is swagger configured in local/dev profiles http:///swagger-ui/index.html
#####################################################################################
#####################################################################################
A bitbucket pipeline is configured on branches master
and staging
to execute all tests.
The configuration is managed in bitbucket-pipelines.yml
The file bitbucket-pipelines-known-hosts
contains the ssh signatures of deployment servers, it is used by the pipelines.
-
sprint* branches : deployment is fully automatic at each commit on a sprint* branch
-
master/staging branches : build is fully automatic at each commit on the branch, the deployment has to be manually triggered on bitbucket : https://bitbucket.org/appstud/ikar_backend/addon/pipelines/home
If you don't want to trigger an automatic build, add [skip ci]
or [ci skip]
to your commit message
#####################################################################################
#####################################################################################
The dev deployment is using heroku :
https://dashboard.heroku.com/apps/swagger-backend https://dashboard.heroku.com/apps/swagger-backoffice
Some env vars must be set (https://dashboard.heroku.com/apps/swagger-backend/settings
) :
PORT
APPSTUD_LIBRARIES_SECURITY_JWT_SECRETKEY
SPRING_MAIL_PASSWORD
SPRING_PROFILES_ACTIVE
SPRING_DATA_MONGODB_URI
Local setup :ย https://dashboard.heroku.com/apps/swagger-backend/deploy/heroku-git
Build & deployment : see the CI section
The preprod deployment is using an OVH VPS (VPS Cloud RAM 2) : *******
It is managed with a docker-compose file (docker/docker-compose.yml
)
A few env vars are required and must be set on the server (see docker/.env.tpl
)
To access the server, see the shared credential file (gdrive)
Build & deployment : see the CI section
The preprod deployment is using an OVH VPS (VPS Cloud RAM 3) : *******
It is managed with a docker-compose file (docker/docker-compose.yml
)
A few env vars are required and must be set on the server (see docker/.env.tpl
)
To access the server, see the shared credential file (gdrive)
Build & deployment : see the CI section
#####################################################################################
#####################################################################################
The applications uses Spring Boot standard profiles configuration. Configuration files are located in the folder ./src/main/resources/config and are using YAML format
This application uses ktlint to keep code syntax consistency across project.
In order to automatically fix linter issues, run ./gradlew ktlintFormat
Source code is located at src/main/kotlin/com/ikar/backend
Unit & endpoints tests are located at src/test/kotlin/com/ikar/backend
brew cask install ngrok
Note: Or install from https://ngrok.com/download
ngrok http -region eu 8080
Note: https url is displayed in the console
Forwarding https://ac1ff9c5.eu.ngrok.io -> localhost:8080