Instructions for pulling the sources, building and starting Apache Fineract CN. This guide assumes that default OS is Debian/Ubuntu flavours of Linux with some adjustments for developers using MacOS. |
There are multiple routes to building and running fineract-CN. You may also want to review the minimalist approach using docker and docker-compose. |
| What you need to have installed | Debian/Ubuntu notes | Mac notes |
|---|---|---|
| Web browser (like Google Chrome) | Google Chrome On Ubuntu 16.06 LTS | Google Chrome |
| Ensure that you have Oracle Java SDK 8 | You can use this tutorial to do that. | See this tutorial at mkyong. |
| You might have multiple Java versions installed so make sure that Java 8 is used. java -version # should display java version "1.8.0_XXX". | This tutorial teaches how to choose the correct Java version like this:
| |
| Install Git | Install git using This Article | Here we use Homebrew approach (not the only package manager but one that is preferred on mac)
|
Install PostgreSQL
| PostgreSQL installation guide | |
| Optional step: install Maven and ensure that artifacts are stored in $USER_HOME/.m2/repository | Install maven using mkyong | brew install maven |
Optional step: install Gradle This step is optional as all the Fineract CN | Use sdkman to install Gradle 4.5 | brew install gradle |
You need NoSQL database Alternative: If you have Docker installed you docker run -p9042:9042 cassandra:3.11 | Install cassandra 3.11 using this guide |
|
| Node 6.10+ and NPM 3+ | Ensure you have Node 6.10.0+ and NPM 3+ installed. |
npm (node package manager for javascript) is another package manager, homebrew still treats it like a keg to be installed, instructions |
| Node packages | npm i | npm i |
| Optional step: Install Nginx | Install Nginx using this guide |
You have 3 options.
Recommended: You clone demo-server and let it download all dependendent fineract-cn-* libraries and projects from Artifactory to your local Maven repository
Follow the instructions:
mkdir integration-tests
cd integration-tests
git clone https://github.com/apache/fineract-cn-demo-server.git
cd fineract-cn-demo-server/
cd scripts/dependencies_to_local_maven
mvn package (this brings all the fineract-cn-* dependencies from Artifactory to your local maven repo)
cd ../..
./gradlew build
Read what demo server is about. Explanatory note: To better understand what the demo server does, optionally consider manually orchestrating the services as illustrated at https://github.com/vishwasbabu/ProvisioningFineractCN. Following this link takes you to a different process.
Note: On average the build process below will take at least 30 - 40 mins to complete when building on 8 (x86-64) dedicated cores, >=16 GB of memory and an SSD drive.
Note: To only work with a minimum set of services (to get started quickly), add additional flag to each of the following commands: -Ddemoserver.lite=true (more info from demo-server readme)
cd into `integration-tests/fineract-cn-demo-server/build/libs/` (or if you just cloned demo-server (option #1 in previous step) then just cd into build/libs)
No services locally listening on ports: 4200, 61616, 2021, 2022, 2022, 2023, 2024, 2025, 2026, 2028, 2029, 2030, 2031, 2032, 2033
You can use key "demoserver.persistent" to run demo server in two separate modes:
You can look up starting the internal databases from the code.
If you don't add argument -Ddemoserver.persistent when starting demo-server then demo-server starts up internal PostgreSQL and Cassandra databases.
Use the command `java -jar -Ddemoserver.provision=true demo-server-0.1.0-BUILD-SNAPSHOT.jar` (and add -Ddemoserver.lite=true if you only want a subset of services)
If you add -Ddemoserver.persistent=true argument when starting demo-server then demo-server doesn't launch databases internally and you need to run the databases locally yourself.
Make sure Cassandra and PostgreSQL services are started using `service postgresql start` and `service cassandra start`.
Note that your username and password of your locally-installed datastores - PostgreSQL and cassandra - will have to conform to the specifications in demo-server to work. You'll have to ensure PostgreSQL's `postgres` user has password `postgres` and Cassandra's `cassandra` user has password `password` .
If you are running Fineract CN for the first time on your OS, use command I to create PostgreSQL and Cassandra local databases.
Command I: `java -Ddemoserver.provision=true -Ddemoserver.persistent=true -Dcustom.cassandra.contactPoints=127.0.0.1:9042 -Dcassandra.cluster.user=cassandra -Dcassandra.cluster.pwd=password -Dcustom.postgresql.host=localhost -Dcustom.postgresql.user=postgres -Dcustom.postgresql.password=postgres -jar demo-server-0.1.0-BUILD-SNAPSHOT.jar`
Note: if running command I failed for any reason, delete any residual databases or keyspaces 'seshat' and/or 'playground' in PostgreSQL and Cassandra, and start over with command I until it succeeds.
After command I runs to completion, verify that databases `playground` and `seshat` have indeed been created by logging into PostgreSQL's `postgres` user account and running `\l ;`.
Also, log into Cassandra's cassandra user account and type `describe keyspaces;` to ensure that `seshat` and `playground`
If you have successfully used command I to run demo-server before, then use command II HENCEFORTH which uses the local databases created by command I.
Command II: `java -Ddemoserver.persistent=true -Dcustom.cassandra.contactPoints=127.0.0.1:9042 -Dcassandra.cluster.user=cassandra -Dcassandra.cluster.pwd=password -Dcustom.postgresql.host=localhost -Dcustom.postgresql.user=postgres -Dcustom.postgresql.password=postgres -jar demo-server-0.1.0-BUILD-SNAPSHOT.jar`
This takes some time so be patient. From console output you see demo-server starting up services one by one. Eventually the following services should be set up:
| Service | Port | Link |
|---|---|---|
| Identity Service: | 2021 | http://localhost:2021/identity/v1 |
| Office Service: | 2023 | http://localhost:2023/office/v1 |
| Customer Service | 2024 | http://localhost:2024/customer/v1 |
| Accounting Service | 2025 | http://localhost:2025/accounting/v1 |
| Portfolio Service | 2026 | http://localhost:2026/portfolio/v1 |
| Deposit Service | 2027 | http://localhost:2027/deposit/v1 |
| Teller Service | 2028 | http://localhost:2028/teller/v1 |
| Reporting Service | 2029 | http://localhost:2029/reporting/v1 |
| Cheque Service | 2030 | http://localhost:2030/cheques/v1 |
| Payroll Service | 2031 | http://localhost:2031/payroll/v1 |
| Group Service | 2032 | http://localhost:2032/group/v1 |
| Notification Service | 2033 | http://localhost:2033/notification/v1 |
The following log statement signals the completion of the build:
“INFO o.e.jetty.server.AbstractConnector - StoppedServerConnector@1bdb0376{HTTP/1.1,[http/1.1]}
Only after this has occurred can you move to the next step. Note that the logs won't stop after this statement.
Read what fims-web-app is about.
Feedback Note : If there are packages such as @angular-devkit or @rxjs which you aren’t installed, then do so manually at this point;
Run ’npm run dev’
Wait until a similar message is displayed in logs:
chunk {0} index.html 1.XX kB [entry] [rendered]
webpack: Compiled successfully.
Note that, if you are running the system from a remote server, you will have to replace 'localhost' in 'http://localhost' in lines 3,10,17,etc with the IP address of your server in your proxy.conf.json file.
Tenant : playground
Username : operator
Password : init1@l
Feedback Note : You should be on fims - backoffice at http://localhost:4200/quickAccess
Congratulations! You’ve Successfully Ran Apache Fineract CN
Related articles
|
Useful external links