You can find javadoc documentation here: https://motech-implementations.github.io/mercir-docs/.
Clone this repository from GitHub:
git clone https://github.com/motech-implementations/mots.git
- Start the service with
./gradlew bootRun
orgradle bootRun
. 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 bootRun
: try clicking CTRL+F9 to build project (ie. all Java classes in classpath), and accept a prompt asking about reloading changed classes.
- Start Java server with
./gradlew bootRun
orgradle bootRun
(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
~/mots/.gradle/nodejs/node-v6.11.4-linux-x64/bin/node
and "ESLint package" to~/mots/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/db/changelog and have the following format yyyyMMdd_HHmm.mysql.sql (e.g. 20171102_1634.mysql.sql) - Include the generated migration in the changelog by adding the following line to the liquibase-changelog.xml file:
<include file="{migration file name}" relativeToChangelogFile="true" />
- In
mots
root directory run:
mysql -uroot -p mots < src/main/resources/test_modules.sql
mysql -uroot -p mots < src/main/resources/test_ivr_config.sql
- Type your root password
- Go into ~/.gradle
- Create gradle.properties file (it will overwrite project's properties)
- Add
ivrApiKey=<voto-api-key>
to set VOTO communication.
To stop the service (when it is running with gradle bootRun
) use Control-C.
You can run React-Native project, both on physical IOS and Android devices, as well as on iOS Simulator or an Android Virtual Device.
If you want to run MOTS app on Android Virtual Device, the only thing you need to do, is setting up your Android development environment. Install android sdk && avd. For ubuntu you can install it with Android Studio, or use Genymotion.
Later, having Android Virtual Device running, go to /mobile folder and run npm run android
. App should automatically connect and display on emulator screen.
Also you should copy config.example.js
in a main folder to a new file config.js
, and there you can set up a configuration.
Use: cp ./mobile/config.example.js ./mobile/config.js
.
In case of any problems, or to get additional info, go to: https://facebook.github.io/react-native/docs/getting-started.html.
- Install Jaspersoft Studio 6.4.3
- Add mots/reports folder in Jasper Project Explorer
- After creating/editing a report (.jrxml) right click it and choose Compile from the menu .jasper file wil be generated
- Use generateHex.sh script to generate file with reports in hex format (used in migrations)
- Create migration with report, example or report update "20180228_1458_update_reports.sql", example of new report "20180227_1609_insert_chw_module.sql"