Media Team Hub
Scheduling and training platform for a church media team.
Current state: the app is built and running (Next.js 15 + Postgres, containerised). For the live code map, phase status, the security/correctness repair pass, remaining gaps and next steps, read docs/PROJECT-STATE.md. The sections below are the original planning docs and describe intended behaviour; the stack notes are historical (the build targets a portable Node container, not Cloudflare Workers).
Read in this order
| Doc | What it answers | Length |
|---|---|---|
| docs/FEATURE-SUMMARY.md | Plain-language feature list with a tick-box sign-off — send this to the ministry leader. | ~5 min |
| docs/BUILD-SPEC.md | What are we building, screen by screen, and in what order? The build team's source of truth. | ~15 min |
| docs/ARCHITECTURE.md | How is it built — stack, data model, scheduling and reminder logic, security. | ~25 min |
| docs/BUILD-PLAN.md | The order to build it in: 56 units across 10 phases (plus 5 deferred media-library units), 7 checkpoints, and the rules that stop an AI agent looping. Give this to the agent. | ~15 min |
Media library & video
Media is an ad-free library of the event photos and videos the signed-in person can access. Event photos remain private to assigned photographers and managers; the library does not publish them.
Videos are uploaded from an event page or the Media page:
- The untouched camera original is written to
<ARCHIVE_DIR>/<Archive folder>/videos/<event>/<video>/original.*on the NFS mount. - FFmpeg probes the file and creates a web H.264/AAC MP4 plus a poster under the uploads volume. The original is never changed.
- Processing runs after the upload response; the video page polls until the video is ready. A failed encode can be retried without re-uploading.
- The editor supports title, description, visibility, and a non-destructive start/end trim. Saving a trim re-renders the web MP4 and poster.
Visibility is Media team only by default. Coordinators/admins can choose
Unlisted link or Public. Those ready videos get a public /watch/<id> page
with Open Graph video tags, a minimal /embed/<id> iframe, and an oEmbed endpoint
at /api/oembed?url=.... Social platforms still require the deployment to have
a public HTTPS origin (PUBLIC_ORIGIN or the request host).
Backup & restore
Admins get Admin → Backup & restore. The download is one ZIP containing:
dump.sql— a complete Postgres dump (schema, data, constraints, indexes, and migration ledger)uploads/— training attachments, event photos, and video derivativesarchive/— the mounted NFS media archive, including original videosmanifest.json— timestamp, app version, SHA-256 checksum, and included areas
The manifest excludes .env and the console outbox. Store NEXTAUTH_SECRET
with the backup: it decrypts runtime settings such as the Gmail app password.
To restore after a redeploy, bring up the new stack, run migrations/seed, sign in
as the bootstrap admin (admin@glenloch.local when using the seed), open
Admin → Backup & restore, upload the ZIP, type RESTORE, and confirm. If the
new deployment has no mail provider, keep MAGIC_LINK_DEV_TRANSPORT=true
temporarily and read the bootstrap sign-in link from docker compose logs app.
A restore replaces the current database and the file areas listed in the manifest. The database load is one transaction, so a bad or incompatible dump rolls back rather than leaving a half-restored schema.
The 60-second version
The problem. Three roles — Audio, Livestream, Slides — every week, managed by memory and group texts.
The product. One place where:
- volunteers publish blackout dates and confirm shifts in three taps from a text message;
- each person records how comfortable they are on each piece of gear, an admin or mentor verifies their real level, and experts become mentors for people who want to learn that position;
- an admin approves people and builds the week on a drag-and-drop grid with conflict detection and fair auto-fill;
- the system emails each volunteer the Friday before they serve, with the call time (SMS reminders are deferred to a later phase — see launch scope note below);
- one-off events — weddings, baptisms, youth nights — get a photographer assigned on the same engine, with a shot brief on their phone; a RAW photo library for editors is designed but deferred to phase 2;
- training lives alongside it — rich text how-tos and videos, gating who is qualified for which role;
- anything on screen comes out as a file: PDF for the printed booth sheet and leadership packs, XLSX for working spreadsheets, CSV for everything else.
The stack. Next.js + TypeScript on Cloudflare Workers, SQL via Drizzle (D1 or Postgres), Postmark for email, R2 for media, TipTap for rich text everywhere, cron worker for reminders. SMS (Twilio) is deferred — launch is email-only.
The cost. About $35–40/month at ~120 volunteers.
The timeline. ~10.5 weeks full-time, ~6 months part-time, with a 4-week pilot on one service before retiring the spreadsheet.
Launch scope (decided): email-only. SMS reminders (Twilio + A2P 10DLC registration) are deferred to a later phase. The notification pipeline is built channel-agnostic, so SMS slots in later with no rework. When you're ready: a Twilio EIN + 10DLC brand registration (1–3 weeks) is the only external lead time.
Design decisions worth arguing about
- "Friday before" is a rule row, not code. Reminders are computed as
service start − 2 days at 18:00 local, so a Wednesday service automatically reminds on Monday and the church can move the send time without a developer. - Volunteer responses never require a login. Signed one-click links in the email and text carry the confirm/decline action. Any friction at that moment kills the whole system's value.
- The schedule does not depend on AI or on a third-party service. Publishing writes to an outbox table; a cron worker drains it. An email outage cannot block scheduling, and an LLM outage hides one search box.
- Auto-fill is deterministic scoring, not a model. Fairness, certification and availability are solved in ~60 lines of ranked logic that an admin can read and explain.
- Draft vs published weeks. Nothing notifies anyone until the admin explicitly publishes, which prevents the schedule-storm that kills trust in tools like this.
- Certification gating. A trainee cannot be dropped alone on the audio board; shadow slots are a first-class concept.
- Nothing about the gear is hardcoded. Categories, companies, products, functions, positions and the skills composed from them are all admin-edited rows. Buy a new switcher or rename a position and the app follows — no deploy.
- Skill is per technology, not per person. Someone can be 90% on ProPresenter and 30% on the audio console, so scheduling asks "who can run this position this Sunday" — availability first, then verified competency, then fairness. Self-rated comfort informs the decision; only a mentor's sign-off authorises it.
Before you build: 5 answers needed
- Exact service times and timezone.
- One person per role, or more on big Sundays?
- Who is an admin vs. a coordinator, and what does each own?
- What system are you migrating from (CSV export available)?
- Email: a domain you control for the sending address (e.g. media@yourchurch.org) plus SPF/DKIM/DMARC. SMS is deferred — when you add it you'll need a Twilio EIN + 10DLC registration (1–3 weeks), but that can wait until email is running.
Full list in BUILD-SPEC.md §12.
Decisions recorded from your answers
These are the concrete answers to the five pre-build questions, recorded so the builder doesn't re-ask them:
- Services: two Sunday services — 10:30 AM and 5:30 PM, timezone America/New_York (not a fixed "EST" — the system stores UTC and renders local, so DST is handled automatically). Both are fully changeable later as data, no code.
- Headcount: one person per role for every slot.
- Roles: Admin = full control over everything, including system/settings. Coordinator = full control over scheduling, people, events, training and notifications — everything except design/theme and admin/system settings (i.e. a feature-scoped split, not a single-role scope).
- Migration: CSV only — a one-way "load existing volunteers" step, not a two-way sync.
- Notifications: email-only at launch; SMS (Twilio + 10DLC) deferred to a later phase.
Suggested next step
Review the build spec, answer the five questions, then start Phase 0: wireframes for the schedule grid, approval queue, blackout calendar and lesson editor — and kick off the Twilio 10DLC registration in parallel, since it has the longest external lead time.
Documents dated 2026-11-17. Prices and provider fees are estimates — verify current pricing before committing a budget.