This is the UI component of Turing based on React web framework.
- Node.js v14
- yarn 1.22.x (
npm install --global yarn
)
To start developing, you need to first download the packages required by Turing UI.
yarn install
The React application can be configured using environment variables. By default,
it will read from config values from .env
file. Refer to
this documentation for more details.
Environment Variable | Required | Default | Description |
---|---|---|---|
REACT_APP_API_TIMEOUT |
No | 10000 | Timeout (in milliseconds) for requests to API |
REACT_APP_TURING_API |
Yes | Endpoint of Turing API | |
REACT_APP_MERLIN_API |
Yes | Endpoint of Merlin API | |
REACT_APP_MLP_API |
Yes | Endpoint of MLP API | |
... | ... | ... | ... |
REACT_APP_MAX_ALLOWED_REPLICA |
No | 10 | Sets the upper bound of the number max replicas that user can configure for router/enricher/ensembler |
Turing UI currently depends on Google OAuth2 to determine the identity of the users. In order to use Turing UI, you need to setup Google OAuth2 and set the client id for your web application.
- Open Google API Console Credentials page
- Use an existing Google project or create a new project
- Select + Create Credentials, then OAuth client ID
- You may be prompted to set a product name on the Consent screen; if so, click Configure consent screen, supply the requested information, and click Save to return to the Credentials screen
- Select Web Application as the Application Type and enter any additional information required.
- For the Authorized JavaScript origins, make sure the enter the following URLs for local devlopment:
http://localhost:3001
. This is the default URL when starting Turing UI React app in development mode. - Click Create
- Copy the client ID value shown on the next page. You will need this value to configure Turing UI authentication.
- Set the value for
REACT_APP_OAUTH_CLIENT_ID
in.env.development
file with the client ID you just received.
For more info and, please refer to this Google documentation.
Run the following command to start the app in development mode.
yarn start
Open http://localhost:3001 to view the app in the browser.
Run the following command to build Turing UI app for production. It correctly bundles React in production mode and optimizes the build for the best performance.
yarn build
The final build will be available under the /build
folder, which is ready to
be deployed. Refer to the deployment for more information.