A lightweight, plugin-first movie and TV client.
README.md

Mantle

A lightweight, plugin-first movie and TV client. One Go core, one web UI (Preact + htm), three ways to run it: a Windows desktop app (Wails v3), a web build that runs all of it in the browser (the core as WebAssembly, a site of static files, installable on a phone too), and an Android app.

Home, with Jellyfin's shelves

Everything beyond the core is a plugin, in sandboxed Lua: where titles come from, what plays them, subtitles, skip times, importers, storage. Out of the box there are plugins for Cinemeta and The Movie Database, your own Jellyfin server, Real-Debrid and TorBox, Torznab indexers, Stremio addons, Trakt, OpenSubtitles and more (plugins/). A new install is set up a step at a time, each plugin saying what it needs; a setup (plugins, settings, lists) can be shared as a code or a file, picked a thing at a time, with a plugin's keys only when you choose to include them.

Download #

The latest release has the three builds: the Windows app as a zip (mantle.exe: unzip it anywhere and run it), the Android app as an APK, and the web build as a zip of its site. SHA256SUMS.txt beside them says each download is the release's. Windows asks before running an app it does not know (SmartScreen): it is not code-signed.

Documentation #

Get started #

Install the tools once. On Windows with Scoop:

scoop install git go nodejs-lts

Then:

git clone https://github.com/sotherdev/mantle.git
cd mantle
go run ./tools/mk dev

That is all for the desktop app and the web build. Go fetches the exact toolchain go.mod asks for if yours is older, and mk installs the frontend's packages whenever they change. Nothing is installed globally, so other projects' Go or Wails versions are untouched. The Android app also needs the Android SDK (with an NDK) and a JDK: Building and testing.

Commands #

Everything goes through mk, a small Go program in tools/mk:

Command What it does
go run ./tools/mk dev Runs the desktop app. Frontend edits apply live; Go edits rebuild and restart it.
go run ./tools/mk package Builds the portable desktop app into out/mantle/mantle.exe (the previous build becomes mantle-previous.exe, and keeps running if it is open).
go run ./tools/mk web Builds the web build, a site of static files with the core as WebAssembly, into out/web/ (-serve: then serves it at http://127.0.0.1:8017).
go run ./tools/mk android Builds the Android app, out/android/mantle.apk (-debug: one its WebView can be inspected in).
go run ./tools/mk dist desktop|web|android|all Builds a release's files into out/dist/, all with their SHA-256 sums (Releasing).
go run ./tools/mk wiki <dir> Writes the docs as the GitHub wiki into dir, a clone of the wiki (docs/ is its source: see Building and testing).
go run ./tools/mk test Runs the Go tests and every Storybook story as a test in a headless browser, three ways: desktop, light theme and phone, and the web build's unit tests in Node.
go run ./tools/mk storybook Opens Storybook: the component library, each component's docs, controls and behaviour stories.
go run ./tools/mk icon Makes the app's icons (Windows', the web build's, the Android app's) from frontend/src/brand.

Dev builds can be driven by automated checks without disturbing whoever is at the machine: MANTLE_DEV_WINDOW=x,y,w,h opens the window there without ever activating it, and MANTLE_DEV_CDP=port exposes the WebView's DevTools protocol on localhost. Production builds leave both out (devhooks_windows.go).

Portable by design #

The desktop app is one executable. Everything it keeps (settings, profiles, library, plugins, caches, its log) lives in mantle-data beside it, so the folder can move between machines or run from a flash drive. Nothing is written elsewhere. Downloads go to the download folders set in Settings (by default Downloads, beside the app); each title gets a folder named as media libraries name them, with its details and pictures beside the files. The Android app keeps the same folder in its own storage; the web build keeps it in the browser's storage for its site.

Windows needs the WebView2 runtime, which ships with Windows 11 and current Windows 10.

Layout #

app.go                the core started from the data folder (every build); ui.go embeds the UI
main.go, desktop.go   the desktop app: its window, and what only it can do (its Host)
main_js.go            the web build (GOOS=js): the core as WebAssembly, answering the page
web.go                the Android app's server (-tags web), behind a code made each launch
devhooks_*.go         dev-build hooks for automated checks
internal/core/        the app's state and what each screen shows
internal/server/      the API the frontend calls, its hosts, media, the Android server's door
internal/plugin/      plugins: manifests, installing, permissions, their recorded tests
internal/script/      the Lua sandbox plugins run in, and its mantle.* library
internal/secrets/     the plugins' keys and sign-ins (encrypted on Windows)
internal/portable/    locates the data folder beside the executable
internal/art/, fetch/, media/, release/, container/, sample/
                      artwork, downloads, media files, release names, containers, the sample
plugins/              the plugins that come with the app, each with its tests
frontend/             the UI
  src/app/            the shell (rail, tabs, router, player); src/app/pages/ has the screens
  src/ui/             the component kit, each with Storybook stories
  src/core/           the frontend's side of the API, where it runs, the clipboard
  src/web/            the web build's page side: the core's worker, its files, one tab at a time
  src/nav/, src/input/  focus movement; keyboard, mouse, touch and controllers
  src/styles/, src/brand/, src/foundations/, src/test/
                      design tokens, the logo, Storybook's token pages, story checks
android/              the Android app: a WebView over Mantle's server, compiled for Android
tools/mk/             build, dev, test and packaging
docs/                 the guides, the developer docs, and the design reference

Working on it #

  • Robustness, clarity, conciseness and minimalism. Prefer simple procedural control flow to early abstraction; drive things by data; reuse rather than repeat.
  • Components are rebuilt from the prototype to match it exactly, with the cleanest code that does so. Each one gets a Storybook page (docs, a Playground, variants) and behaviour stories that test every input it supports: mouse, keyboard, controller and touch. Every story must also pass shared layout checks, axe and a quiet console; see the Introduction page in Storybook.
  • Plugins are tested against recorded answers (plugins/<id>/tests/), the core against stand-in networks; nothing in the tests reaches a real service.
  • Git history is the record of what changed and why. Docs describe the current state only.

License #

MIT: see LICENSE. Each release carries it in its zip.