The project uses Typescript and depends on Node and npm already being installed on your machine. If you do not already have Node installed, install Node which comes with npm.
A Google account that can login to web application at https://web.staging.udmi.buildingsiot.com/login. This will be used to retrieve an idToken. In order to get the token, you will need to copy the idToken headers for a request to the api service in the browser developer tools. The idToken is needed in order to make GraphQL requests to the api service.
Run the build script which installs dependencies and sets up a environment file from an example env file
./buildDev.sh
Update the AUTH_CLIENT_ID and CLIENT_IDS with the values for Google identity provider. These values should be provided by whomever manages your Auth Provider.
./runDev.sh
Assumptions:
./runTests.sh
(could also run npm test
if all node modules have already been installed) to execute the unit tests via Jest.npm run testInteractive
to continuously execute the unit tests via Jest. The tests will be run every time a src file is saved.You can send GraphQL requests to http://localhost:4300/. In order to send a GraphQL request, you will need to add the idToken collected in the Prerequisites as a header to the requests called ‘idToken’
npm build
to build the project. The build artifacts will be stored in the dist/
directory.| Problem | Solution | | — | — | | The API does not return data. | Fix - Double check that the client id’s are filled in the .env file |