Live sermon translation into 100+ languages, running entirely on one Mac per campus: audio in, voice detection, Whisper on the GPU, NLLB-200 in its own process, and a built-in web server the congregation reads from on their phones. No audio leaves the building. This is the source only. What used to sit beside it — 14 GB of speech and translation models, 8 GB of voice bundles, 6 GB of natural voices, the Electron caches, and the app data holding the operator PIN and every service transcript — is machine state and downloaded assets, and stays in the NAS backup where it belongs. The vendored node, cloudflared and Windows ffmpeg binaries are out too (533 MB, re-fetched for packaging); the browser-side runtime beside them is kept, so a checkout still serves the congregation page. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
19 lines
1.0 KiB
JavaScript
19 lines
1.0 KiB
JavaScript
/* Throwaway static server so the operator-page preview can be looked at in a
|
|
browser. Absolute root, no reliance on cwd — the launcher's working
|
|
directory is not readable in this sandbox. */
|
|
const http = require('http');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const ROOT = '/Users/Studio/Documents/church-translate/app';
|
|
const TYPES = { '.html': 'text/html', '.js': 'text/javascript', '.css': 'text/css', '.json': 'application/json' };
|
|
http.createServer((req, res) => {
|
|
const rel = decodeURIComponent(req.url.split('?')[0]).replace(/^\/+/, '') || '_preview-langlist.html';
|
|
const file = path.join(ROOT, rel);
|
|
if (!file.startsWith(ROOT)) { res.writeHead(403).end('no'); return; }
|
|
fs.readFile(file, (err, buf) => {
|
|
if (err) { res.writeHead(404).end('not found: ' + rel); return; }
|
|
res.writeHead(200, { 'Content-Type': TYPES[path.extname(file)] || 'application/octet-stream' });
|
|
res.end(buf);
|
|
});
|
|
}).listen(4873, '127.0.0.1', () => console.log('preview on http://127.0.0.1:4873'));
|