↳ General Environment Variables
↳ Authorization and Authentication
This sample web user interface for use by Digital Health Pass consumers that want interface with the Data Submission API via batch file uploads. This sample user interface provides the ability to upload test results and user preregistration CSV files.
This sample application is composed of a client (React) and a server (Node/Express). The serve serves the client to the browser and proxies the Data Submission API calls to that service, as defined by the API_BASE_URL environment variable (see General Environment Variables).
The runtime toplogy is different when running on a local development environment vs a production deployment. To get started in either mode:
This will install all 3rd party dependencies in the root folder as well as in the /client
and /server
folders.
In local development mode, the start script runs two processes:
- create-react-app starts the React UI Client on port
3000
. - Server (node express server) is started on port
5000
.
This will start both the UI client and Server in development
mode.
In local development mode, both the UI Client and the Server are run on localhost. The UI Client communicates with the Server and the Server communicates with the APIs (running remotely). The port configurations for the UI Client and Server can be found in /client/.env
and /server/.env
respectively.
UI Client (3000) --> Server (5000) --> API (see below)
You can must either configure API_HOST
and API_PORT
in /server/.env
to point to your remote API endpoint or you must implement your own mock server for local testing and development.
In production mode, we run one process inside the Docker container, the Server process. The Server process services requests for both static web assets (webpacked react app) and backend requests to services - requests to /api/*
are proxied to actual backend service(s) by the Server process. node ./server/index.js
is run by the Docker container to start the Server process. The path to the backend services is provided by Helm Chart files.
This will output the built client code into dist/client
and copy the server code into dist/server
it will also copy the /charts
folder into dist/charts
. This step is typically performed prior to running a docker build
This is remove the /dist
folder as well as the /node-modules
folder at the root, /client
and /server
levels.
The following environment variables must be set before starting the application regardless of the executing environment.
Environment Variable | Value |
---|---|
PORT | Port used by Express Server (default: 5000) |
API_BASE_URL | The url of the Data Submission API |
USE_HTTPS | true or false. If true, then endpoints must be accessed via https, otherwise http |
NODE_ENV | 'development' or 'production' |
This user interface provides a login function which authenticates and authorizes a user via the Data Submission API endpoint. There are 2 defined roles, one to allow the uploading for user preregistrtion data and one to allow the uploading of test results. An individual user must be authorized with at least 1 of the following roles.
Scopes/Roles | Purpose |
---|---|
regadmin | Access for uploading user registration files |
testadmin | Access for uploading test result files |
This section lists open source libraries used in this application.
Table 3: Libraries and sources for this SDK