Skip to content

Gab0rB/weplantaforest

 
 

Repository files navigation

We Plant A Forest

Join the chat at https://gitter.im/Dica-Developer/weplantaforest Build Status Coverage Status Code Climate

Dev Requirements

Build System

We use Gradle as our build system. All commands listed here follow the pattern gradle <task>'. If Gradle is not installed on your system you can use sh gradlew <task> instead.

Useful commands
  • gradlew tasks - list all tasks
  • gradlew eclipse - setup eclipse files
  • gradlew run - start server for UI development
  • gradlew bootRun - start server for development (refreshes static resources)
  • gradlew test - execute unit tests (open report with open build/reports/tests/index.html
  • for executing single test add -Dtest.single=ExampleMainTest
  • for running tests on mysql add -Pmysql
  • gradlew clean - clean the project

IDE Configuration

Setup with the Gradle Integration for Eclipse plugin.

Setup by using the gradle eclipse plugin

Select "Import..." -> "Gradle Project" then build the model and import the plugins you need.

Additional stuff:

Make sure you have the following classes included for static import:

  • lombok
  • org.assertj.core.api.Assertions
  • org.mockito.Matchers
  • com.jayway.restassured.RestAssured

(In Eclipse under Preferences/Java/Editor/Content Assist/Favorites)

Testing and Developing with MySql

  • Create fresh databases:
  • drop database weplantaforest; create database weplantaforest;
  • drop database weplantaforest_test; create database weplantaforest_test;
  • Run tests with MySql from Gradle by adding the flag -Pmysql, e.g. gradle test -Pmysql
  • Run tests with MySql from Eclipse by either:
  • Change existing annotation @IntegrationTest({ "spring.profiles.active=test" }) into @IntegrationTest({ "spring.profiles.active=test,mysql-test" })
  • OR switch the included profiles in application-test.properties
  • Change existing MySql Schema (managed by Flyway)
  • Add to the latest (unreleased) src/main/resources/db/migration/V*.sql script
  • OR create a new script, e.g. src/main/resources/db/migration/V1_2__descriptionOfMyChange.sql

Stating the backend and the UI

./gradlew user:bootRun
./gradlew article-manager:bootRun
ui/node_modules/.bin/http-server --cors ui/client-react/
cd ui; webpack -w

About

Rewrite of "i plant a tree"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 57.2%
  • CSS 28.5%
  • JavaScript 11.3%
  • HTML 3.0%