Git Product home page Git Product logo

cuba-bff's Introduction

cuba-bff

APIs built on the Cuba Platform.

  • Main language - Kotlin, Spring5
  • Testing - JUnit5, Mockk, Strikt(Assertions), TestContainers
  • ORM - JPQL(Eclipselink)
  • Build - Gradle
  • Database - Postgres

See API Documentation

To build

Various gradle tasks created by CUBA framework are available in project for building & testing whole project or individual modules **(core,global,web)**

Development

Under development: features outlined below may not be final.

branch ci status codacy code coverage codacy code quality notes
develop CircleCI Codacy Badge Codacy Badge Work in progress
main CircleCI N/A N/A Latest release

Git strategy

  • 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'

Deploy code + database for local development

  1. Install Docker & CUBA plugin for IntelliJ(IntelliJ 2020.2.3 provides stable support )

  2. Install Docker for desktop(Mac or Windows) & Connect it within IntelliJ

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

  4. Open IntelliJ 'Services' view to find 2 containers - tomcat & postgres running

  5. the docker-compose.yml runs tomcat in debug mode which allows hot reload

Coding Style

  • 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

Import order in Kotlin classes

Define following sequence of imports in IntelliJ settings

// static all other,
java.*, 
javax.*,
kotlin.*,
org.*, 
com.*
 
// all other imports

Deployment

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

Custom config

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 url

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

Api testing through postman

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 url

Swagger definitions are available at [host/app/rest/swagger-docs] [host/app/rest/swagger-ui.html]

cuba-bff's People

Contributors

wildthing81 avatar

Watchers

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