Clone this repository from GitHub:
git clone https://github.com/motech-implementations/new-ebodac.git
- Install MySql with
$ sudo apt-get update $ sudo apt-get install mysql-server
- Start the service with
./gradlew
orgradle
. On first run it installs all dependencies like NPM, node modules etc. Once it is running, you should see 'Started Application in NN seconds'. Your console will not return to a prompt as long as the service is running. The service may write errors and other output to your console. - Best way for speed development is to add a
bootRun
Gradle configuration to IntelliJ Idea, and run it withDebug
option. - Hot-swapping Java classes without rerunning
./gradlew
: try clicking CTRL+F9 to build project (ie. all Java classes in classpath), and accept a prompt asking about reloading changed classes. - Go to localhost:8080
- Start Java server with
./gradlew
orgradle
(if you want run local environment gradle). - Run
./gradlew webpackWatch
orgradle webpackWatch
in separate terminal (or ideally in IntelliJ Idea) - Profit - your .scss, and .js files are reloaded automatically. Refresh your browser.
- Install Lombok, MapStruct nad NodeJS plugins under File -> Settings -> Plugins -> Browse repositories... search for the Lombok, MapStruct support and NodeJS plugins and install them all.
- Check the Enable annotation processing checkbox under File -> Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors.
- Download the
intellij-java-google-style.xml
file from the http://code.google.com/p/google-styleguide/ repo. Under File -> Settings -> Editor -> Code Style import the google-styleguide (gear icon -> Import Scheme -> Intellij IDEA code style XML) and choose it as current code style for the project. - Enable ESLint under File -> Settings -> Languages and Frameworks -> JavaScript -> Code Quality Tools -> ESLint and set "Node interpreter" to
~/new-ebodac/.gradle/nodejs/node-v10.16.0-linux-x64/bin/node
and "ESLint package" to~/new-ebodac/node_modules/eslint
(you need to rungradle build
or./gradlew build
before this to install gradle and npm dependencies)
- Generate the migration using the gradle task (
./gradlew dbDiff
), the migration file will be saved at /resources/liquibase/changelog and have the following format yyyyMMddHHmmSS_changelog.xml (e.g. 20190101163444_changelog.xml) - Include the generated migration in the changelog by adding the following line to the liquibase-changelog.xml file:
<include file="{migration file name}" relativeToChangelogFile="false" />
To stop the service (when it is running with ./gradlew
) use Control-C.
When testing locally you need to use https. For develop purposes self-signed certificate is used.
To accept self-signed certificate on chrome you need to create risk accepting chrome.
On Ubuntu: google-chrome --user-da-dir=/tmp/foo --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=https://localhost:8443
(Tip: This chrome instance may need to be only one working)
Sometimes it may be a case where one would like to re-create Quartz DB structure. In order to do so run following in terminal in the project root directory (set credentials arguments as required):
mysql --user="root" --password="password" --database="newEbodac" < "src/main/resources/recreate_quartz_mysql.sql"
`