diff --git a/.env.showcase.example b/.env.showcase.example new file mode 100644 index 0000000..da66e9f --- /dev/null +++ b/.env.showcase.example @@ -0,0 +1,7 @@ +# Copy to .env.showcase and edit these values. +SHOWCASE_ARCHIVE_ROOT=./archive +SHOWCASE_DATA_ROOT=./data/showcase +SHOWCASE_HOST=127.0.0.1 +SHOWCASE_PORT=8080 +SHOWCASE_FFMPEG=ffmpeg +SHOWCASE_FFPROBE=ffprobe diff --git a/.gitignore b/.gitignore index 30c1950..747e129 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ coverage/ .env .env.* !.env.example +!.env.showcase.example data/ cache/ derived/ diff --git a/README.md b/README.md index 07e4ab4..19e402a 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ The first version targets Chrome, Firefox, and modern MSE-capable Android TV bro See [architecture.md](docs/architecture.md) for the media decisions and [operations.md](docs/operations.md) for deployment gates. +For a small, open demo that runs as one Node process with SQLite and no Docker, PostgreSQL, Redis, worker, queue, or admin panel, use the [Showcase edition](docs/showcase.md). + ## What happens to a movie | Source | v1 behavior | Storage | diff --git a/apps/showcase/package.json b/apps/showcase/package.json new file mode 100644 index 0000000..49936d1 --- /dev/null +++ b/apps/showcase/package.json @@ -0,0 +1,25 @@ +{ + "name": "@easy-stream/showcase", + "version": "0.1.0", + "private": true, + "type": "module", + "engines": { "node": ">=24" }, + "scripts": { + "cli": "node --import tsx src/cli.ts", + "build": "corepack pnpm exec esbuild src/cli.ts --bundle --platform=node --format=esm --packages=external --outfile=dist/cli.js", + "typecheck": "tsc --noEmit", + "test": "vitest run" + }, + "dependencies": { + "@easy-stream/media": "workspace:*", + "@fastify/static": "^8.3.0", + "fastify": "^5.6.2" + }, + "devDependencies": { + "@types/node": "^24.10.1", + "esbuild": "^0.25.12", + "tsx": "^4.20.6", + "typescript": "^5.9.3", + "vitest": "^3.2.4" + } +} diff --git a/apps/showcase/src/cli.ts b/apps/showcase/src/cli.ts new file mode 100644 index 0000000..cfcf4b5 --- /dev/null +++ b/apps/showcase/src/cli.ts @@ -0,0 +1,64 @@ +#!/usr/bin/env node +import { mkdir } from 'node:fs/promises'; +import { assertArchive, readConfig } from './config.js'; +import { openDatabase } from './database.js'; +import { prepareSelection, printStatus, pruneMedia } from './prepare.js'; +import { scanIntoDatabase } from './scan.js'; +import { startServer } from './server.js'; + +function value(args: string[], option: string): string | undefined { + const index = args.indexOf(option); + return index >= 0 ? args[index + 1] : undefined; +} + +function help(): void { + console.log(`Easy Stream Showcase + +Usage: + pnpm showcase scan + pnpm showcase prepare --all [--force] + pnpm showcase prepare --title [--quality