Badges | |
---|---|
Build Status | |
Software Directory | |
License | |
Fairness |
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)
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.
For end-users, see this README: backend/README.md. For development, a number of different scenarios is possible.
- Python 3.11+
- uv package manager
- nodejs / npm
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
cd viewer-components/
# Install
npm install
# Run dev server
npm run dev
# Build
npm run build
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
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
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)
uv run python -m bgc_viewer.app
The server will start on http://localhost:5005
by default.
# Format code
uv run black bgc_viewer/
# Lint code
uv run flake8 bgc_viewer/
# Type checking
uv run mypy bgc_viewer/
# Run tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=bgc_viewer
Apache 2.0