/bluesky-webclient

A React Material UI based web client developed in TypeScript to enable acquisition of data on the web with bluesky

Primary LanguageTypeScriptBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

TypeScript React app using Material UI for a Bluesky queueserver client.

Install it:

yarn

Run with default variables:

yarn start

Run with custom REACT_APP_BEAMLINE variable: (changes the banner)

REACT_APP_BEAMLINE=beamline_name yarn start

To use the Preview server for displaying live plots and thumbnails:

Start kafka (MacOS instructions)

brew install kafka
brew services start kafka
brew services start zookeeper
brew services list  # to make sure both services have been started

Start the queueserver RE-manager with kafka.

start-re-manager --kafka_server 127.0.0.1:9092 --kafka_topic widgets_test.bluesky.documents

Start the queueserver HTTP server.

uvicorn bluesky_queueserver.server.server:app --host localhost --port 60610

Set environment variable for preview directory.

export THUMBNAIL_DIRECTORY=${TMPDIR}/bluesky_widgets_example

Start the kafka-consumer that generates the previews.

git clone https://github.com/bluesky/bluesky-widgets
cd bluesky-widgets
pip install -e .
python bluesky_widgets/examples/kafka_figures.py

Copy this file locally.

https://gist.github.com/gwbischof/26aedaec7cf997bde2b1cd0def757612

Start the preview server to serve the produced images.

uvicorn BlueskyPreviewServer:app

The client proxies to the server on port 60610, if it is running on a different port you will need to change that in the package.json (or just switch the server port to match using --port 60610 when launching it).

The queue server API prefix is set up to default to /qs when developing against pods or a deployed version, this can be overridden by creating a file in the root of the source tree .env.local where you define overrides to the entries in the .env file.

See the documentation on details about the variables.