The Opentrons desktop application lets you use and configure your Opentrons personal pipetting robot. This directory contains the application's UI source code. If you're looking for support or to download the app, please click one of the links above.
This desktop application is built with Electron. You can find the Electron wrapper code in the app-shell
directory.
To get started: clone the Opentrons/opentrons repository, set up your computer for development as specified in the contributing guide, and then:
# prerequisite: install dependencies as specified in project setup
make install
# change into the app directory
cd app
# install flow-types for testing in development
make install-types
# launch the dev server / electron app in dev mode
make dev
At this point, the Electron app will be running with HMR and various Chrome devtools enabled. The app and dev server look for the following environment variables (defaults set in Makefile):
variable | default | description |
---|---|---|
NODE_ENV |
production |
Environment: production, development, or test |
PORT |
8090 |
Development server port |
SKIP_WIRED_POLL |
unset | Turn off polling for directly connected wired robots |
OT_APP_INTERCOM_ID |
unset | Sets the Intercom application ID |
OT_APP_MIXPANEL_ID |
unset | Sets the Mixpanel application ID |
Note: you may want to be running the Opentrons API in a different terminal while developing the app. Please see the contributing guide for API specific instructions.
The UI stack is built using:
Some important directories:
app/src
— Client-side React app run in Electron's renderer process- API clients (see
api/opentrons/server
)app/src/rpc
- RPC API clientapp/src/http-api-client
- HTTP API client
app/webpack
- Webpack configuration helpers
To run tests:
make test
- Run all tests
Test tasks can also be run with the following arguments:
arg | default | description | example |
---|---|---|---|
watch | false | Run tests in watch mode | $ make test-unit watch=true |
cover | !watch | Calculate code coverage | $ make test watch=true cover=true |
If you'd like to build the Electron desktop app, see the app shell's build instructions.
The UI bundle can be built by itself with:
# default target is "clean dist"
make
# build without cleaning
make dist
The UI build process looks for the following environment variables:
variable | default | description |
---|---|---|
NODE_ENV |
production |
Build environment: production, development, or test |
ANALYZER |
unset | Launches the bundle analyzer |
For example, if you wanted to analyze the production JS bundle:
ANALYZER=true make