How opencb/iva works
Project Type and Purpose
• IVA is a single‐page web application (SPA) written in JavaScript that serves as the front‐end for the OpenCGA genomic‐data platform.
• It provides real‐time interactive features for variant browsing, case interpretation, sample/family/cohort browsing, jobs monitoring, and clinical analysis.
File Structure
• src/ – all front‐end code (HTML templates, CSS, JS modules, configuration).
• lib/jsorolla/ – embedded JSorolla library (shared OpenCB UI components).
• cypress/ and test/e2e/ – end‐to‐end test suites and test runners.
• docker/iva-app/ – Dockerfile and entrypoint for packaging the UI into a container.
• CI configs (Jenkinsfile, .github/workflows/*.yml) – continuous integration and release pipelines.
• Webpack/Rollup config files – build and bundling tools to generate production assets.
Readme Highlights
• The UI communicates via HTTP with the OpenCGA REST API (hosted elsewhere).
• Build & run: npm scripts for dev server (npm run serve), build (npm run build), and E2E tests (Cypress).
• Deployment: containerized through Docker, recommended to serve static assets behind a web server.
Main Components and Their Interactions
a. User’s Web Browser (UI):
– Loads the SPA (HTML, JS bundles, CSS) from a web / CDN server.
– Renders pages (variant browser, case interpreter, cohort browser, etc.).
– Uses JSorolla modules plus IVA business‐logic modules for UI widgets and charts.
b. Static Web Server (Dockerized IVA App):
– Serves built assets (index.html, .js, .css, images).
– Could be Nginx or Node.js static‐file server inside the IVA Docker container.
c. OpenCGA REST API (External Service):
– Provides genomic‐data endpoints.
– Accepts authentication tokens, returns JSON data.
d. Build & Test Pipeline (CI/CD):
– GitHub Actions / Jenkins runs:
• npm install + JSorolla submodule preparation
• npm run build (Webpack/Rollup)
• npm run e2e (Cypress)
• Docker image build and publish
e. End‐to‐End Test Runner:
– Cypress (interactive and headless)
– Nightwatch config for legacy tests
Architectural Patterns & Design Principles
• SPA Architecture: clear separation of concerns—routing, data services, UI components.
• Modular JavaScript: each feature under src/ is a self‐contained module.
• Containerization: Docker ensures environment consistency.
• CI/CD: automated builds, tests, and releases.
• External API Integration: all data interactions go through REST calls to OpenCGA.