APIs built on the Cuba Platform.
- Main language - Kotlin, Spring5
- Testing - JUnit5, Mockk, Strikt(Assertions), TestContainers
- ORM - JPQL(Eclipselink)
- Build - Gradle
- Database - Postgres
Various gradle tasks created by CUBA framework are available in project for building & testing whole project or individual modules **(core,global,web)**
Under development: features outlined below may not be final.
branch | ci status | codacy code coverage | codacy code quality | notes |
---|---|---|---|---|
develop | Work in progress | |||
main | N/A | N/A | Latest release |
- Currently, doing trunk based development on forks since team is small.
- Will move to Git flow (feature branches) when needed.
However, every commit message must:
- start with JIRA ticket no.
- tell a concise & clear functional story
- use imperative style e.g. Add tests for 'X' or Fix 'Y' or Create 'Z'
-
Install Docker & CUBA plugin for IntelliJ(IntelliJ 2020.2.3 provides stable support )
-
Install Docker for desktop(Mac or Windows) & Connect it within IntelliJ
-
Edit the docker-compose.yml configuration
- add 'clean buildWar' gradle tasks of project
- โ --build, force build images
Run
<project>/docker-compose.yml
by clicking on green gutter-icon on 'services' key in file. -
Open IntelliJ 'Services' view to find 2 containers - tomcat & postgres running
-
the docker-compose.yml runs tomcat in debug mode which allows hot reload
- Import the committed
codestyle.xml
into IntelliJ Preferences -> CodeStyle -> Kotlin scheme to set coding standards - Install
Detekt
plugin & enable its settings(Enable Detekt
,Enable formatting rules
,Treat detekt findings as errors
etc ) in Preferences -> Tools -> detekt - Add KDoc to significant functions in Services etc. Install KDoc-generator plugin for that.
- use explanatory variable names
Define following sequence of imports in IntelliJ settings
// static all other,
java.*,
javax.*,
kotlin.*,
org.*,
com.*
// all other imports
CircleCI config.yml in .circleci folder runs CI/CD pipe-line of following jobs
- code-coverage,
- build and register ECR image,
- deploy image to ECS cluster
for dev,staging environments
config parameters are to be stored in cuba sys config database table. For now, ck editor parameters are to be stored through the backend. Backend is to expose an api to update/insert config data, and seeder project is to be updated.
health check endpoints for Web,Core blocks are available at [/app-core/rest/health] (http://localhost:8080/app-core/remoting/health) [/app/rest/health] (http://localhost:8080/app/rest/health)
=> returns ok
Postman collection is part of this project and can be found under /postman directory. Import these environment files and collection to test various apis. => returns ok
Swagger definitions are available at [host/app/rest/swagger-docs] [host/app/rest/swagger-ui.html]