Client map application for PetaBencana platform . Read more project information here.
This platform is built using the Aurelia framework, which has a few prerequisites. To get started, follow the machine & application setup steps.
npm -v
. If you need to update, run npm install npm -g
.npm install aurelia-cli -g
npm install
The project structure is as follows:
App router is configured in /src/app.js
Additional query parameters
Environments
debug
: (true/false) enable aurelia router logs in browser consoletesting
: (true/false) enable aurelia-testing plugintile_layer
: set map tile source url (allows using multiple tileLayers for development, staging, production, etc)data_server
: set url of cognicity server (Default value is http://localhost:8001/ if using [cognicity-server] (https://github.com/urbanriskmap/cognicity-server-v3))app
: set it to map landing page url (Default value is http://localhost:9000/ if using this platform)default_language
: set it to one of the languages in supported_languages
(Default is 'en')supported_languages
: set it to an array of languages you support (Default is ['en', 'id']. In case you add more languages, update the array and add corresponding locale information in /src/resources/locales/TWO_LETTER_LANGUAGE_CODE.js)enable_test_cardid
: set to false to disable cardid=test123 in prod environments (Default is true for local and dev environments)Map Configuration
instance regions
in /src/resources/config.js > Config.mapregion
code. And set the bounds
to have southwest and northeast bounds of the city in sw
and ne
respectively.default_region
sets the initial map view in http://localhost:9000/mapmap.center
in /src/routes/cards/location/location.js to the center of the new instance region you have added in map config filesnpm start
This will start a dev server on http://localhost:9000npm run build
assets/*
scripts/*
index.html
favicon.ico
Testing environment supported by BrowserStack
Do ('npm test') to build the project and run the tests.
If you want to run BrowserStack, you need to provide environment variables with your
username and password. Put export BROWSERSTACK_USERNAME=yourUsername
and export BROWSERSTACK_KEY=yourAccessKey
into
your ~/.bashrc or ~/.bash_profile in order for karma to pick up the browserstack credentials. Now run source ~/bash_profile
and
npm test in order to build the bundle and run karama unit tests against it.
End to end testing is implemented using protractor, webdriver, and browserstack. First install protractor: npm install -g protractor
then download the webdriver binaries: webdriver-manager update
. In order to run the tests, the front end must be being served. Run au run in a separate terminal, and then run protractor protractor.conf.js
which will start the tests. Protractor can be a little finicky, so you should let it run without interacting with other browser windows.
Mockapi to be used in the future.
The release procedure is as follows: