Skip to content

medema-group/bgc-viewer

BGC Viewer

Badges
Build Status CI Python Code style: black
Software Directory Static Badge
License License
Fairness fair-software.eu

A viewer for biosynthetic gene cluster data.

This is the development README. The README for end-users is here: backend/README.md (it's the readme of the Python package)

Project Structure

The projects consists of a number of modules, which are available in their respective folders as self-contained packages:

  • backend: Python Flask server that serves API and statically built frontend.
  • frontend: Vue.js web application that, together with the API, makes a stand-alone viewer.
  • viewer-components: Reusable TS/JS components for the frontend.

The frontend contains a built copy of the viewer-components and the backend (Python package) contains a built copy of the frontend, so the resulting Python package will contain everything that is needed to run the application.

Installation & usage

For end-users, see this README: backend/README.md. For development, a number of different scenarios is possible.

Prerequisites

  • Python 3.11+
  • uv package manager
  • nodejs / npm

Build, install & run all modules

To build all modules (viewer-components, frontend, backend), execute the build script from the repository root.

./build.sh

You can then install and run the built Python package as follows (replace {VERSION} with built version)

pip install backend/dist/bgc_viewer-{VERSION}-py3-none-any.whl
bgc-viewer

Viewer-components development

cd viewer-components/

# Install
npm install

# Run dev server
npm run dev

# Build
npm run build

Frontend development

TODO: some copying of assets from the viewer-components is required. See ./build.sh script for now.

cd frontend/

# Install
npm install

# Run dev server
npm run dev

# Build
npm run build

Backend (Python package) development

TODO: some copying of assets from the frontend is required. See ./build.sh script for now.

cd backend/

# Setup environment and install
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"

# Set up configuration if required (see below)

# Run dev server
uv run python -m bgc_viewer.app

# Build
uv build

Configuration

Environment variables can be set to change the configuration of the viewer. A convenient way to change them is to put a file called .env in the directory from which you are running the application.

BGCV_HOST=localhost     # Server host (default: localhost)
BGCV_PORT=5005          # Server port (default: 5005)
BGCV_DEBUG_MODE=False   # Enable dev/debug mode (default: False)

Running the Server

uv run python -m bgc_viewer.app

The server will start on http://localhost:5005 by default.

Code Formatting

# Format code
uv run black bgc_viewer/

# Lint code
uv run flake8 bgc_viewer/

# Type checking
uv run mypy bgc_viewer/

Testing

# Run tests
uv run pytest

# Run tests with coverage
uv run pytest --cov=bgc_viewer

License

Apache 2.0

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •