# Modular Self-Hosting

DrawSplatTM can be installed as one complete browser-based package, or as
drop-in modules that share the same folder structure.

## Package model

All modules are static files. There is no installer and no server-side linking
step. To combine modules, unzip them into the same web root.

| Package | Main paths | Use when |
|---|---|---|
| DrawSplatTM full package | `/`, `/app/`, `/pages/`, `/solutions/`, `/games/`, `/admin/`, `/server/` | You want the complete whiteboard, tools, widgets, games, docs, and backend scaffolds. |
| SplatWorksTM suite | `/splatworks/`, `/pages/splatworks.html` | You want the browser-based office suite as its own entity. |
| GridSplatTM | `/splatworks/gridsplat/` | You only need the spreadsheet app. |
| ShowSplatTM | `/splatworks/showsplat/` | You only need the presentation/WebDeck app. |
| WriteSplatTM | `/splatworks/writesplat/` | You only need the writing app. |
| ListSplatTM | `/splatworks/listsplat/` | You only need the database app. |
| DrawSplatTM Tools | `/pages/tools.html`, `/solutions/` selected tools | You only need standalone creation tools. |
| DrawSplatTM Widgets | `/pages/tools.html#widgets`, `/solutions/` selected widgets | You only need quick classroom utilities. |
| DrawSplatTM Games | `/games/` | You only need standalone classroom games. |
| AudioSplat | `/solutions/audiosplat/` | You only need the multitrack browser recorder/editor. |
| VideoSplat | `/solutions/videosplat/` | You only need the private browser video editor, subtitle burn-in, and anonymization workflow. |
| MediaSplat | `/solutions/mediasplat/` | You only need media conversion, trimming, and subtitles. |
| PDFSplat | `/solutions/pdfsplat/`, `/vendor/`, `/assets/` | You only need PDF editing, signing, scanning, and local protection. |

## Combining modules

1. Create a web root folder, such as `drawsplat-site/`.
2. Unzip one or more packages into that same folder.
3. Keep existing folder names unchanged.
4. Serve the folder with any static host.

Example:

```text
drawsplat-site/
├── index.html
├── app/
├── pages/
├── assets/
├── splatworks/
├── solutions/
└── games/
```

The modules connect because they keep the same paths used by the full
DrawSplatTM download.

## Standalone SplatWorks

SplatWorksTM can be hosted without the DrawSplatTM whiteboard. Install the
SplatWorksTM suite package and open:

```text
/pages/splatworks.html
```

Direct app paths:

```text
/splatworks/gridsplat/
/splatworks/showsplat/
/splatworks/writesplat/
/splatworks/listsplat/
```

## Building packages

From the repository root:

```bash
./scripts/make-selfhost-bundle.sh vX.Y.Z
```

The command produces the full DrawSplatTM package, individual SplatWorksTM app
packages, the SplatWorksTM suite package, and standalone Tools, Widgets, and
Games modules, plus independent AudioSplat and VideoSplat solution packages.

AudioSplat recording and editing require HTTPS (or localhost for development).
Its included Google Drive client is authorized for `drawsplat.org`; another
self-host domain must provide its own Google OAuth Web client, authorize that
origin, enable Google Drive API, request `drive.file`, and rebuild AudioSplat.

VideoSplat editing, project storage, media analysis, and export are designed to
remain local. Serve it over HTTPS (or localhost during development) so the PWA,
workers, browser storage, and high-performance media APIs are available.

## Subtitle burn-in (v3.1.21)

MediaSplat and VideoSplat standalone packages, the Tools module, and the full DrawSplat package include SRT/VTT burn-in. Keep MediaSplat’s `ffmpeg/DejaVuSans.ttf` and `ffmpeg/FONT-LICENSE.txt` with its split runtime files. Update the complete app folder so the HTML, hashed assets, service worker, and font stay together. See the [subtitle walkthrough](../blog/subtitle-burn-in.html).

## Automatic subtitles (v3.1.23)

VideoSplat, MediaSplat, Tools, and full packages include the bundled ONNX speech
runtime and `solutions/shared/subtitles` source package. Keep that sibling package
when rebuilding either app with npm. The model downloads on first generation
from Hugging Face (about 42 MB) and is cached separately by the browser. Media and
caption text are never uploaded. Offline transcription requires a cached model
and runtime. If you add a host CSP, permit the model download hosts listed in
`solutions/videosplat/docs/NETWORK_INVENTORY.md`; keep runtime scripts same-origin.
See the [automatic subtitle walkthrough](../blog/automatic-subtitles.html).

## Current release: v3.1.28

All thirteen packages are refreshed from the current source: full DrawSplat, SplatWorks suite and four individual apps, Tools, Widgets, Games, AudioSplat, VideoSplat, MediaSplat, and PDFSplat. Download matching versions from [the download page](../pages/download.html) and verify them with the release’s `SHA256SUMS-v3.1.28.txt`. The full package includes whiteboard v3.1.12 and the portable MySQL API; individual modules contain their relevant apps and shared files, not a separate whiteboard or MySQL service. Stop active recordings/exports before updating shared assets, keep backups of local projects and backend data, and retain server-only configuration rather than overwriting it with example settings.

The download page shows approximate ZIP and unpacked sizes, measured from release archives in decimal MB. Run `python3 scripts/update-download-sizes.py vX.Y.Z` after building a release, rebuild with the updated page, then use `--check` to verify displayed sizes against the final archives.

## Offline entry points

Extract the entire ZIP and keep the folder structure intact. Every package includes `OPEN-APP.html`; individual packages also have a root `index.html` shortcut when that name is not already used. Complete DrawSplat and Tools include `Open-VideoSplat.html`, `Open-MediaSplat.html`, `Open-AudioSplat.html`, `Open-PDFSplat.html`, and `Open-CipherSplat.html`.

PDFSplat and CipherSplat’s dedicated offline edition open directly from disk in desktop Chrome and Firefox. The complete package’s CipherSplat shortcut selects its included offline edition for file access and its hosted app for HTTP access. AudioSplat, VideoSplat, and MediaSplat require the supplied local launcher (Python 3); their file shortcuts show `START-HERE.html`. A web page cannot automatically start Python or bypass file-origin browser restrictions. Once running locally, core editing does not need internet. Online services and first-time speech-model downloads still do.
