# scrollprize/villa architecture

> Architecture diagram of the GitHub repository scrollprize/villa, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/scrollprize/villa
- Repository: https://github.com/scrollprize/villa

## Overview

##### Project Type & Purpose
- This is a large monorepo (“villa”) hosting multiple related tools around the Vesuvius Challenge:
- Data-access libraries (vesuvius in Python, vesuvius-c in C)
- Dataset builders & cloud infrastructure (foundation)
- 3D rendering utilities (scroll-renderer)
- GUI viewer for ink annotation (crackle-viewer)
- ML pipelines for ink detection (ink-detection)
- Automatic segmentation of sheet fragments (thaumato-anakalyptor)
- Supporting website (scrollprize.org)

##### File Structure Analysis
- Top-level directories correspond to distinct components.
- Each subfolder is essentially a mini-project (library, CLI tool, web app).
- Look for config files (Dockerfile, pyproject.toml, setup.py), pipelines (scripts, notebooks), and UIs (view_gui.py, scrollprize.org/src/pages).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Storage
    S3["Raw CT Scans<br/>S3 Bucket"]:::storage
    StandardData["Standard Format<br/>zarr, meshes"]:::storage

    %% Data-Preparation & Cloud Infra
    foundation["foundation<br/>Data-Prep & Cloud Infra"]:::pipeline
    scrollcase["scrollcase Demo"]:::pipeline
    sam2["sam2-photogrammetry"]:::pipeline

    %% Core Libraries
    vesuvius["vesuvius<br/>Python API"]:::library
    vesuvius-c["vesuvius-c<br/>C API"]:::library

    %% ML Pipelines
    Thaumato["thaumato-anakalyptor CLI"]:::pipeline
    inkDetection["ink-detection"]:::pipeline

    %% Rendering & Visualization
    scrollRenderer["scroll-renderer"]:::pipeline
    crackleViewer["crackle-viewer<br/>GUI Viewer"]:::ui

    %% Website
    scrollprize["scrollprize.org<br/>Docusaurus Site"]:::website

    %% Flow
    S3 --> foundation
    foundation --> StandardData
    StandardData --> Thaumato
    StandardData --> scrollRenderer
    StandardData --> inkDetection
    foundation --> scrollcase
    foundation --> sam2

    vesuvius -.-> foundation
    vesuvius-c -.-> foundation
    vesuvius -.-> Thaumato
    vesuvius-c -.-> Thaumato
    vesuvius -.-> scrollRenderer
    vesuvius-c -.-> scrollRenderer
    vesuvius -.-> inkDetection
    vesuvius-c -.-> inkDetection
    vesuvius -.-> crackleViewer
    scrollRenderer --> crackleViewer
    Thaumato --> crackleViewer
    crackleViewer --> inkDetection

    %% Website Links
    scrollprize --> vesuvius
    scrollprize --> foundation
    scrollprize --> Thaumato
    scrollprize --> scrollRenderer
    scrollprize --> inkDetection
    scrollprize --> crackleViewer
    scrollprize --> scrollcase
    scrollprize --> sam2

    %% Click Events
    click vesuvius "https://github.com/scrollprize/villa/tree/main/vesuvius/"
    click vesuvius-c "https://github.com/scrollprize/villa/tree/main/vesuvius-c/"
    click foundation "https://github.com/scrollprize/villa/tree/main/foundation/"
    click scrollRenderer "https://github.com/scrollprize/villa/tree/main/scroll-renderer/scroll_renderer/"
    click crackleViewer "https://github.com/scrollprize/villa/blob/main/crackle-viewer/view_gui.py"
    click inkDetection "https://github.com/scrollprize/villa/tree/main/ink-detection/"
    click Thaumato "https://github.com/scrollprize/villa/blob/main/thaumato-anakalyptor/ThaumatoAnakalyptor.py"
    click scrollprize "https://github.com/scrollprize/villa/tree/main/scrollprize.org/"
    click scrollcase "https://github.com/scrollprize/villa/tree/main/foundation/scrollcase/"
    click sam2 "https://github.com/scrollprize/villa/tree/main/sam2-photogrammetry/"

    %% Styles
    classDef library fill:#ADD8E6,stroke:#333,stroke-width:1px;
    classDef pipeline fill:#90EE90,stroke:#333,stroke-width:1px;
    classDef ui fill:#FFA500,stroke:#333,stroke-width:1px;
    classDef website fill:#DDA0DD,stroke:#333,stroke-width:1px;
    classDef storage fill:#D3D3D3,stroke:#333,stroke-width:1px;
```
