Contributing to Depictio¶
Thank you for your interest in contributing to Depictio! This guide outlines the process for contributing to the project and provides resources to help you get started.
Table of Contents¶
- Getting Started
- Development Environment
- Project Structure
- Development Workflow
- Testing
- Code Style and Standards
- Documentation
- Issue Reporting
- Pull Requests
- Code Review Process
- Community
- License
Getting Started¶
Prerequisites¶
Before you begin, ensure you have the following installed:
- Python 3.11 or higher (3.12 recommended)
- Docker and Docker Compose
- Git
Fork and Clone¶
- Fork the repository on GitHub
- Clone your fork locally:
- Add the original repository as an upstream remote:
Development Environment¶
Option 1: Docker Compose¶
There are two compose files depending on your goal:
Quickstart — pre-built images (no build required)¶
Uses images from GHCR. MinIO is bundled by default — no .env needed:
For external S3 / bring your own MinIO:
Development — source mounts with hot-reload¶
Uses docker-compose.dev.yaml which mounts the local source tree and
builds the image locally:
Services¶
| Service | URL |
|---|---|
| Frontend | http://localhost:5080 |
| Backend API | http://localhost:8058 |
| API Docs | http://localhost:8058/docs |
| MinIO Console | http://localhost:9001 |
The source code is mounted as a volume in the dev file for live reloading:
Option 2: DevContainer & GitHub Codespaces¶
For a cloud-based or containerized IDE experience, use the provided DevContainer configuration:
VS Code DevContainer:
- Install the Dev Containers extension
- Open the repository in VS Code
- Click "Reopen in Container" when prompted (or use Command Palette:
Dev Containers: Reopen in Container)
GitHub Codespaces:
- Go to the Depictio repository
- Click the green "Code" button
- Select "Codespaces" tab
- Click "Create codespace on main"
Both options provide a pre-configured development environment with all dependencies installed.
Alternative: Local Python Setup¶
For contributors who prefer local development without containers:
Setting up Pre-commit Hooks¶
Docker Images¶
The project provides multiple Dockerfile options:
| Dockerfile | Description |
|---|---|
Dockerfile_depictio_uv.dockerfile |
Recommended - Fast builds using uv |
Dockerfile_depictio_prod.dockerfile |
Multi-stage production build |
Dockerfile_depictio.dockerfile |
Legacy conda/mamba-based |
Environment Variables¶
All critical defaults are embedded directly in the compose files, so .env is
optional — docker compose up -d works out of the box.
To override credentials or settings, copy .env.example to .env:
For development with docker-compose.dev.yaml, the full config lives in
docker-compose/.env (already populated for local dev).
Key development variables:
| Variable | Description |
|---|---|
DEPICTIO_CONTEXT |
Set to server for API, dash for frontend |
DEPICTIO_MONGODB_WIPE |
Set to true to reset the database on startup |
DEPICTIO_LOGGING_VERBOSITY_LEVEL |
Set to DEBUG for detailed logs |
DEPICTIO_AUTH_SINGLE_USER_MODE |
true by default — disables login prompt |
DEPICTIO_MINIO_ROOT_USER |
MinIO access key (default: minio) |
DEPICTIO_MINIO_ROOT_PASSWORD |
MinIO secret (default: minio123) |
Local Python Environment (Development)¶
Regardless of which development option you choose, you need local Python packages for running tests, pre-commit hooks, and the CLI.
1. Main package (tests & pre-commit)
# Install uv (fast Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install depictio with all dev dependencies
uv sync --all-extras
# Set up pre-commit hooks
uv run pre-commit install
2. CLI package (separate)
The CLI is a standalone package with its own pyproject.toml:
Available tools:
| Tool | Command | Purpose |
|---|---|---|
| pytest | uv run pytest depictio/tests/ -xvs |
Run tests |
| pre-commit | uv run pre-commit run --all-files |
Code quality checks |
| ruff | uv run ruff check . |
Linting |
| ty | uv run ty check depictio/ |
Type checking |
| depictio CLI | cd depictio/cli && uv run depictio --help |
CLI commands |
Project Structure¶
depictio/
├── api/ # FastAPI backend (port 8058)
│ ├── main.py # Application entry point
│ └── v1/
│ ├── configs/ # Settings models and logging config
│ ├── endpoints/ # One sub-package per resource domain
│ ├── services/ # Business logic, background tasks, lifespan
│ ├── middleware/ # Analytics and request middleware
│ └── db.py # MongoDB / Beanie setup
├── dash/ # Dash frontend (port 5080)
│ ├── pages/ # Multi-app entry points (management, viewer, editor)
│ ├── layouts/ # Shared shell, sidebar, save logic
│ └── modules/ # One sub-package per dashboard component type
├── models/ # Shared Pydantic models (API + Dash)
├── cli/ # Standalone CLI package (own pyproject.toml)
└── tests/ # Test suites (api/, dash/, cli/)
API Endpoint Structure¶
Each resource domain lives in depictio/api/v1/endpoints/<domain>_endpoints/ and typically contains a subset of:
<domain>_endpoints/
├── routes.py # FastAPI router — path operations
├── models.py # Request / response Pydantic models
└── utils.py # Domain-specific helpers
Dash Component Structure¶
Depictio uses a modular component system in depictio/dash/modules/:
| Component | Purpose |
|---|---|
card_component/ |
Text and summary cards |
figure_component/ |
Plotly visualizations (Plotly Express, code mode, MultiQC plots) |
image_component/ |
Static image display from S3 |
interactive_component/ |
Filters, dropdowns, sliders |
table_component/ |
Interactive data tables (AG Grid) |
text_component/ |
Rich text / Markdown cards |
multiqc_component/ |
Embedded MultiQC HTML reports |
Each component typically contains a subset of:
component_name/
├── frontend.py # Entry point — layout and top-level callbacks
├── utils.py # Component building logic and helpers
├── design_ui.py # Stepper / configuration UI shown in edit mode
├── models.py # Component-specific Pydantic models
└── callbacks/ # Callback modules split by concern
Not all files are present in every component — the structure grows with complexity.
Development Workflow¶
-
Create a new branch for your feature or bugfix:
-
Make your changes and commit them:
-
Keep your branch updated with upstream:
-
Push your branch to GitHub:
-
Create a pull request on GitHub.
Testing Local Changes¶
Running Tests¶
# Run all tests
pytest depictio/tests/ -xvs
# Run with parallel execution
pytest depictio/tests/ -xvs -n auto
# Run specific test file
pytest depictio/tests/api/test_endpoints.py -xvs
Code Quality Checks¶
# Format code
ruff format .
# Lint code
ruff check .
# Type checking
ty check depictio/
# Run all pre-commit hooks
pre-commit run --all-files
Writing Tests¶
- Place tests in the
depictio/tests/directory - Follow existing structure:
tests/api/,tests/dash/,tests/cli/ - Include both unit tests and integration tests
Code Style and Standards¶
Depictio follows these coding standards:
- PEP 8 for Python code style
- Type hints for all function parameters and return values
- Docstrings for modules, classes, and functions
We use pre-commit hooks to enforce:
| Tool | Purpose |
|---|---|
ruff |
Code formatting and linting |
ty |
Static type checking |
Frontend Guidelines¶
Required for all frontend contributions
All new UI components must use DMC 2.0+ (Dash Mantine Components) and support dark/light themes.
Component library priority:
- Primary: DMC 2.0+ components — use for all new UI
- Secondary: Custom HTML/CSS — only when DMC is insufficient
- Deprecated: Bootstrap components — maintain only, do not extend
Theme compatibility checklist:
- Use DMC component props for theming whenever possible — DMC 2.0+ handles dark/light automatically
- Only fall back to inline
style=with CSS variables (var(--app-bg-color),var(--app-surface-color)) when DMC has no built-in prop - Test in both light and dark themes
- Never hardcode colors (
#ffffff,#000000)
Multi-App Architecture¶
Critical for Dash contributors
The Dash frontend uses three separate applications. Callbacks must be registered in the correct app(s).
| App | URL Pattern | Purpose |
|---|---|---|
| Management | /dashboards, /profile, /projects |
Dashboard listing, user settings |
| Viewer | /dashboard/{id} |
Read-only dashboard viewing |
| Editor | /dashboard/{id}/edit |
Dashboard editing, save operations |
Common pitfall: Registering a callback only in Editor when it should also work in Viewer.
# ✅ CORRECT: Register in both apps for view+edit features
# In dashboard_viewer.py
register_my_callback(app)
# In dashboard_editor.py
register_my_callback(app)
# ❌ WRONG: Only in editor, won't work in view mode
# In dashboard_editor.py only
register_my_callback(app)
Shared stores must be defined in depictio/dash/layouts/shared_app_shell.py → create_shared_stores()
Internal Technical Documentation¶
Detailed architecture notes, design decisions, and implementation internals are maintained in a private repository. If you need access (e.g. for a significant contribution), reach out to the maintainers.
Documentation¶
Repository¶
Documentation is maintained in the depictio-docs repository.
Setup¶
- Fork and clone the
depictio-docsrepository - Install dependencies:
Writing Documentation¶
- Documentation is built using MkDocs Material
- Source files are in the
docs/directory - Write in Markdown format
- Include code examples where appropriate
Building Documentation¶
Preview documentation locally:
Then open http://127.0.0.1:8000 in your browser.
Issue Reporting¶
Bug Reports¶
When reporting a bug, please include:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected behavior
- Actual behavior
- Screenshots if applicable
- Environment information (OS, browser, Python version)
Feature Requests¶
When requesting a feature, please include:
- A clear, descriptive title
- Detailed description of the proposed feature
- Rationale for adding the feature
- Implementation suggestions if applicable
Pull Requests¶
PR Guidelines¶
- Keep PRs focused on a single feature or bugfix
- Include tests for new functionality
- Update documentation as needed
- Reference related issues
- Ensure all CI checks pass
PR Template¶
Your PR description should include:
- What changes were made
- Why the changes were made
- How to test the changes
- Any additional context or notes
Code Review Process¶
All submissions require review. The review process includes:
- Automated checks - CI/CD pipeline runs tests and linting
- Code review - Maintainers review the changes
- Feedback - Address any requested changes
- Approval - Final approval and merge
Areas Needing Help¶
We welcome contributions in these priority areas. See the Roadmap for details.
| Area | What's Needed | Difficulty |
|---|---|---|
| Templates | nf-core workflow dashboard templates | Medium |
| Quarto integration | Static HTML/PDF export for publications | Medium |
| Documentation | User guides, tutorials, examples | Easy |
| Testing | E2E tests, edge cases, coverage | Medium |
| Components | Markdown component, date picker | Medium |
Community¶
Communication Channels¶
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - Questions and ideas
License¶
By contributing to Depictio, you agree that your contributions will be licensed under the MIT License.