feat(website): people and roles, messages with the YouTube feed, simple events
People: Owners and Admins add someone by email (people.ensure through Accounts), change roles, remove access; only Owners touch Owners, nobody changes themselves, a lower role ends sessions at once. Messages: from a YouTube channel or playlist every hour (public feed, no key) or by hand with a YouTube or Spotify link; own publish, hide. Simple events: own publish, cancel, remove. Tests and e2e with axe on the new screens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* Starts the Church Website's backend: database, HTTP server, and (on a Hub install) registering
|
||||
* with the Hub from HUB_LICENCE_KEY, then heartbeats, which also link the site to the church's
|
||||
* Accounts once the Hub lists it. The other jobs (YouTube feed, storage count, sitemap, feed sync)
|
||||
* come with their features (docs/WEBSITE-1.0-PLAN.md §1).
|
||||
* Accounts once the Hub lists it, and the hourly YouTube feed (§7). The other jobs (storage emails,
|
||||
* the event feed) come with their features (docs/WEBSITE-1.0-PLAN.md §1).
|
||||
*/
|
||||
import 'dotenv/config';
|
||||
import { PrismaPg } from '@prisma/adapter-pg';
|
||||
@@ -11,6 +11,7 @@ import { createApp } from './app.js';
|
||||
import { createCtx } from './context.js';
|
||||
import { connectFromEnv, heartbeat, startHeartbeats } from './hub/client.js';
|
||||
import { loadConfig } from './lib/config.js';
|
||||
import { startYoutubeSync } from './site/youtube.js';
|
||||
|
||||
async function main() {
|
||||
const config = loadConfig();
|
||||
@@ -21,6 +22,7 @@ async function main() {
|
||||
const app = createApp(ctx);
|
||||
const server = app.listen(config.port, () => console.log(`[website] Listening on ${config.port} (${config.publicUrl}).`));
|
||||
const stopHeartbeats = startHeartbeats(ctx);
|
||||
const stopYoutube = startYoutubeSync(ctx);
|
||||
|
||||
connectFromEnv(ctx).then((r) => {
|
||||
if (r.connected || r.reason === 'already') heartbeat(ctx).catch(() => {});
|
||||
@@ -28,6 +30,7 @@ async function main() {
|
||||
|
||||
const stop = async () => {
|
||||
stopHeartbeats();
|
||||
stopYoutube();
|
||||
server.close();
|
||||
await db.$disconnect();
|
||||
process.exit(0);
|
||||
|
||||
Reference in New Issue
Block a user