Deriv.com - An online trading platform that offers a wide selection of derivatives to trade on 24/7.
Before running or contribute to this project, you need to have the setup of the following packages in your environment
contribution
)Moreover, having these extensions will help you to speed up the development process and adhere to the best practices
npm run format
.
Installation guide for
VS Code - https://www.codementor.io/@myogeshchavan97/how-to-automatically-format-code-in-visual-studio-code-using-prettier-1nebhfbxak
WebStorm - https://www.jetbrains.com/help/webstorm/prettier.html#prettier_before_you_startnpm run stylelint
)npm run eslint
)Fork the project
In order to work on your own version of the Deriv application, please fork the project to your own repo.
Clone using SSH
git clone [email protected]:your-github-username/deriv-com.git
Enter project directory
cd deriv-com
Install your dependencies:
npm ci
Add env variables:
Create two files .env.development
and .env.production
inside your project root directory.
Then check your lastpass you'll see a shared item named Deriv-com Env Variables copy the variables, they look like this:
And paste them into the files.
To start developing:
npm start
Open the source code and start editing!
Your site is now running at http://localhost:8000
!
Note: You'll also see a second link: http://localhost:8000/___graphql
. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.
To contribute in the project, we need to create PRs to master. We have two types of PRs (Pull request):
{Developer}/{Clickup Card ID}/{Description}
format for PR titles. (e.g.: [Dev's Name]/COJ-247/Align next-button on mt5 modal
).PR will be based on the master branch if the commits are not having text changes
Create branch from the latest master branch
git checkout master
git pull upstream master
git checkout -b [_your_branch_name]
Make your changes
Make pull request following PR formatting guidelines.
Push your changes to your origin , add -u
flag for the first time push
git push -u origin [_your_branch_name]
Click on the autogenerated link from the terminal to open the PR
Make sure to change the PR base to master
branch
Pre-requisite:
Install crowdin-cli
brew tap crowdin/crowdin
brew install crowdin
Set up your Crowdin API KEY in your .bash_profile or .zshrc
Creating Branch
npm run branch:create
Proceed by choosing Normal Translation
Download Translations
npm run translation:pull
This command will trigger the workflow to pull latest translation from the specific branch and automatically add the commit to that PR.
Push the changes in the PR
Conflicts on message.json file
Don't worry it's easy to resolve, you can either resolve it using your changes or their changes doesn't matter because after you commit, it will again generate an updated messages.json file based on your current code, as long as you have all the changes from the master you are good to go.
Pulled the translations but strings are still not translated First you need to check if you have all the translations in your codebase. Search for the string and copy the corresponding hashed value for the string, can be found on messages.json
Now search the whole codebase using the hash, if json files for each languages appeared on your search results then you check if the values are not in English. Once the translations are proven to be there, you need to check where the strings are used Usually if your are using localize function when not in the react component it is failing to translate strings properly, you can convert them to instead
There are 2 types of releases:
Merging to master (squash and merge) will automatically release the last commit to the staging server https://staging.deriv.com
Releasing to production requires a tag using the following format:
production_VYYYYMMDD_${Integer}
--- Integer is the release version
Example of release steps
Create the tag following today's date
git tag production_V20200806_0 -m 'release to production'
Push the tag to the main repository
git push upstream production_V20200806_0
Upon creating PR, Vercel and Cloudflare will auto-generate two test links inside the PR. you can use that to preview the test link for the changes you have made.