Get the prices of Singapore's Electronic Road Pricing (ERP) gantries, based on the time and your vehicle type.
- React app written entirely in TypeScript that runs without a backend.
- Data is periodically fetched, processed and added to a custom Mapbox style using GitHub Actions.
- Playwright is used for E2E tests and cross-platform snapshots are generated using GitHub Actions.
Create a .env
file in the root directory:
DATAMALL_ACCOUNT_KEY=$datamall_key
REACT_APP_MAPBOX_ACCESS_TOKEN=$mapbox_access_token
Refer to LTA's DataMall website to get an account key
Refer to Mapbox's website to get an access token
Because cross-env
does not support command substitution out of the box, some additional setup is needed.
- Create a
.npmrc
file with the following content (reference):
script-shell = "C:\\windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
- Try running
npm start
. If you receive an error that "...cross-env.ps1 cannot be loaded because running scripts is disabled on this system", allow the running of scripts by opening a powershell (or terminal in vscode) and enter the following (reference):
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Running npm start
and npm run build
should now work as expected.