halkyon/apps/meditate/halkyon_meditate_server/library.example.yaml
Tizian 「ティツィアーン」 929974443d
feat(meditate): the operator's library on the server, and a course's lessons done synced
An operator's folder (MEDITATE_LIBRARY_DIR) of recordings, pictures and a
YAML manifest, library.yaml (commented sample: library.example.yaml), read
as the server starts and every ten minutes, held in memory. Items without
a licence or credit, files outside the folder, unknown categories and
courses pointing at items not served are refused and logged; a manifest
that doesn't read keeps the library served before. bin/check_library.dart
checks a folder before deploying.

The catalogue goes to signed-in people alone (LibraryEndpoint), with a
12-hour access the server signs; the web server's /library/<served name>
serves the files to that access only, by ranges (relic's StaticHandler).
No request path reaches the file system.

lesson_done: a lesson done, sealed and synced, a row each; the migration
creates the table with its spaceId index and the cascading foreign key to
the sync engine's spaces, as dream's did. ADR 0038, D16.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-11-04 09:31:59 +01:00

97 lines
3.1 KiB
YAML

# An operator's library for Halkyon Meditate (ADR 0038, D16): this file,
# named library.yaml, at the top of the folder MEDITATE_LIBRARY_DIR names,
# with the recordings and pictures it lists below it. The server reads it as
# it starts and again every ten minutes; check a folder before deploying it
# with `dart run bin/check_library.dart <folder>` (in this package).
#
# Every entry here is made up, as a sample: write your own, and offer only
# what you may (the licence and credit are required, and shown in the app).
#
# The format's version.
version: 1
# Categories of your own, beside Meditate's (meditation, sleep-story, sound,
# movement, autogenic-training, progressive-muscle-relaxation, routine,
# dream-journey, knowledge, morning-story, other), named in English and
# German. Optional.
categories:
- key: breathwork
english: Breathwork
german: Atemarbeit
# What there is to listen to.
items:
# The id is your stable slug (a-z, 0-9, -): people's favourites, sittings
# and lessons done refer to it, so never change it once offered.
- id: evening-body-scan
title: An evening body scan
category: meditation
description: Attention moves slowly from the feet to the crown.
speaker: Sample Speaker
# BCP 47: en, de, de-CH, …
language: en
# Paths are relative to this folder, and must stay inside it.
image: images/body-scan.jpg
# Required: the licence you offer it under, and whom to credit.
licence: CC BY 4.0
licence-url: https://creativecommons.org/licenses/by/4.0/
credit: Sample Speaker, recorded for this instance
# One or more recordings, by length or voice; a duration in seconds, or
# as m:ss or h:mm:ss.
audio:
- file: audio/body-scan-10.mp3
label: 10 minutes
duration: "10:12"
- file: audio/body-scan-20.mp3
label: 20 minutes
duration: 1205
- id: soft-rain
title: Soft rain
category: sound
description: Rain on a roof, to sit with in silence.
language: en
licence: CC0 1.0
credit: Sample Recordist
audio:
- file: audio/soft-rain.ogg
duration: "30:00"
- id: box-breathing
title: Box breathing
category: breathwork
speaker: Sample Speaker
language: en
licence: CC BY 4.0
credit: Sample Speaker
audio:
- file: audio/box-breathing.mp3
duration: "5:30"
- id: abendliche-ruhe
title: Abendliche Ruhe
category: sleep-story
description: Eine kurze Geschichte zum Einschlafen.
speaker: Beispielsprecherin
language: de
licence: CC BY-SA 4.0
credit: Beispielsprecherin
audio:
- file: audio/abendliche-ruhe.m4a
duration: "14:40"
# Courses: lessons in order, each one of the items above.
courses:
- id: a-calm-week
title: A calm week
description: Three evenings to begin with.
category: meditation
language: en
image: images/calm-week.png
lessons:
- item: evening-body-scan
title: Evening one, the body
- item: box-breathing
title: Evening two, the breath
- item: soft-rain
title: Evening three, listening