Developing with FX Professional
You have the option of taking a source code release of FX Professional, which allows you to customise and extend FX Professional. This page provides an overview of how to get started.
We encourage extending Caplin source code rather than changing it. Changing core Caplin source code can make taking future upgrades more difficult.
Caplin offers training on FX Professional and can offer advice on how to customise it safely. To learn more, contact your Caplin account manager.
Requirements
To develop with FX Professional, you need:
-
Node.js version 14.
-
OpenJDK 8 or 11.
-
The 'fxtrader-version.zip' source code file for your variant of FX Professional, available from the Caplin downloads page.
-
Yarn package manager.
-
Caplin CLI. See Installing Caplin CLI.
-
Network access to GitHub.
-
Network access to the npm registry.
A working Caplin Platform stack, connected to your backend systems, composed of:
-
Liberator services:
-
Caplin Permissioning Service
-
-
Transformer services:
-
Charting Service (if your FX Professional variant includes charting).
-
Watchlist Service (if your FX Professional includes watchlists).
-
Alerts Service (if your FX Professional includes notifications).
-
FieldMapper module (if your FX Professional includes post-trade allocations).
-
Any other services specific to your deployment, as advised by Caplin.
-
Adapters specific to your deployment, as advised by Caplin.
Preparing for development
There are a couple of things you need to decide on for this project:
-
Where to store the project’s Java dependencies.
-
A Git branching strategy that makes taking future source code releases easier.
Storing dependencies
Before you start customising FX Professional, decide where you’re going to store this project’s Java module dependencies, as listed in the file fxpro/apps/fxtrader/server/java/dependencies.gradle
.
You can choose to store this project’s Java dependencies in one of two locations:
-
(Recommended) An artifact repository such as Artifactory.
-
Your project’s Git repository.
Branching strategy
It’s important to decide on a branching strategy early on in the project to make taking upgrades to FX Professional easier. An example of a simple branching strategy follows, which uses a caplin
branch to track changes between Caplin source code releases and merge them into an integration branch, develop
.

To set up this example branching strategy, follow the steps below:
-
Create a new directory to host your project.
-
Extract the 'fxtrader-version.zip' file to the project directory.
-
Initialize the git repository:
$ git init
-
Add all files to the staging area:
$ git add --all
-
Execute the initial commit:
$ git commit -m "Initial commit"
-
Tag the commit to record the version of the Caplin source code release:
$ git tag caplin-fxpro-3.0.0
-
Create an integration branch (
develop
) and a branch to track Caplin source code releases (caplin
):$ git branch develop $ git branch caplin
When a new version of FX Professional is released:
-
Checkout the
caplin
branch:$ git checkout caplin
-
Delete all files in the
caplin
branch:$ rm -r *
Do not use git rm -r *
to delete the files. Note that if you delete the files using an IDE, it’s probable thegit rm
command is used to execute the deletion. -
Extract the new source code release to the
caplin
branch. -
Update Git’s staging area to match your working directory:
$ git add --all
-
Commit changes:
$ git commit -m "Caplin source code release FX Professional 3.30.0"
-
Tag the commit:
$ git tag caplin-fxpro-3.30.0
-
Checkout the
develop
branch:$ git checkout develop
-
Merge
caplin
intodevelop
:$ git merge caplin
-
Resolve merge conflicts.
Creating your development project
Follow the steps below:
-
Download your 'fxtrader-version.zip' source code file of FX Professional, available from the Caplin downloads page.
-
Create a new directory under your development directory to host the new software project.
-
Extract the source code ZIP into this directory:
-
If you have chosen to store your Java module dependencies in an Artifactory repository (see Preparing for development above), then import all the JAR files from
fxpro/apps/fxtrader/server/java/src/main/webapp/WEB-INF/lib
into that repository. For the group IDs of the JAR files, please see the filefxpro/apps/fxtrader/server/java/dependencies.gradle
.Add your internal artifact repository to this project’s
build.gradle
file:fxpro/apps/fxtrader/server/java/build.gradlerepositories { mavenCentral() maven { url "https://plugins.gradle.org/m2/" } maven { url 'https://<artifactory_host_name>/artifactory/<repository_name>' } }
-
Initialize your Git repository, and create your initial branches according to your branching strategy. See Branching strategy above.
-
In the directory
fxpro/apps/fxtrader/
run the command below to install this project’s Node modules:$ yarn install
You can now start customising the source code of FX Professional.
Previewing your changes
To preview any customisations you make your variant of FX Professional, follow the steps below:
-
Find your FX Professional variant name in
fxpro/apps/fxtrader/src/customers/variant
. -
In the
fxtrader
directoryfxpro/apps/fxtrader/
, run the appropriate command below to start Express and Gretty:Java module dependencies stored in an artifact repository$ yarn start --variant variant
Java module dependencies stored in the project$ yarn start --variant variant --useLocalDeps
When you specify
--useLocalDeps
, the dependencies stored in directoryfxpro/apps/fxtrader/server/java/src/main/webapp/WEB-INF/lib
are used.If you run this command without --useLocalDeps
, all local dependencies in thefxpro/apps/fxtrader/server/java/src/main/webapp/WEB-INF/lib
directory are deleted in expectation of downloading them from a Maven compatible repository.
View a preview of your customisations at http://localhost:8080.
When you make a change to your project, refresh the page to view your changes.