Skip to content

Latest commit

 

History

History
 
 

frontend

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

napari hub frontend

Table of Contents

Development Features

Quick Start

Setup Node.js

We use Node.js and various packages on NPM for building napari hub. For package management, we use yarn.

It's recommended you use NVM so you don't have to manage multiple Node.js versions yourself:

When you have NVM setup, run the following commands:

# Installs Node.js version defined in `.nvmrc`
nvm install

# Uses project defined Node.js version
nvm use

# Install yarn globally
npm -g install yarn

# Install project dependencies
yarn install

Setup Secrets

GitHub Token

The frontend authenticates as a GitHub OAuth app to allow an increase of the API rate limit. For development, you'll need to create an OAuth app on your personal account:

  1. Create a new OAuth app
  2. Copy .env.example to .env.
  3. Change GITHUB_CLIENT_ID to the actual GitHub client ID.
  4. Change GITHUB_CLIENT_SECERT to the actual GitHub client secret.

Start Development Mode

To start the frontend in development mode, run the following command:

yarn dev

Any changes to the code will fast refersh the browser UI.

Plop Generators

We use Plop to automate common boilerplate in the codebase. You can run Plop without any arguments and get a list of generators you can use:

yarn plop

If you want to use a specific generator, you can pass the name as the first argument:

# Run component generator
yarn plop component

Documentation