# Developer guide

JBrowse 2 is published as products people run and plugins that add to them.
This page describes both, links working plugins to read, and indexes the guides
for each kind of pluggable element.

## Products and plugins

Two kinds of package are published on their own: products and plugins.

<Figure src="/img/products_and_plugins.png" caption="A product owns a PluginManager and loads plugins at runtime. A plugin's install() registers what it packages: views, tracks, display types, adapters, and the MST autoruns that extend the rest of the app."/>

A product is an application published on its own: `jbrowse-web` in a browser,
`jbrowse-desktop` in Electron, `jbrowse-cli` on the command line, and the
embedded React components.

A plugin adds functionality to a product **at runtime**. Anyone can write and
publish one, and a product loads plugins from a URL. A product can also be built
with its plugins bundled in, which is what the embedded components do.

<Figure src="/img/product_architecture.png" caption="A product instantiates the RootModel, and the state tree below it runs from the session through views, tracks and displays. Each React component on the right observes the state node across from it."/>

## Example plugins

Plugin templates:

- [jbrowse-plugin-template](https://github.com/GMOD/jbrowse-plugin-template)
- [jbrowse-plugin-esbuild-template](https://github.com/GMOD/jbrowse-plugin-esbuild-template)
  (lightweight esbuild-based alternative)

Working plugin examples:

- [jbrowse-plugin-ucsc-api](https://github.com/cmdcolin/jbrowse-plugin-ucsc-api)
  is the smallest of these, an adapter that reads the UCSC REST API
- [jbrowse-plugin-gwas](https://github.com/cmdcolin/jbrowse-plugin-gwas) draws
  GWAS data as a manhattan plot
- [jbrowse-plugin-biothings-api](https://github.com/cmdcolin/jbrowse-plugin-biothings-api)
  reads mygene.info, one of the "biothings API" services
- [jbrowse-plugin-msaview](https://github.com/GMOD/jbrowse-plugin-msaview)
  creates a custom view type that holds no tracks at all
- [jbrowse-plugin-gdc](https://github.com/GMOD/jbrowse-plugin-gdc) reads the
  GDC cancer data GraphQL API, and adds a drawer widget and a track type that
  colors variants by impact score
- [jbrowse-plugin-systeminformation](https://github.com/garrettjstevens/jbrowse-plugin-systeminformation)
  reaches node system libraries from JBrowse Desktop. A desktop-only plugin like
  this one ships as a CJS bundle, which is what Electron loads

The [jbrowse-plugin-list](https://github.com/GMOD/jbrowse-plugin-list) is the
community plugin registry: browse it to find published plugins, or submit your
own through a pull request.

## Guides by topic

### Getting started

- [](https://jbrowse.org/jb2-staging/docs/developer_guides/simple_plugin)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/no_build_plugin)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/pluggable_elements)

### Plugins

- [](https://jbrowse.org/jb2-staging/docs/developer_guides/creating_display)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/plotting_features)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/creating_gpu_display)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/creating_addtrack_workflow)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/creating_adapter)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/creating_connection)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/creating_view)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/creating_widget)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/drawer_widgets)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/menus)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/svg_export)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/creating_text_search_adapter)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/upgrading_v5)

### Core concepts

- [](https://jbrowse.org/jb2-staging/docs/developer_guides/configuration_schema)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/data_fetching)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/dataflow)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/imports_and_reexports)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/extension_points)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/mst_patterns)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/rpc_workers)

### Advanced topics

- [](https://jbrowse.org/jb2-staging/docs/developer_guides/memory)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/optimizations)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/pif_format)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/refname_aliasing)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/testing_plugins)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/theming)
- [](https://jbrowse.org/jb2-staging/docs/developer_guides/why_not_x)

