GitHub - OpenBB-finance/backends-for-openbb: Backend template to bring your own data into the OpenBB Workspace (original) (raw)

OpenBB Workspace

Introduction

An OpenBB Workspace Data Integration is a versatile way to connect your data to widgets inside OpenBB Workspace. Whether hosted internally or externally, this method provides a standardized structure that OpenBB Workspace widgets can read and then display any data.

Note: Most of the examples provided use Python FastAPI due to our familiarity with the library, but the same could be done utilizing different languages.

The Main tenants are:

  1. Data returned should be in JSON format (Note : you can utilize the "dataKey" variable in the widgets.json if you have nested JSON.) Example JSON
```json
[
  {
    "ticker": "AAPL",
    "name": "Apple Inc.",
    "price": 150.5,
    "marketCap": 2500000000,
    "change": 1.25
  },
  {
    "ticker": "GOOGL",
    "name": "Alphabet Inc.",
    "price": 2800.75,
    "marketCap": 1900000000,
    "change": -0.75
  },
  {
    "ticker": "MSFT",
    "name": "Microsoft Corporation",
    "price": 300.25,
    "marketCap": 220000000,
    "change": 0.98
  },
]

```

  1. An endpoint returning a widgets.json file : This file defines widget properties such as name, description, category, type, endpoint, and other information. Each widget will be defined in this file – You can find the format in any of the templates folder with a detailed definition below.
  2. CORS Enabled : If hosting locally you must enable CORS.
  3. Adding Authentication (optional) : If your backend requires authentication we offer the ability to set a query param or header when you connect to it through OpenBB Pro. These values are sent on every request when configured. If you require another method - please reach out to us.

Getting Started

We recommend starting with the getting-started/hello-world example. Then Moving on to the getting-started/reference-backend.

This will give you a good understanding of how to setup your own backend and connect it to OpenBB Workspace.

Supported Integrations and Apps

Each Integration below has a folder which contains an example of different implementations - We recommend starting with the Table Widget Example.

Apps

App Description
demo-risk A simple risk app
dtcc_trade_repository A simple trade repository app

Widgets

Integration Description
Table Widget A simple table widget from a file or endpoint
Chart Widget How to return a plotly chart or a built in chart
Markdown Widget Markdown Widget and example with a parameter
Metric Widget Showing a single metric
Multi File Viewer How to return a multi file viewer
PDF Widget How to return a PDF file
News Widget How to return a news widget
Advanced Charting How to return an advanced chart
Live Grid How to return a live grid

Parameters

Parameter Examples Description
Parameters Widget Example of setting up widgets with parameters
Grouping Widgets How to group widgets on the dashboard
Column and Cell Rendering An example of widgets with custom column and cell rendering
Form Parameters How to return a form parameter

Database Connectors

Database Connection Examples Description
ClickHouse ClickHouse is an open-source column-oriented DBMS.
Supabase Supabase is an open source Firebase alternative.
MindsDB MindsDB is an open-source AI layer for existing databases.
ElasticSearch Elasticsearch is a search engine based on the Lucene library.
ArticDB Using ArticDB to add data to a widget.
Snowflake Snowflake is a cloud-based data warehousing platform.

For more examples on setting up your own App - you can head to our documentation at https://docs.openbb.co/workspace.