PEP RT WEB
Usage
-
Requirements
- git
- NodeJS (prefer installing with nvm or nvm for Windows)
- yarn
- Lokalise CLI v1
-
Clone project code.
git clone https://gitlab.com/viemed/pep/pep-rt-web.git pep-rt-web
cd pep-rt-web
-
Set up Gitlab NPM's registry. To do so, follow the next steps:
3.1 Create a Personal Access Token on GitLab with
read_registry
,write_registry
andapi
permissions. 3.2. Set this token as an environment variable namedNPM_TOKEN
-
Installation dependence.
yarn install
-
Configuring app
5.1 Environment Variables
Before starting or building the app, you'll have to create a `.umirc.local.js` file at root to fill up environment variables. There is already created a `.umirc.local.example` file for guidance. However, you'll have to ask the team for some keys for AWS and other services.
5.2 Lokalise
Since we are using https://lokalise.com/ for internationalization, you must download the translations for the app. To do so, you must run the following script (replace the placeholders first): $ lokalise --token xxxxxxxxxxxxx export 765489265cd03586bff563.09788970 --type json --bundle_structure 'messages.json' --unzip_to src/locales/en --placeholder_format icu
-
Start local server.
yarn start
- Run tests
yarn test
- After the startup is complete, open a browser and visit http://localhost:7001, If you need to change the startup port, you can configure it in the
.env
file.
Build
First execute the following command,
npm run build
The build
command will package all resources, including JavaScript, CSS, web fonts, images, html, and more. You can find these files in the dist/
directory.
Rollbar
window.onerror("TestRollbarError: testing window.onerror", window.location.href)
and make sure we get the right environment in Rollbar report