The absch.cbd.int project is hosting two Clearing-House Mechanism for the Conventions two Protocols (Nagoya and Biosafety Protocol). The project is built using AngularJs with RequireJS. Recently the project code was migrated to es6 syntax to benefit from nex syntax. Internally Rollup is used to build and compile the new syntax back to AMD format for browser compatibility.
The Secretariat has also chosen VueJs framework for its future development. To allow AngularJs based projects to use VueJS, the Secretariat has build a bridge library angular-vue (https://github.com/scbd/angular-vue) which allows integration of vue into angularjs to the smallest level for eg. Button.
#Using Yarn:
yarn install
# Or, clean install:
npm run-script clean-reinstall
The project requires two command to run the project
- rollup build
yarn devwith watchyarn buildto build - run server
node serverwhich requires two mandatory env variablesCLEARINGHOUSE,CLEARINGHOUSE_HOST
| Name | Value | Description |
|---|---|---|
| CLEARINGHOUSE | ABS/BCH | |
| CLEARINGHOUSE_HOST | absch.cbd.int/bch.cbd.int | |
| COMPRESS | true/false | only used for dev |
| API_URL | api.cbd.int / api.cbddev.xyz | |
| CDN_URL | https://cdn.jsdelivr.net/ | |
| TAG / VERSION | (Branch/commit) | |
| PORT | 2010 | |
| GOOGLE_ANALYTICS_CODE | **** | |
| SITE_ALERT | (Optional) | Message to display on the top bar. if empty/not set the Alert Bar will no show |
| SITE_ALERT_LEVEL | (Optional) | Color level: primary, secondary, info, success, warning, danger. Default: danger |
Use below vscode launch.json configuration to run the project. using the compounds configuration both commands can be run together.
{
"version": "0.1.0",
"compounds": [
{
"name": "Launch BCH",
"configurations": ["Launch BCH", "watch vue dev"]
},
{
"name": "Launch ABS",
"configurations": ["Launch ABS", "watch vue dev"]
}
],
"configurations": [
{
"name": "Launch ABS",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"request": "launch",
"runtimeArgs": [
"run-script",
"start"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node",
"env": {"CLEARINGHOUSE":"absch", "CLEARINGHOUSE_HOST":"absch.local"
}
},
{
"name": "Launch BCH",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"request": "launch",
"runtimeArgs": [
"run-script",
"start"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node",
"env": {
"CLEARINGHOUSE":"bch",
"CLEARINGHOUSE_HOST":"bch.local",
}
}
]
}
docker run --name absch -e "CLEARINGHOUSE=absch" -e "CLEARINGHOUSE_HOST=absch.local" -d -p 8000:8000 scbd/absch.cbd.int