A1: foundation scaffold (Next.js 15, shadcn/Radix, Drizzle+Postgres, Vitest, Docker)
- Next.js 15 + TS strict + Tailwind 4 + ESLint 9 - shadcn/ui initialized (Radix, CSS variables); cn() util - Drizzle + postgres driver + Zod; db client + schema placeholder (A2) - Vitest with passing cn() test; GitHub Actions CI - Portable container stack: multi-stage non-root Dockerfile, docker-compose (app + Postgres on host 5433) - Verified: typecheck, lint, test (3), build, docker build, HTTP 200 on :3000 - Records the 5 pre-build decisions (email-only launch, SMS deferred)
This commit is contained in:
@@ -0,0 +1,38 @@
|
|||||||
|
# PROGRESS
|
||||||
|
|
||||||
|
Build log for Media Team Hub. One unit per commit, top to bottom. Append after each passing check.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## A1 — Foundation scaffold — DONE 2026-11-17
|
||||||
|
|
||||||
|
**Scope (from BUILD-PLAN.md):** Next.js 15 + TS strict, Tailwind 4, shadcn/ui (Radix), Drizzle, Zod, Vitest, lint, CI.
|
||||||
|
|
||||||
|
**Delivered:**
|
||||||
|
- Next.js 15, React 19, TypeScript strict, Tailwind 4, ESLint 9
|
||||||
|
- shadcn/ui initialized manually (Radix + CSS variables) — `components.json`, `src/lib/utils.ts`, theme in `globals.css`
|
||||||
|
- Drizzle + `postgres` driver + Zod; `src/db/index.ts` client, `src/db/schema.ts` placeholder (A2 fills it)
|
||||||
|
- Vitest (jsdom-capable) with a passing `cn()` test
|
||||||
|
- GitHub Actions CI (typecheck → lint → test → build)
|
||||||
|
- **Portable container stack** (user request): multi-stage Dockerfile (non-root, pnpm), `docker-compose.yml` (app + Postgres), `.dockerignore`
|
||||||
|
|
||||||
|
**Verification (all exit 0):**
|
||||||
|
- `pnpm typecheck` ✓
|
||||||
|
- `pnpm lint` ✓
|
||||||
|
- `pnpm test` ✓ (3 tests)
|
||||||
|
- `pnpm build` ✓
|
||||||
|
- `docker compose build app` ✓
|
||||||
|
- Container serves HTTP 200 on :3000, title "Media Team Hub" ✓
|
||||||
|
|
||||||
|
**Port audit (nothing else touched):** app → host **3000**; Postgres → host **5433** (local 5432 already taken). Confirmed free before binding.
|
||||||
|
|
||||||
|
**Decisions recorded in README.md ("Decisions recorded from your answers"):**
|
||||||
|
- Services: Sun 10:30 AM + 5:30 PM, `America/New_York` (DST-safe, changeable as data)
|
||||||
|
- One person per role
|
||||||
|
- Admin = full control; Coordinator = everything except design/theme + admin/settings
|
||||||
|
- CSV-only migration
|
||||||
|
- **Email-only at launch; SMS (Twilio + 10DLC) deferred**
|
||||||
|
|
||||||
|
**Stack change from docs:** docs target Cloudflare Workers (D1/R2/Cron Triggers — not portable). For portability we use standard Next.js Node container + Postgres + local media volume + node cron worker. Domain logic, data model, and UI are unchanged.
|
||||||
|
|
||||||
|
**Next: A2 — schema core.**
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.dockerignore
|
||||||
|
Dockerfile
|
||||||
|
docker-compose.yml
|
||||||
|
node_modules
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
*.log
|
||||||
|
coverage
|
||||||
|
.next
|
||||||
|
out
|
||||||
|
build
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Media Team Hub — environment variables
|
||||||
|
# Copy to `.env` for local dev. Never commit real secrets (`.env*` is gitignored).
|
||||||
|
# All secrets are server-only — never prefix with NEXT_PUBLIC_.
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Database (Postgres). docker-compose sets this for the app container.
|
||||||
|
DATABASE_URL=postgres://media:media@localhost:5432/media
|
||||||
|
|
||||||
|
# Auth (magic-link). Generate a secret with: openssl rand -base64 32
|
||||||
|
NEXTAUTH_URL=http://localhost:3000
|
||||||
|
NEXTAUTH_SECRET=change-me-generate-a-random-secret
|
||||||
|
|
||||||
|
# Email (Postmark) — deferred? No: email is launch. SMS (Twilio) is later.
|
||||||
|
POSTMARK_SERVER_TOKEN=
|
||||||
|
POSTMARK_FROM=media@localhost
|
||||||
|
|
||||||
|
# AI assist (optional, phase 4). App degrades gracefully without it.
|
||||||
|
LLM_API_KEY=
|
||||||
|
|
||||||
|
# App
|
||||||
|
APP_ORIGIN=http://localhost:3000
|
||||||
|
CHURCH_TIMEZONE=America/New_York
|
||||||
|
|
||||||
|
# Observability
|
||||||
|
SENTRY_DSN=
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, develop]
|
||||||
|
pull_request:
|
||||||
|
branches: [main, develop]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: pnpm
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Typecheck
|
||||||
|
run: pnpm typecheck
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: pnpm lint
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: pnpm test
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: pnpm build
|
||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
/.pnp
|
||||||
|
.pnp.*
|
||||||
|
.yarn/*
|
||||||
|
!.yarn/patches
|
||||||
|
!.yarn/plugins
|
||||||
|
!.yarn/releases
|
||||||
|
!.yarn/versions
|
||||||
|
|
||||||
|
# testing
|
||||||
|
/coverage
|
||||||
|
|
||||||
|
# next.js
|
||||||
|
/.next/
|
||||||
|
/out/
|
||||||
|
|
||||||
|
# production
|
||||||
|
/build
|
||||||
|
|
||||||
|
# misc
|
||||||
|
.DS_Store
|
||||||
|
*.pem
|
||||||
|
|
||||||
|
# debug
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
|
# env files (commit .env.example only, never real secrets)
|
||||||
|
.env.local
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
# vercel
|
||||||
|
.vercel
|
||||||
|
|
||||||
|
# typescript
|
||||||
|
*.tsbuildinfo
|
||||||
|
next-env.d.ts
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Media Team Hub — portable, containerized Next.js app.
|
||||||
|
# Multi-stage: build in an alpine/node image, run a lean runner image.
|
||||||
|
# The app is standard HTTP on :3000 — sit it behind your reverse proxy.
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
FROM node:22-alpine AS base
|
||||||
|
WORKDIR /app
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
# pnpm is how this project is built (see package.json scripts).
|
||||||
|
RUN npm install -g pnpm@9.15.0
|
||||||
|
|
||||||
|
FROM base AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
# Frozen install — fails the build if the lockfile is out of sync.
|
||||||
|
RUN pnpm install --frozen-lockfile
|
||||||
|
COPY . .
|
||||||
|
RUN pnpm build
|
||||||
|
|
||||||
|
FROM node:22-alpine AS runner
|
||||||
|
WORKDIR /app
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
# pnpm runs the app in production (see package.json scripts).
|
||||||
|
RUN npm install -g pnpm@9.15.0
|
||||||
|
|
||||||
|
# Run as a non-root user (busybox adduser/addgroup on alpine).
|
||||||
|
RUN addgroup -S nodegrp \
|
||||||
|
&& adduser -S -G nodegrp -H -D nextjs
|
||||||
|
|
||||||
|
# Build output, deps, static assets.
|
||||||
|
COPY --from=builder --chown=nextjs:nodegrp /app/public ./public
|
||||||
|
COPY --from=builder --chown=nextjs:nodegrp /app/node_modules ./node_modules
|
||||||
|
COPY --from=builder --chown=nextjs:nodegrp /app/package.json ./package.json
|
||||||
|
COPY --from=builder --chown=nextjs:nodegrp /app/.next ./.next
|
||||||
|
|
||||||
|
USER nextjs
|
||||||
|
EXPOSE 3000
|
||||||
|
ENV PORT=3000
|
||||||
|
ENV HOSTNAME=0.0.0.0
|
||||||
|
CMD ["pnpm", "start"]
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
# Media Team Hub — Planning Docs
|
||||||
|
|
||||||
|
Architecture and build documentation for a church media team scheduling and training platform. No application code yet — these are the documents you review, approve, and hand to whoever builds it.
|
||||||
|
|
||||||
|
## Read in this order
|
||||||
|
|
||||||
|
| Doc | What it answers | Length |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| **[docs/FEATURE-SUMMARY.md](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](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](docs/ARCHITECTURE.md)** | How is it built — stack, data model, scheduling and reminder logic, security. | ~25 min |
|
||||||
|
| **[docs/BUILD-PLAN.md](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 |
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
1. **"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.
|
||||||
|
2. **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.
|
||||||
|
3. **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.
|
||||||
|
4. **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.
|
||||||
|
5. **Draft vs published weeks.** Nothing notifies anyone until the admin explicitly publishes, which prevents the schedule-storm that kills trust in tools like this.
|
||||||
|
6. **Certification gating.** A trainee cannot be dropped alone on the audio board; shadow slots are a first-class concept.
|
||||||
|
7. **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.
|
||||||
|
8. **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
|
||||||
|
|
||||||
|
1. Exact service times and timezone.
|
||||||
|
2. One person per role, or more on big Sundays?
|
||||||
|
3. Who is an admin vs. a coordinator, and what does each own?
|
||||||
|
4. What system are you migrating from (CSV export available)?
|
||||||
|
5. **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](docs/BUILD-SPEC.md).
|
||||||
|
|
||||||
|
## 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:
|
||||||
|
|
||||||
|
1. **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.
|
||||||
|
2. **Headcount:** **one person per role** for every slot.
|
||||||
|
3. **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).
|
||||||
|
4. **Migration:** **CSV only** — a one-way "load existing volunteers" step, not a two-way sync.
|
||||||
|
5. **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.*
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://ui.shadcn.com/schema/vertex.json",
|
||||||
|
"style": "default",
|
||||||
|
"rsc": true,
|
||||||
|
"tsx": true,
|
||||||
|
"tailwind": {
|
||||||
|
"css": "src/app/globals.css",
|
||||||
|
"baseColor": "zinc",
|
||||||
|
"cssVariables": true,
|
||||||
|
"prefix": ""
|
||||||
|
},
|
||||||
|
"aliases": {
|
||||||
|
"components": "@/components",
|
||||||
|
"utils": "@/lib/utils",
|
||||||
|
"ui": "@/components/ui",
|
||||||
|
"lib": "@/lib",
|
||||||
|
"hooks": "@/hooks"
|
||||||
|
},
|
||||||
|
"iconLibrary": "lucide"
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
# Media Team Hub — portable stack (app + Postgres).
|
||||||
|
#
|
||||||
|
# docker compose up --build app db # run the app
|
||||||
|
# docker compose --profile tools run --rm migrate # run migrations + seed
|
||||||
|
#
|
||||||
|
# The app is standard HTTP on :3000 — put it behind your reverse proxy.
|
||||||
|
# Host ports are chosen to avoid everything already running on this host
|
||||||
|
# (see the port audit): app=3000, postgres published on 5433 (local 5432 is taken).
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
environment:
|
||||||
|
NODE_ENV: production
|
||||||
|
DATABASE_URL: postgres://media:media@db:5432/media
|
||||||
|
NEXTAUTH_URL: http://localhost:3000
|
||||||
|
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-dev-only-secret-change-me}
|
||||||
|
POSTMARK_FROM: media@localhost
|
||||||
|
APP_ORIGIN: http://localhost:3000
|
||||||
|
CHURCH_TIMEZONE: America/New_York
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: media
|
||||||
|
POSTGRES_PASSWORD: media
|
||||||
|
POSTGRES_DB: media
|
||||||
|
# Host 5433 -> container 5432 (local postgres already holds 5432).
|
||||||
|
ports:
|
||||||
|
- "5433:5432"
|
||||||
|
volumes:
|
||||||
|
- pgdata:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U media"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
# One-shot migrations + seed. Run on demand:
|
||||||
|
# docker compose --profile tools run --rm migrate
|
||||||
|
migrate:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
command: ["sh", "-c", "pnpm db:generate && pnpm db:migrate && pnpm db:seed"]
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: postgres://media:media@db:5432/media
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
profiles: ["tools"]
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
pgdata:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,401 @@
|
|||||||
|
# Build Plan — Agent Execution Guide
|
||||||
|
|
||||||
|
**Audience:** the AI coding agent (and any human supervising it)
|
||||||
|
**Companions:** [`BUILD-SPEC.md`](./BUILD-SPEC.md) (what), [`ARCHITECTURE.md`](./ARCHITECTURE.md) (how)
|
||||||
|
**Rule of this document:** if a unit is not on this list, it is not in scope yet.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. How to use this plan
|
||||||
|
|
||||||
|
You are building **one unit at a time**, top to bottom, within a phase. Each unit is a vertical slice that ends in something you can run, test, and commit. You do not start unit N+1 until unit N's **check** passes and you have appended a line to `.agent/PROGRESS.md`.
|
||||||
|
|
||||||
|
```text
|
||||||
|
┌─ pick next unit ──────────────────────────────────────────────┐
|
||||||
|
│ 1. Read: this unit's card + the files listed in "Touch" │
|
||||||
|
│ 2. Write the smallest code that satisfies "Done when" │
|
||||||
|
│ 3. Run the unit's check command │
|
||||||
|
│ 4. Pass → append to PROGRESS.md → commit → next unit │
|
||||||
|
│ Fail → attempt++ (max 3, see §3) → fix the cause, not the │
|
||||||
|
│ assertion → re-run only the failing check │
|
||||||
|
└───────────────────────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
**Never** read the whole repository at the start of a unit. The unit card tells you exactly which files matter. That is the context discipline that keeps you inside the window.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. The five rules that prevent looping
|
||||||
|
|
||||||
|
These are hard rules, not preferences.
|
||||||
|
|
||||||
|
1. **One unit, one concern.** If you find yourself editing a fifth file, stop: the unit is split wrongly. Revert to the last commit and report that it needs splitting (see §10).
|
||||||
|
2. **Three strikes, then stop.** Three failed attempts at the same check, or the **same error message twice in a row**, means you stop and write a handoff packet (§4.3). Do not "try one more thing."
|
||||||
|
3. **Change the approach, never the assertion.** A failing test is fixed by changing production code. Deleting an assertion, skipping a test, adding `any`, or loosening a type to make a check pass is a **build failure**, not a pass.
|
||||||
|
4. **Do not re-verify what already passed.** Run the unit's check, not the whole suite, not every check you know. The full gate runs at checkpoints only (§8).
|
||||||
|
5. **No opportunistic refactoring.** Not the file you touched, not "while I'm here." Improvements go in `.agent/BACKLOG.md` and get scheduled later.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. The anti-loop protocol (mechanical)
|
||||||
|
|
||||||
|
Keep an **attempt ledger** for the current unit, in the session and in `PROGRESS.md`:
|
||||||
|
|
||||||
|
```text
|
||||||
|
UNIT D5 · attempt 1 · `pnpm test src/domain/conflicts.test.ts`
|
||||||
|
FAIL: expected 1 conflict, got 0 — blackout range end exclusive
|
||||||
|
UNIT D5 · attempt 2 · same command
|
||||||
|
FAIL: expected 1 conflict, got 0 — blackout range end exclusive ← SAME SIGNATURE
|
||||||
|
→ STOP. Two identical errors = my model of the bug is wrong, not my patch.
|
||||||
|
```
|
||||||
|
|
||||||
|
**Escalation ladder — do these in order, not in a loop:**
|
||||||
|
|
||||||
|
| Attempt | What you may change |
|
||||||
|
| --- | --- |
|
||||||
|
| 1 | Implement the obvious solution. |
|
||||||
|
| 2 | Change **one** assumption. Add a failing unit test that isolates the smallest case (one date, one user) before touching the fix. |
|
||||||
|
| 3 | Reduce scope: implement the simplest correct version, mark the rest as `// TODO(unit-id)` and file it in `BACKLOG.md`. |
|
||||||
|
|
||||||
|
**Hard stops — write the handoff packet and end the turn:**
|
||||||
|
|
||||||
|
- Same error twice.
|
||||||
|
- A check fails that is **outside** your unit's file list (you broke something you shouldn't have touched).
|
||||||
|
- You need a schema change that is not in your unit's card.
|
||||||
|
- You are about to add a dependency.
|
||||||
|
- You have read more than ~6 files for one unit.
|
||||||
|
- The unit has grown past ~400 changed lines.
|
||||||
|
|
||||||
|
Stopping with a clear packet is a **success**. Grinding is the failure mode this document exists to prevent.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Unit contract
|
||||||
|
|
||||||
|
### 4.1 Every unit card has these fields
|
||||||
|
|
||||||
|
| Field | Meaning |
|
||||||
|
| --- | --- |
|
||||||
|
| **Goal** | One sentence, in user-visible terms. |
|
||||||
|
| **Depends** | Unit IDs that must be green first. |
|
||||||
|
| **Touch** | The only files you may create/modify. A new file is listed as new. |
|
||||||
|
| **Done when** | The exact command run + expected observable. |
|
||||||
|
| **Don't** | Known temptations for this unit (caching, refactors, extra states). |
|
||||||
|
| **Size** | S ≈ 1 file / <150 LOC · M ≈ 2–4 files / <400 LOC. **There are no L units.** |
|
||||||
|
|
||||||
|
### 4.2 Definition of Done (applies to every unit)
|
||||||
|
|
||||||
|
- [ ] The unit's check command exits `0`, output pasted into the commit body.
|
||||||
|
- [ ] `pnpm typecheck` passes (no `any`, no `@ts-ignore`, no `as unknown as`).
|
||||||
|
- [ ] `pnpm lint` passes with zero new suppressions.
|
||||||
|
- [ ] No new file outside **Touch**.
|
||||||
|
- [ ] If user-facing: renders at 360 px width and is keyboard-reachable.
|
||||||
|
- [ ] If it touches a domain rule: that rule has a unit test named after it.
|
||||||
|
- [ ] `.agent/PROGRESS.md` has a new line (append-only).
|
||||||
|
- [ ] One commit, message `unit(<ID>): <goal>`.
|
||||||
|
|
||||||
|
### 4.3 Handoff packet (when you stop)
|
||||||
|
|
||||||
|
Write this to `.agent/HANDOFF.md`, commit nothing else, and end your turn:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
## Unit <ID> — blocked
|
||||||
|
**Goal:** …
|
||||||
|
**Check:** `pnpm test …` → exits 1
|
||||||
|
**Exact error:**
|
||||||
|
<paste, not paraphrase>
|
||||||
|
**Attempts:**
|
||||||
|
1. changed X → same error
|
||||||
|
2. changed Y → same error
|
||||||
|
**What I believe is true:** (3 bullets max, with file:line evidence)
|
||||||
|
**What I did not try, and why:** (so the next agent doesn't repeat)
|
||||||
|
**Files touched:** …
|
||||||
|
**Recommended next step:** split unit / reduce scope to <smallest green subset> / human decision needed on <question>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.4 The progress ledger — `.agent/PROGRESS.md`
|
||||||
|
|
||||||
|
Append-only, one line per unit. This survives context loss and is the first thing any new session reads.
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
## Done
|
||||||
|
- A1 scaffold — `pnpm build` green — 2026-11-18
|
||||||
|
- A2 schema core — `pnpm db:migrate && pnpm db:seed` green — 2026-11-18
|
||||||
|
|
||||||
|
## In progress
|
||||||
|
- A3 auth — check: 403 test — attempt 2
|
||||||
|
|
||||||
|
## Decisions (do not re-litigate)
|
||||||
|
- Money/percent stored as integers. Dates: `occurs_on` = local date, `starts_at` = UTC.
|
||||||
|
- Scoring lives in `src/domain/**` as pure functions. No DB access there.
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Dependency map
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart TD
|
||||||
|
A1[A1 scaffold] --> A2[A2 schema]
|
||||||
|
A2 --> A3[A3 auth]
|
||||||
|
A3 --> A4[A4 shell]
|
||||||
|
A4 --> B1[B1 approvals]
|
||||||
|
B1 --> B2[B2 profile]
|
||||||
|
A2 --> B3[B3 catalog]
|
||||||
|
B3 --> C1[C1 skills]
|
||||||
|
C1 --> B4[B4 positions]
|
||||||
|
B4 --> D1[D1 services]
|
||||||
|
A2 --> D1
|
||||||
|
D1 --> D2[D2 instances]
|
||||||
|
D2 --> D3[D3 slots]
|
||||||
|
B2 --> D4[D4 blackouts]
|
||||||
|
D3 --> D5[D5 conflicts]
|
||||||
|
D4 --> D5
|
||||||
|
C1 --> C4[C4 readiness]
|
||||||
|
C3[C3 matrix] --> C4
|
||||||
|
D5 --> D6[D6 candidates]
|
||||||
|
C4 --> D6
|
||||||
|
D3 --> D7[D7 grid]
|
||||||
|
D6 --> D8[D8 assign]
|
||||||
|
D7 --> D8
|
||||||
|
D8 --> D9[D9 auto-fill]
|
||||||
|
D8 --> D10[D10 publish]
|
||||||
|
D10 --> E1[E1 outbox]
|
||||||
|
E1 --> E2[E2 dispatcher]
|
||||||
|
E2 --> E3[E3 email]
|
||||||
|
E3 --> E4[E4 magic links]
|
||||||
|
E1 --> E5[E5 sms]
|
||||||
|
D10 --> G2[G2 ics]
|
||||||
|
E3 --> F1[F1 richtext]
|
||||||
|
F1 --> F3[F3 courses]
|
||||||
|
F3 --> F4[F4 gating]
|
||||||
|
A2 --> G1[G1 swaps]
|
||||||
|
D8 --> G1
|
||||||
|
A2 --> G3[G3 dashboard]
|
||||||
|
D10 --> G4[G4 exports]
|
||||||
|
A3 --> H1[H1 ai gateway]
|
||||||
|
```
|
||||||
|
|
||||||
|
**Parallel-safe pairs** (different file trees, no shared schema change): `E-track × F-track`, `G2 × E-track`, `C2 × D-track`. Never parallelize two units that both write `src/db/schema.ts`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Phase A — Foundation (units A1–A4)
|
||||||
|
|
||||||
|
**Phase demo:** a signed-in user sees an empty shell at 360 px.
|
||||||
|
|
||||||
|
| ID | Unit | Size | Depends | Done when |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| A1 | Scaffold: Next 15 + TS strict, Tailwind, shadcn init, Drizzle, Zod, Vitest, lint, CI | M | — | `pnpm build && pnpm typecheck && pnpm test` all exit 0 with one placeholder test |
|
||||||
|
| A2 | Schema core: users, roles, services, instances, slots, assignments + migration + seed script | M | A1 | Drop DB → `pnpm db:migrate && pnpm db:seed` exits 0; `SELECT count(*) FROM service_instances` > 0 |
|
||||||
|
| A3 | Auth: magic-link sign-in (dev console transport), session cookie, `requirePermission()` chokepoint, role enum | M | A2 | `pnpm test src/auth` green: 401 anonymous, 403 volunteer on `/admin`, 200 admin |
|
||||||
|
| A4 | App shell: layout, nav (5 tabs mobile / rail desktop), tokens, error + empty states, `/api/health` | M | A3 | `pnpm test:e2e --grep shell` passes at 360 px viewport |
|
||||||
|
|
||||||
|
**A2 note:** write the schema in the order users → roles → services → instances → slots → assignments. Do not add the catalog tables yet (B3). Resist "while I'm in the schema."
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Phase B — People, catalog, positions (units B1–B4)
|
||||||
|
|
||||||
|
**Phase demo:** an admin invites someone, approves them, and defines a position with a skill requirement.
|
||||||
|
|
||||||
|
| ID | Unit | Size | Depends | Done when |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| B1 | Invite → pending → approve/deny, with status transitions and an outbox row (console) | M | A3 | Test: invite creates `pending_approval`; approve flips to `active`; denied user cannot sign in |
|
||||||
|
| B2 | Profile + notification prefs + SMS consent capture (timestamp, source, ip) | S | B1 | Test: changing phone resets consent; consent fields populated on opt-in |
|
||||||
|
| B3 | Catalog CRUD: categories, vendors, technologies, functions (deactivate, not delete; slug frozen) | M | A2 | Test: create → rename keeps slug → deactivate hides from pickers but row persists |
|
||||||
|
| B4 | Positions: CRUD + requirements editor (skill, weight, required level, core) | M | B3, C1 | Test: position with no core skill refuses to save as publishable |
|
||||||
|
|
||||||
|
**B3 is a read-heavy unit.** Do not build the `/admin/catalog` UI yet — data layer + minimal form only. The six-tab UI arrives in I2 if time allows; the API is what other units need.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. Phase C — Skills and competency (units C1–C6)
|
||||||
|
|
||||||
|
**Phase demo:** a volunteer rates sliders, an admin sees a matrix and verifies a level.
|
||||||
|
|
||||||
|
| ID | Unit | Size | Depends | Done when |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| C1 | Skills composer: category + optional technology + optional function → dedupe_key, name prefill | M | B3 | Test: duplicate (category, tech, function) rejected; null tech creates generic skill |
|
||||||
|
| C2 | Volunteer `/profile/skills`: sliders with anchor labels, verified chip, growth request button | M | C1, B2 | E2E: move slider → save → reload shows value; verified level unchanged |
|
||||||
|
| C3 | Admin skills matrix: grid, filters, verify-level modal writing `skill_assessments` | M | C1 | Test: verify writes assessment row + updates level; audit row exists |
|
||||||
|
| C4 | **Readiness scoring** — pure function in `src/domain/readiness.ts` | S | C1, B4 | `pnpm test readiness` green on 6 cases: no skills → blocked · all core at required → 100 · core below required → blocked + missing[] · non-core gaps → score < 100 · null comfort → level-only score · expert + 100 comfort → expert |
|
||||||
|
| C5 | Mentor designation: opt-in, admin approval, per-skill `mentor_ready` | S | C3 | Test: expert without opt-in is not mentor_ready; opt-in without admin approval is not either |
|
||||||
|
| C6 | Growth goals + shadow pairing validation (a shadow requires a mentor in the same instance) | M | C5, D3 | Test: shadow slot without paired mentor rejects at the data layer |
|
||||||
|
|
||||||
|
**C4 is the single most reused function in the app** (picker, auto-fill, matrix, dashboard). Write it pure, no DB, no imports from `src/db`. If it needs data, pass it in.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 9. Phase D — Scheduling (units D1–D10)
|
||||||
|
|
||||||
|
**Phase demo:** a full week built on the grid and published.
|
||||||
|
|
||||||
|
| ID | Unit | Size | Depends | Done when |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| D1 | Service CRUD + `expandRRULE()` (weekly / biweekly / monthly-nth) | M | B4 | `pnpm test recurrence` green on 5 named cases: spring-forward Sunday, fall-back Sunday, monthly-nth across a year boundary, cancelled instance not regenerated, biweekly phase stable |
|
||||||
|
| D2 | Instance generator (idempotent, 16-week window) on a cron route | M | D1 | Run twice → instance count unchanged; published instance untouched |
|
||||||
|
| D3 | Slot materialization from `position_skills`/requirements (headcount, call time) | S | D2 | Test: Audio headcount 2 creates 2 slots with correct call_time |
|
||||||
|
| D4 | Blackout CRUD + `isUnavailable(user, date)` pure function, ranges + rrule | M | B2 | `pnpm test availability` green incl. inclusive-end case |
|
||||||
|
| D5 | **Conflict engine** — pure function, hard vs soft conflicts | M | D3, D4 | Table-driven test: 10 cases, one per rule in BUILD-SPEC §7 |
|
||||||
|
| D6 | Candidate ranking service (availability filter → readiness → score) | M | D5, C4 | Test: away user excluded; unqualified blocked with reason code; ordering deterministic |
|
||||||
|
| D7 | Grid UI, read-only: rows = instances, cols = positions, week nav | M | D3 | E2E: renders a seeded week; no console errors |
|
||||||
|
| D8 | Assign / unassign / clear with optimistic update + rollback toast | M | D7, D6 | E2E: assign → appears immediately; forced failure rolls back with a message |
|
||||||
|
| D9 | Auto-fill proposals (reuse D6) + "apply all" | M | D8 | Test: proposals are deterministic for a fixed seed; apply is a no-op on second run |
|
||||||
|
| D10 | Publish / unpublish: transaction, validation, audit row, **no notifications yet** | M | D8 | Test: publish with open slots blocked unless `allowGaps`; re-publish is idempotent |
|
||||||
|
|
||||||
|
**D5 is the highest-risk unit in the project.** Isolate it: pure function, table-driven tests, zero UI, zero DB. If it takes more than 3 attempts, ship the hard-conflict subset and mark soft conflicts `TODO(D5)`.
|
||||||
|
|
||||||
|
**D10 deliberately does not send anything.** Notification wiring is E1. This separation is why an email outage can never block a schedule.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 10. Phase E — Communications (units E1–E7)
|
||||||
|
|
||||||
|
**Phase demo:** publish → exactly one email arrives; confirm link works. (E5 SMS is deferred — launch is email-only.)
|
||||||
|
|
||||||
|
| ID | Unit | Size | Depends | Done when |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| E1 | Outbox: enqueue on publish, `dedupe_key` unique, status enum | M | D10 | Test: enqueue twice → 1 row; declined assignment cancels its rows |
|
||||||
|
| E2 | Dispatcher: cron tick, guards (dedupe → assignment active → consent → quiet hours), retry/backoff | M | E1 | Test with fake clock: 3 failures → `failed`; quiet-hours SMS reschedules to 08:00 |
|
||||||
|
| E3 | Email: React Email templates, Postmark adapter, console transport in dev | M | E2 | `pnpm test notifications/email` green; dev send writes to `/tmp/outbox` |
|
||||||
|
| E4 | Magic-link respond: signed token, GET renders, POST mutates, single use | M | E3 | Test: GET does not change state; second POST with same jti rejects |
|
||||||
|
| E5 | SMS: Twilio adapter, STOP/HELP webhook, email fallback on failure | **Deferred** — launch is email-only. Reuses E2's dispatcher with no rework. | — | — |
|
||||||
|
| E6 | Admin notification log + retry + "send test to me" | M | E3 | E2E: failed row retries and reaches `sent` against the fake transport |
|
||||||
|
| E7 | Reminder rules CRUD (the Friday row: offset −2, 18:00, email+sms) | S | E1 | Test: changing offset changes computed `scheduled_for`; no code change needed |
|
||||||
|
|
||||||
|
**The reminder acceptance test is the project's most important check.** Run it at the E-phase checkpoint, not before.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 11. Phase F — Rich text and training (units F1–F6)
|
||||||
|
|
||||||
|
| ID | Unit | Size | Depends | Done when |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| F1 | TipTap editor + schema allowlist + **server-side** JSON→HTML render + sanitize | M | A4 | Test: script/iframe payload stripped; `javascript:` link rejected |
|
||||||
|
| F2 | Upload signing + R2 write + image node with required alt text | M | F1 | Test: oversized file rejected; missing alt blocks publish |
|
||||||
|
| F3 | Courses/lessons CRUD + viewer + progress (dwell / 90% watched) | M | F1 | E2E: complete a lesson → progress ring updates |
|
||||||
|
| F4 | Gating: eligibility from verified level + required course completion | S | F3, C4 | Test: incomplete course keeps user out of picker; override requires reason |
|
||||||
|
| F5 | Announcements + pages (audience targeting, expiry) | S | F1 | Test: audience filter excludes non-matching role |
|
||||||
|
| F6 | Run sheets per instance + print stylesheet | S | F1, D3 | `pnpm test:e2e --grep "print"` — one service per page, headers repeat |
|
||||||
|
|
||||||
|
**F1 is where sanitization is decided.** Render on the server with the same schema. Never store client HTML as truth. If you are tempted to `dangerouslySetInnerHTML` the client payload, stop — that is a security bug, not a shortcut.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 12. Phase G — Swaps, calendar, dashboard, exports (units G1–G5)
|
||||||
|
|
||||||
|
| ID | Unit | Size | Depends | Done when |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| G1 | Swaps: request, peer accept, coordinator approve, reassignment + notifications | M | D8, E3 | Test: original stays responsible until approval; both parties notified |
|
||||||
|
| G2 | ICS feed with opaque token, revocable | S | D10 | Fetch feed → valid VEVENT with call time; revoke → 404 |
|
||||||
|
| G3 | Dashboard cards (coverage, gaps, approvals, cron health) | M | D10, E2 | E2E: seeded gaps show red; heartbeat older than 20 min shows banner |
|
||||||
|
| G4 | Export engine: **CSV first**, shared dataset query, formula-injection guard | M | D10 | Test: `=cmd()` cell exported as `'=cmd()`; coordinator scope filters rows |
|
||||||
|
| G5 | XLSX + PDF renderers on the same datasets | M | G4 | Open artifact in a reader; header row frozen / booth sheet is one page |
|
||||||
|
|
||||||
|
**Split G4/G5 on purpose.** CSV proves the dataset and the security guard; XLSX and PDF are formatting on top. Two smaller units instead of one large one.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 13. Phase H — AI (units H1–H4, optional)
|
||||||
|
|
||||||
|
| ID | Unit | Size | Depends | Done when |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| H1 | AI gateway: server-only client, model allowlist, per-user daily cap, `ai_runs` logging, kill switch | M | A3 | Test: flag off hides every affordance; cap returns a friendly refusal |
|
||||||
|
| H2 | Ask-the-schedule: 3 read-only tools over existing services | M | H1, D6 | Test: unknown intent returns "I can't answer that" instead of inventing |
|
||||||
|
| H3 | Draft copy into the editor (JSON in, JSON out, schema-validated) | S | H1, F1 | Test: output that fails schema is rejected, not rendered |
|
||||||
|
| H4 | Explain auto-fill from the score breakdown | S | H1, D9 | Test: explanation cites the actual score components |
|
||||||
|
|
||||||
|
**H-phase rule:** if any H unit is attempted before phase D–F are green, stop. AI is additive and must never be on the critical path.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 13.5 Phase J — Events & photography (units J1–J6)
|
||||||
|
|
||||||
|
Run after Phase G. Depends on scheduling, notifications and rich text being green. **Not** a parallel scheduling system: it reuses the picker, the conflict engine and the outbox.
|
||||||
|
|
||||||
|
| ID | Unit | Size | Depends | Done when |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| J1 | `event_types` + `events` CRUD (rich-text description and brief fields) | M | B3, F1 | Test: create event → appears in list → brief renders sanitized |
|
||||||
|
| J2 | `slots.event_id` migration + `event_positions` materialization (CHECK: exactly one of instance/event) | M | J1, D3 | Migration runs on a seeded DB; CHECK rejects a slot with both or neither |
|
||||||
|
| J3 | Event assignment UI reusing D6 ranker + D8 assign mutations | M | J2, D8, C4 | E2E: assign photographer → conflict rules apply → overlap blocked |
|
||||||
|
| J4 | Event notifications via existing rules (`event.assigned`, −2 d reminder, `event.unfilled`) | S | J3, E7 | Test: publish event → 1 email + 1 SMS; unfilled alert at T-7 |
|
||||||
|
| J5 | Brief page `/events/[id]/brief` (phone, printable, tap-to-call) | S | J1, F6 | Renders at 360 px, printable, no console errors |
|
||||||
|
| J6 | Status flow + deliverable-due flag + dashboard tile | S | J3 | Test: past event stuck at `covered` flags after `deliverable_due` |
|
||||||
|
|
||||||
|
### Deferred — Phase K (media library, phase 2)
|
||||||
|
|
||||||
|
Do **not** start these until the launch gate passes and the church has agreed a retention policy and storage budget.
|
||||||
|
|
||||||
|
| ID | Unit | Notes |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| K1 | Multipart upload + `upload_batches` + checksum dedupe | Resumable; Worker signs only |
|
||||||
|
| K2 | Gallery with JPEG proxies + pagination | Browsers cannot render RAW |
|
||||||
|
| K3 | RAW download with `media.raw_download` + `media_downloads` audit | Signed, 15 min, single use |
|
||||||
|
| K4 | Retention job (delete originals, keep rows) | Default 90 days |
|
||||||
|
| K5 | Release/consent gate before gallery publishing | Minors; blocks publish |
|
||||||
|
|
||||||
|
## 14. Phase I — Launch (units I1–I4)
|
||||||
|
|
||||||
|
| ID | Unit | Size | Depends | Done when |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| I1 | Accessibility + mobile pass: focus order in the grid, labels, contrast, 44 px targets | M | D8, F3 | Axe scan on 5 volunteer routes: 0 critical; keyboard-only grid assign works |
|
||||||
|
| I2 | Starter catalog seed + CSV import (dry run, row errors) | M | B3 | Import 3 bad rows → nothing written, errors listed by line |
|
||||||
|
| I3 | Demo seed (6 volunteers, 8 weeks, 2 courses) for preview environments | S | A2 | `pnpm db:seed:demo` populates a browsable app |
|
||||||
|
| I4 | Runbook + env docs + deploy check + backup/restore drill | S | all | Restore drill completed; README commands work from a clean clone |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 15. Checkpoint gates
|
||||||
|
|
||||||
|
Run the **full gate** only here — not per unit.
|
||||||
|
|
||||||
|
| Gate | After | Commands | Must be true |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| **G1 Foundation** | A4 | `pnpm typecheck && pnpm lint && pnpm test && pnpm build` | All green; shell renders at 360 px |
|
||||||
|
| **G2 Data** | B4 | + `pnpm db:reset && pnpm db:seed` | Schema rebuilds from zero; seed is idempotent |
|
||||||
|
| **G3 Scheduling** | D10 | + `pnpm test:e2e --grep schedule` | A full week publishes; no notifications sent |
|
||||||
|
| **G4 Comms** | E7 | + the **reminder acceptance test** | One email, correct call time, second cron run sends nothing (SMS variant added when E5 is built) |
|
||||||
|
| **G5 Content** | F6 | + `pnpm test:e2e --grep training` | Lesson completes; gating blocks an untrained assign |
|
||||||
|
| **G5.5 Events** | J6 | `pnpm test:e2e --grep events` | An event is staffed, briefed, reminded and marked delivered |
|
||||||
|
| **G6 Feature-complete** | G5 | full suite + manual pass | Every Must in BUILD-SPEC §3.1 demoed on a phone |
|
||||||
|
| **G7 Launch** | I4 | full suite + restore drill | Clean-clone setup works; runbook accurate |
|
||||||
|
|
||||||
|
**Gate output goes in the commit body.** A gate that fails does not get "re-run until green" — it gets a handoff packet.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 16. Context budget — how to stay inside the window
|
||||||
|
|
||||||
|
| Situation | Rule |
|
||||||
|
| --- | --- |
|
||||||
|
| Starting a unit | Read the unit card + only the files in **Touch** + one neighbour file if needed. Nothing else. |
|
||||||
|
| Need to find something | `code_search` with a specific symbol; never `cat` a 600-line file. Use a line window. |
|
||||||
|
| File over ~400 lines | Do not read it whole. Search for the symbol, read ±40 lines. |
|
||||||
|
| Unit needs > 6 files | The unit is too big — split it before writing code. |
|
||||||
|
| Re-deriving a decision | Check `PROGRESS.md` → *Decisions*. If it is not there, add it after deciding. |
|
||||||
|
| Long tool output | Ask for exit codes and the first error, not the last 500 lines. |
|
||||||
|
| Session feels heavy | Finish the current unit, commit, write the ledger line, stop. The next session resumes from `PROGRESS.md`. |
|
||||||
|
|
||||||
|
**Stopping at a clean commit is always better than starting a unit you cannot finish.** Half-built units are what cause loops, because the next session cannot tell what was intended.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 17. Commits, branches, rollback
|
||||||
|
|
||||||
|
- One commit per unit: `unit(<ID>): <goal in imperative>` + gate output in the body.
|
||||||
|
- Branch per phase (`phase-d-scheduling`), merged at the gate. Never work across two phases in one branch.
|
||||||
|
- Before any risky refactor inside a unit: commit the green state first, so `git reset --hard` returns you to something that works.
|
||||||
|
- If a unit is abandoned, **revert it** rather than leaving partial code. `PROGRESS.md` records that it was reverted and why.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 18. What "done" means for the whole project
|
||||||
|
|
||||||
|
The plan is complete when every gate has passed and these three things are true:
|
||||||
|
|
||||||
|
1. A volunteer can go invite → approve → train → shadow → signed off → scheduled → reminded → confirmed without an admin touching anything after publish.
|
||||||
|
2. Two admins build and publish a week in under 10 minutes, measured.
|
||||||
|
3. An admin can add a new position, a new technology and a new skill, and schedule against them, with no deploy.
|
||||||
|
|
||||||
|
Everything else is a follow-up ticket in `.agent/BACKLOG.md`.
|
||||||
@@ -0,0 +1,825 @@
|
|||||||
|
# Media Team Hub — Build Specification
|
||||||
|
|
||||||
|
| Field | Value |
|
||||||
|
| --- | --- |
|
||||||
|
| Version | 1.0 (Draft for review) |
|
||||||
|
| Last updated | 2026-11-17 |
|
||||||
|
| Audience | Media Director (approver), person or team building it |
|
||||||
|
| Technical companion | [`ARCHITECTURE.md`](./ARCHITECTURE.md) — stack, data model, algorithms, security |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Problem statement
|
||||||
|
|
||||||
|
Three production roles — **Audio**, **Livestream**, **Slides** — must be staffed every week. Today that costs three people's attention across spreadsheets, texts and memory. Nobody has one place to see who is serving, who is away, or whether the booth is covered next Sunday. New volunteers learn the gear by standing behind someone, and that knowledge leaves when they do.
|
||||||
|
|
||||||
|
**This product makes the schedule a system, not a conversation.**
|
||||||
|
|
||||||
|
It must:
|
||||||
|
1. Let volunteers publish blackout dates once, and respect them.
|
||||||
|
2. Let an admin approve volunteers and build/publish the weekly schedule in minutes.
|
||||||
|
3. Guarantee every scheduled volunteer gets an **email and a text the Friday before** they serve.
|
||||||
|
4. Teach people the roles with written how-tos and videos, authored in a real rich text editor.
|
||||||
|
|
||||||
|
Success at 90 days: Sunday coverage ≥ 98% a week out, zero manual reminder texts from the director, and every active volunteer able to name their next serving date without asking.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Users
|
||||||
|
|
||||||
|
| Person | Role in product | What "done" looks like for them |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Media Director | Admin | Opens the app Sunday morning and has nothing to fix |
|
||||||
|
| Team Lead | Coordinator | Builds their role's slots in < 5 min/week |
|
||||||
|
| Volunteer | Volunteer | Knows when they serve; can say "I'm away" in 20 seconds |
|
||||||
|
| Trainee | Trainee | Can watch the audio tutorial before ever touching the board |
|
||||||
|
| New signup | Applicant | Gets approved and onboarded without a phone call |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Scope
|
||||||
|
|
||||||
|
### 3.1 In scope (v1)
|
||||||
|
|
||||||
|
| # | Capability | Priority |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| F1 | Email/password-less sign-in, invite-only signup, admin approval queue | Must |
|
||||||
|
| F2 | Volunteer profile with phone, SMS opt-in (consent captured), notification prefs | Must |
|
||||||
|
| F3 | Recurring services + role requirements (Audio / Livestream / Slides), 16-week rolling instances | Must |
|
||||||
|
| F4 | Blackout / unavailability submission, ranges + recurring patterns | Must |
|
||||||
|
| F5 | Admin weekly schedule grid: assign, detect conflicts, auto-fill suggestions, draft → publish | Must |
|
||||||
|
| F6 | Email notifications (assignment, Friday reminder, day-of, unfilled alerts) | Must |
|
||||||
|
| F7 | SMS notifications with 10DLC compliance, opt-in, STOP/HELP | **Deferred** — launch is email-only (F6). The pipeline is channel-agnostic, so SMS is a later unit with no rework.
|
||||||
|
| F8 | Confirm / decline from email or SMS without logging in | Must |
|
||||||
|
| F9 | Swap requests with coordinator approval | Should |
|
||||||
|
| F10 | ICS calendar feed + add-to-calendar | Should |
|
||||||
|
| F11 | Training library: courses, lessons, video embeds, progress, role gating | Must (bonus that became core) |
|
||||||
|
| F12 | Rich text editor for lessons, announcements, run sheets, templates, notes | Must |
|
||||||
|
| F13 | Run sheet per service (order of service) + printable booth sheet | Should |
|
||||||
|
| F14 | Admin dashboard: coverage, gaps, pending approvals, notification health | Must |
|
||||||
|
| F15 | Audit log, exports (**PDF, XLSX, CSV**), settings | Must |
|
||||||
|
| F16 | AI assist (ask-the-schedule, draft copy, explain auto-fill) | Could (phase 4) |
|
||||||
|
| F17 | **Skills & competency**: multiple skill areas per volunteer, self-rated comfort % per technology, verified levels, mentor designation | Must |
|
||||||
|
| F18 | **Growth requests** ("I want to learn Slides") with mentor matching and shadow slots | Should |
|
||||||
|
| F19 | **Configurable catalog**: categories, technology companies, products, functions, positions and skills are all admin-defined — nothing hardcoded | Must |
|
||||||
|
| F20 | **Events & photography assignment**: one-off events, photographer/second-shooter positions, shot brief, same reminders and confirm flow | Must |
|
||||||
|
| F21 | **Event media library**: upload originals, cull, download RAW for editing, publish galleries | **Later (phase 2)** — designed, not built in v1 |
|
||||||
|
|
||||||
|
F17 and F18 are specified together in §5 under *F17 — Skills, competency, mentoring & growth*: the competency model, the scheduling picker contract, and the skill-up lifecycle are one mechanism.
|
||||||
|
|
||||||
|
### 3.2 Out of scope (v1) — say no on purpose
|
||||||
|
|
||||||
|
- Worship team, ushers, greeters, kids ministry, parking.
|
||||||
|
- Payroll, background checks, volunteer-hour compliance.
|
||||||
|
- Driving ProPresenter / OBS / lighting. We *link* to run sheets; we don't control gear.
|
||||||
|
- Native mobile apps (PWA instead), multi-campus, denominations/multi-tenant billing.
|
||||||
|
- Public website, sermon archive, giving.
|
||||||
|
- In-app chat. (Announcements only. Two chat tools is one too many.)
|
||||||
|
|
||||||
|
### 3.3 Explicit assumptions
|
||||||
|
|
||||||
|
- One church, one timezone, 2 Sunday services + occasional midweek/special services.
|
||||||
|
- ~60–150 volunteers, 3–8 admins/coordinators.
|
||||||
|
- Volunteers have smartphones; ~30% will prefer SMS over email.
|
||||||
|
- The church can register a US 10DLC brand (EIN) with Twilio.
|
||||||
|
- An existing Google Sheet or Planning Center export exists to migrate from.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Information architecture
|
||||||
|
|
||||||
|
```
|
||||||
|
/ Volunteer home — my next serving date (big, unmissable)
|
||||||
|
/schedule My schedule (month + list), sports team view, ICS subscribe
|
||||||
|
/events My event assignments (photography, video)
|
||||||
|
/events/[id]/brief Shot brief for the event I'm shooting — phone friendly
|
||||||
|
/availability Blackout dates
|
||||||
|
/swaps My swap requests
|
||||||
|
/training Course library
|
||||||
|
/training/[course] Course detail + lesson list
|
||||||
|
/training/[course]/[lesson]
|
||||||
|
/announcements Team feed (rich text)
|
||||||
|
/run-sheet/[instanceId] What I need to know before I arrive
|
||||||
|
/profile Contact, phone, SMS consent, notification prefs, ICS token
|
||||||
|
/profile/skills My skills: comfort sliders per tech, verified levels, growth requests
|
||||||
|
/help Handbook pages (rich text)
|
||||||
|
|
||||||
|
/admin Dashboard
|
||||||
|
/admin/approvals Pending users
|
||||||
|
/admin/users Roster, roles, certifications, reliability
|
||||||
|
/admin/schedule THE grid (week builder)
|
||||||
|
/admin/services Services + role requirements + recurrence
|
||||||
|
/admin/skills Skills matrix: who can run what, at what level, gaps
|
||||||
|
/admin/catalog Define categories, companies, technologies, functions, positions, skills
|
||||||
|
/admin/growth Skill-up requests, mentor matching, shadow queue
|
||||||
|
/admin/events Event list: requests, coverage, deliverables due
|
||||||
|
/admin/events/[id] Event detail: positions, brief, assignees, status
|
||||||
|
/admin/mentors Mentor roster per skill, capacity, assessments due (tab of /admin/skills)
|
||||||
|
/admin/availability Who's out, month view
|
||||||
|
/admin/requests Swaps, declines needing attention
|
||||||
|
/admin/training Course authoring, lesson editor, progress reports
|
||||||
|
/admin/content Announcements, pages
|
||||||
|
/admin/notifications Log, templates, rules, test send
|
||||||
|
/admin/settings Church, timezone, scheduling rules, branding
|
||||||
|
/admin/audit Audit log
|
||||||
|
```
|
||||||
|
|
||||||
|
Navigation: mobile = 5-tab bottom bar (Home, Schedule, Away, Training, More). Desktop = left rail. Admin nav appears only for admins/coordinators.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Screens & acceptance criteria
|
||||||
|
|
||||||
|
Acceptance criteria are written as **Given / When / Then** where behaviour is non-obvious. "Admin" means Admin or scoped Coordinator unless stated.
|
||||||
|
|
||||||
|
### F1 — Auth, signup, approval
|
||||||
|
|
||||||
|
**Sign in.** `/login` — email field → magic link. No passwords in v1 (fewer support calls). Google sign-in as a secondary button if the church uses Google Workspace.
|
||||||
|
|
||||||
|
**Signup.** `/join` — name, email, phone (optional), which roles interest you, "how did you hear about us", SMS consent checkbox (unchecked by default). Creates `users.status = 'pending_approval'`.
|
||||||
|
|
||||||
|
- *Given* a submitted signup, *when* an admin opens `/admin/approvals`, *then* they see name, contact, roles of interest, and Approve / Deny with an optional note.
|
||||||
|
- *Given* approval, *then* the user gets an email with a sign-in link, status becomes `active`, and they appear in the roster with `trainee` certification on their chosen roles (see F11 gating).
|
||||||
|
- *Given* denial, *then* the applicant is emailed a courteous decline and cannot sign in.
|
||||||
|
|
||||||
|
**Rules**
|
||||||
|
- Invite emails expire in 14 days; resend available in the roster.
|
||||||
|
- Deactivated users are signed out at next request (session version check).
|
||||||
|
- Applicant sees only a "your application is being reviewed" screen.
|
||||||
|
|
||||||
|
### F2 — Profile & notification preferences
|
||||||
|
|
||||||
|
Fields: first/last name, email, phone (E.164 with a friendly formatter), avatar (optional), emergency contact, roles held (read-only), notification preferences.
|
||||||
|
|
||||||
|
- Email reminders: on/off (default on, cannot disable assignment-critical mail without an admin override — at minimum email is mandatory).
|
||||||
|
- SMS: **off until opted in.** Toggle shows the exact consent text and stores `sms_consent_at`, `sms_consent_source`, `sms_consent_ip`.
|
||||||
|
- Reminder lead time: 7 / 5 / 3 days (default 7).
|
||||||
|
- Quiet hours for SMS: default 21:00–08:00.
|
||||||
|
- ICS feed URL with copy button + "Reset link" (revokes old token).
|
||||||
|
- *Given* the phone number changes, *then* existing consent is invalidated and must be re-collected. (Compliance, not pedantry.)
|
||||||
|
|
||||||
|
### F3 — Services & role requirements
|
||||||
|
|
||||||
|
`/admin/services` — list of services with recurrence summary.
|
||||||
|
|
||||||
|
Create/edit form:
|
||||||
|
- Name ("Sunday 9:00 AM"), location ("Main Auditorium — Booth"), duration, doors-open offset.
|
||||||
|
- Recurrence: weekly / every other week / monthly (nth weekday), day, time, timezone (default church tz).
|
||||||
|
- **Roles required:** rows of `Role · Headcount · Minimum certification · Call-time offset`. Default Sunday service: Audio ×1 (qualified, −90 min), Livestream ×1 (qualified, −60 min), Slides ×1 (qualified, −45 min). Add row → instant headcount of 2 audio for Christmas.
|
||||||
|
- Active toggle; "Skip dates" list for a one-off cancellation (holiday Sunday).
|
||||||
|
- *Given* a recurrence change, *then* the system regenerates **future, unpublished** instances and leaves published ones alone, showing a confirmation: "12 future instances will be updated, 3 published weeks are untouched."
|
||||||
|
- *Given* a special service (Christmas Eve), *then* admin can "Add a one-off service" with its own roles/times.
|
||||||
|
|
||||||
|
### F4 — Blackout dates (volunteer)
|
||||||
|
|
||||||
|
`/availability` — calendar month view. Two ways to add:
|
||||||
|
1. **Date range:** pick start/end (tap-tap), reason dropdown (out of town / work / family / health / serving elsewhere / prefer not to say), optional note → Save.
|
||||||
|
2. **Recurring pattern:** "every other week", "1st Sunday of the month", "every Wednesday until March".
|
||||||
|
|
||||||
|
Rules and feedback:
|
||||||
|
- Overlapping a *confirmed* assignment shows an inline warning: "You're scheduled for Slides on Dec 7. Request a swap instead?" with a link — never a silent delete.
|
||||||
|
- Blackouts are visible to admins and coordinators; the *reason* is only visible to admins if the volunteer marks it private.
|
||||||
|
- Editing/deleting a blackout is always allowed until it conflicts with a confirmed assignment.
|
||||||
|
- *Given* a blackout is submitted, *then* within one second it is excluded from the assign picker and from auto-fill.
|
||||||
|
- Mobile: date-range selection must work with two taps and no scrolling to a Save button pinned below the fold — Save is a sticky bottom bar.
|
||||||
|
|
||||||
|
### F5 — The schedule grid (admin, the core screen)
|
||||||
|
|
||||||
|
`/admin/schedule?week=2027-01-10`
|
||||||
|
|
||||||
|
Layout: **rows = service instances** (Sun 9:00, Sun 11:00, plus special events that week), **columns = roles**, **cells = slot cards**. Right side: a collapsible roster panel with search, role filter, and availability badges ("Away Nov 21–28").
|
||||||
|
|
||||||
|
Slot card shows: volunteer avatar + name, cert badge, status pill (Proposed / Confirmed / Declined / Open), call time, and a warning icon if conflicted.
|
||||||
|
|
||||||
|
Behaviours:
|
||||||
|
- **Assign:** click empty slot → **availability-filtered, competency-ranked** picker. Each row shows readiness %, verified level per required technology, self-rated comfort, last served, and status (Away / Already serving / Needs refresher). Sort: Best match (default) · Most rested · Highest skill · Available only. Unavailable people stay in the list, greyed with "Away Nov 21–28". Every row has a **"Why this person?"** breakdown. (Full contract in F17.)
|
||||||
|
- **Drag & drop** from the roster panel; optimistic UI; rollback with a toast on rejection.
|
||||||
|
- **Conflict blocking** (hard): unavailable, unapproved, not certified, already in this service. **Conflict warning** (soft, override with note): over monthly cap, back-to-back services, trainee alone.
|
||||||
|
- **Auto-fill:** button per instance or per week → ghost suggestions with score tooltips → "Apply all" / accept individually. Never writes without a click.
|
||||||
|
- **Copy last week** and **copy this service's last 4 weeks** patterns.
|
||||||
|
- **Bulk:** select multiple slots → assign the same person, or clear.
|
||||||
|
- **Draft vs published:** the week is a draft until "Publish week". Publishing shows a summary modal: "6 assignments, 2 open slots, will send 4 emails and 2 texts now, plus 6 reminders on Friday." Requires a confirming click.
|
||||||
|
- *Given* an unpublished week, *then* volunteers see nothing for it.
|
||||||
|
- *Given* a published week, *then* editing an assignment asks: "Send an update to Brian and remove it from Sarah?" (default on).
|
||||||
|
- *Given* a slot is empty within 7 days of a published week, *then* the cell is red and the dashboard flags it.
|
||||||
|
- Keyboard: arrow keys move focus across the grid, `A` assigns, `Delete` clears, `Ctrl/Cmd+Z` undoes the last assignment in the session.
|
||||||
|
- Print/PDF: a clean "Booth Sheet" per week — date, service times, role, name, phone (admin only), call time.
|
||||||
|
|
||||||
|
### F6/F7 — Notifications
|
||||||
|
|
||||||
|
`/admin/notifications` — three tabs: **Log**, **Templates**, **Rules**.
|
||||||
|
|
||||||
|
**Log.** Table: when, recipient, channel, template, status (queued/sent/delivered/failed/suppressed), error, link to the assignment. Filters by channel/status/date. Row actions: retry, cancel. Top strip: last-24h counts, failure count in red, "Send a test to me".
|
||||||
|
|
||||||
|
**Templates.** Rich text editor for email bodies (subject + body), plain SMS composer with live character/segment count. Variable picker (click to insert). Preview with real data from a chosen assignment. *Given* an unknown variable, *then* saving fails with the exact token named.
|
||||||
|
|
||||||
|
**Rules.** Editable table from Architecture §6.2: event, offset days, time of day, channels, applies-to-service, on/off. **The Friday reminder is a rule row (`offset = -2`, 18:00, email + SMS), not code.** Admin can change it to Thursday without a developer.
|
||||||
|
|
||||||
|
Delivery guarantees:
|
||||||
|
- Idempotent: one send per `(rule, assignment, channel)` no matter how often cron runs.
|
||||||
|
- Declined/cancelled assignments never receive reminders (guard at send time).
|
||||||
|
- Failed SMS falls back to email and alerts the admin.
|
||||||
|
- Quiet hours queue SMS to 08:00 local.
|
||||||
|
- STOP → `sms_enabled = false` + audit row; the volunteer sees "You opted out of texts" in profile with a re-opt-in button.
|
||||||
|
|
||||||
|
Acceptance test (must pass before launch): create a Sunday service 3 days out, assign a volunteer, publish, run the cron worker → exactly one email arrives, containing correct name, role, date, call time, location, and a working confirm link; running the cron again sends nothing. (The SMS variant — one email + one SMS — is the later-phase test once Twilio/10DLC is live.)
|
||||||
|
|
||||||
|
### F8 — Confirm / decline without login
|
||||||
|
|
||||||
|
`/respond?t=…` — shows: "You're scheduled — Slides, Sunday Nov 22, 9:00 AM. Call time 8:15 AM. Main Auditorium booth. Serving with Brian (Audio), Sarah (Livestream)."
|
||||||
|
|
||||||
|
Buttons: **I'll be there** / **I can't make it** (reason dropdown: sick, out of town, work, family, other + note, and "find a swap for me").
|
||||||
|
|
||||||
|
- GET never mutates (link prefetch safe); the action is a POST.
|
||||||
|
- After confirming: add-to-calendar (`.ics` download) + "view my full schedule".
|
||||||
|
- After declining: slot returns to `open`, coordinators are notified within 60 seconds, and the declining volunteer sees "We've let the team know" plus an offer to suggest a replacement.
|
||||||
|
- Token expiry 14 days; expired → friendly page with a sign-in link and a "request a new link" button.
|
||||||
|
- SMS replies "YES"/"NO" also count (Twilio webhook → same state machine), with "YES" confirmation replied by SMS.
|
||||||
|
|
||||||
|
### F9 — Swaps
|
||||||
|
|
||||||
|
Volunteer opens an assignment → **Request a swap**: choose a specific person or "open to the team", add a reason, submit.
|
||||||
|
Coordinator queue shows requested-by, target, date, reason, and whether the target has accepted. Approve → assignment moves, both parties and the coordinator get email (+SMS for the new person), audit row written. Reject with a note → requester emailed.
|
||||||
|
*Given* a swap is pending, *then* the original volunteer remains responsible until approval — shown plainly in the UI so nobody assumes they're off the hook.
|
||||||
|
|
||||||
|
### F10 — Calendar
|
||||||
|
|
||||||
|
- `/api/calendar/{userId}/{token}.ics` — subscribable, works in Google/Apple/Outlook.
|
||||||
|
- Per-assignment `.ics` download from the confirm page and the schedule list.
|
||||||
|
- `SUMMARY`: `Slides — Sunday 9:00 AM`; `DTSTART`: call time; `DESCRIPTION`: location, other volunteers, run sheet URL.
|
||||||
|
- Copy button on profile/schedule: "Add this to Google Calendar" with three platform instructions (screenshot-free, text is enough).
|
||||||
|
|
||||||
|
### F11/F12 — Training & rich text
|
||||||
|
|
||||||
|
**Library** (`/training`): cards per course with cover image, role tag, lesson count, "Required for Audio" badge, and a progress ring. Filter: all / my roles / required / completed.
|
||||||
|
|
||||||
|
**Course page:** description (rich text), ordered lessons with duration and completion state, "Continue where you left off".
|
||||||
|
|
||||||
|
**Lesson viewer:** video embed at top (16:9, lazy-loaded, no autoplay), rich text body with headings, callouts, images, tables, task lists, downloadable PDFs, `@mentions`. Bottom: **Mark complete** (enabled after 30s dwell for text lessons, or 90% watched when video is present), Next lesson, and "Ask a question" linking to the team contact.
|
||||||
|
|
||||||
|
**Progress:** `lesson_progress` per user; course completion percentage; admin report `/admin/training/progress` — matrix of volunteer × course with last activity and completion date, exportable.
|
||||||
|
|
||||||
|
**Gating:**
|
||||||
|
- Course flag `required_for_role` + position flag `requires_certification` ⇒ completing the course **suggests** a comfort increase and opens a **mentor assessment task**; it does not auto-certify. Eligibility for solo slots comes from `verified_level` (see F17).
|
||||||
|
- Admin override is allowed with a mandatory reason, written to audit, and the slot shows a ⚠ "unqualified (override)" badge.
|
||||||
|
- Trainees can be placed in `is_trainee_slot` slots regardless — shadowing is the point.
|
||||||
|
|
||||||
|
**Authoring** (`/admin/training`):
|
||||||
|
- Course create/edit: title, slug, summary, cover image, role, "required for role", published.
|
||||||
|
- Lesson editor: split-pane TipTap + preview, drag-reorder, video URL or upload, duration, draft/publish, revision history with restore.
|
||||||
|
- Toolbar (kept short on purpose): paragraph/heading, **bold** *italic*, bullet/numbered list, checklist, quote, code, link, image, table, callout, video, mention, undo/redo.
|
||||||
|
- Paste from Google Docs/Word must not wreck the layout (schema normalization), and pasting an image must offer upload rather than embedding base64.
|
||||||
|
- Autosave every 20s with "saved" indicator; explicit Publish.
|
||||||
|
|
||||||
|
**Announcements** (`/admin/content`): rich text post, pin, target audience (all / role / leaders), optional expiry, optional "also email this" (renders the same content through the email component). Feed appears at `/announcements` and as a card on volunteer home.
|
||||||
|
|
||||||
|
**Run sheets** (`/admin/schedule` → instance → run sheet): rich text with cue table (time, element, owner, notes), song keys, special elements ("baptism — extra wireless mic"), and a "watch out" callout. Read-only view at `/run-sheet/[id]`, printable, linked from the Friday email.
|
||||||
|
|
||||||
|
### F13/F14 — Admin dashboard
|
||||||
|
|
||||||
|
`/admin` cards:
|
||||||
|
1. **This Sunday** — coverage bar per role with names, or a red "2 slots open" with a Schedule button.
|
||||||
|
2. **Next 4 weeks** — coverage %, unconfirmed count, open slots.
|
||||||
|
3. **Action needed** — pending approvals (n), swap requests (n), unconfirmed > 48h (n), notification failures (n).
|
||||||
|
4. **Notification health** — last 24h sent/failed, cron heartbeat age, "test send".
|
||||||
|
5. **Training** — who's mid-course, who's blocked from scheduling for missing training.
|
||||||
|
6. **Quick actions** — publish this week, invite a volunteer, add a one-off service.
|
||||||
|
|
||||||
|
### F15 — Roster, audit, exports
|
||||||
|
|
||||||
|
`/admin/users`: searchable table — name, roles + cert level, status, last served, upcoming count, reliability %, actions (edit, grant role, resend invite, deactivate). Row expands to a profile panel with serving history, blackouts, training progress, and notes (rich text, admin-only).
|
||||||
|
|
||||||
|
`/admin/audit`: filterable by actor/action/date; before/after diff on assignment and user changes; export CSV.
|
||||||
|
|
||||||
|
#### Exports — PDF, XLSX, CSV
|
||||||
|
|
||||||
|
Every list an admin can see, an admin can get out of the system in all three formats. This is not a nice-to-have: the printed booth sheet is how the desk works on Sunday, the workbook is how leadership reviews numbers, and CSV is the escape hatch that makes the data *yours*.
|
||||||
|
|
||||||
|
**Format policy** (one canonical dataset, three renderers — never three separate queries):
|
||||||
|
|
||||||
|
| Format | Use it for | Renderer |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| **PDF** | Printed booth sheet, weekly coverage pack, monthly leadership report, lesson handouts | `@react-pdf/renderer` server-side; print stylesheet for on-screen "Print" |
|
||||||
|
| **XLSX** | Working spreadsheets: filter, sort, pivot, add a column | ExcelJS, one workbook with typed cells and filters |
|
||||||
|
| **CSV** | Import elsewhere (Planning Center, Google Sheets, Mailchimp), scripts, archives | RFC 4180 writer, UTF-8 with BOM |
|
||||||
|
|
||||||
|
**Datasets × formats**
|
||||||
|
|
||||||
|
| Dataset | CSV | XLSX | PDF | Notes |
|
||||||
|
| --- | :--: | :--: | :--: | --- |
|
||||||
|
| Booth sheet (one service or one week) | ✅ | ✅ | ✅ | PDF is the primary; 1 page per service, large type |
|
||||||
|
| Schedule (date range) | ✅ | ✅ | ✅ | Range capped at 90 days / 25k rows |
|
||||||
|
| Roster & certifications | ✅ | ✅ | ✅ | Phone columns are opt-in per export |
|
||||||
|
| Availability / blackouts | ✅ | ✅ | ✅ | Reason text excluded unless admin ticks "include notes" |
|
||||||
|
| Training progress matrix | ✅ | ✅ | ✅ | Volunteer × course grid, completion dates |
|
||||||
|
| Serving history / hours | ✅ | ✅ | ✅ | Feeds the annual leadership report |
|
||||||
|
| Notification log | ✅ | ✅ | ✅ | 90-day window, masked recipients by default |
|
||||||
|
| Audit log | ✅ | ✅ | — | PDF omitted; it is inherently a spreadsheet |
|
||||||
|
|
||||||
|
**Where the export button lives** — on the screen it belongs to, in the page header as `Export ▾`:
|
||||||
|
|
||||||
|
- `/admin/schedule` → **Booth sheet (PDF)** · Week workbook (XLSX) · CSV
|
||||||
|
- `/admin/users` → roster (all three)
|
||||||
|
- `/admin/availability` → blackout list (all three)
|
||||||
|
- `/admin/training/progress` → progress matrix (all three)
|
||||||
|
- `/admin/audit`, `/admin/notifications` → CSV + XLSX only
|
||||||
|
|
||||||
|
**Export dialog** (one component, reused):
|
||||||
|
1. Header: "Export — Schedule, Jan 4 – Feb 8, 2027" with a live row count.
|
||||||
|
2. Format: three buttons, XLSX default for tables, **PDF default for the booth sheet**.
|
||||||
|
3. Options (checkboxes, remembered per user): include phone numbers · include notes/reasons · one row per slot vs. one row per person · include cancelled services.
|
||||||
|
4. Primary action: **Export**. Under 5,000 rows it downloads in place ("Preparing…" spinner, no modal block). Over that: "We'll email you a link when it's ready" and the job appears in a small *Recent exports* list.
|
||||||
|
5. Footer: the exact filters being applied, so the file is self-describing.
|
||||||
|
|
||||||
|
**Format rules**
|
||||||
|
|
||||||
|
*CSV*
|
||||||
|
- RFC 4180: quote fields containing `,` `"` or newlines; escape `"` as `""`; CRLF line endings.
|
||||||
|
- UTF-8 **with BOM**, so Excel on Windows doesn't mangle names with accents.
|
||||||
|
- **Formula-injection guard:** any field starting with `=`, `+`, `-`, `@`, tab or CR is prefixed with `'`. A volunteer named `=HYPERLINK(...)` must not become a live formula in the director's spreadsheet.
|
||||||
|
- Header row always present; dates ISO 8601; one dataset per file (no multi-table CSV).
|
||||||
|
|
||||||
|
*XLSX*
|
||||||
|
- One sheet per logical table (e.g. `Schedule`, `Volunteers`, `Roles`), plus a leading **Read me** sheet: what was exported, filters, timestamp, who generated it, row counts.
|
||||||
|
- Frozen header row, autofilter on every sheet, sensible column widths, real date cells (not strings), wrapped notes columns.
|
||||||
|
- No macros, no external links, no hidden sheets. `.xlsx` only — never `.xls`.
|
||||||
|
- Totals where they're meaningful: assignments per volunteer, coverage % per week.
|
||||||
|
|
||||||
|
*PDF*
|
||||||
|
- US Letter, 0.5" margins, church logo + name in the header, `Generated 2027-01-06 14:32 by Brian S.` and page `3 of 7` in the footer.
|
||||||
|
- Tables paginate with **repeated header rows**; nothing splits mid-row.
|
||||||
|
- Print-safe palette (no pale grey on white), minimum 9pt body, 11pt+ for the booth sheet.
|
||||||
|
- Booth sheet variant: one service per page, call times, role → name → phone (admin only), run sheet link as a short URL, and a blank "notes" strip. Designed to be taped to the desk.
|
||||||
|
|
||||||
|
**Acceptance criteria**
|
||||||
|
|
||||||
|
- *Given* a published week, *when* the admin clicks Export → Booth sheet (PDF), *then* a single-page PDF per service downloads within 3 seconds, names and call times match the grid exactly, and no phone numbers appear unless the viewer is an admin.
|
||||||
|
- *Given* the roster export with 140 volunteers, *when* opened in Excel and Google Sheets, *then* accent-bearing names render correctly, dates sort as dates, and the header row is frozen and filterable.
|
||||||
|
- *Given* a volunteer whose name begins with `=`, *when* the CSV is opened in Excel, *then* it displays as text and no formula evaluates.
|
||||||
|
- *Given* a coordinator scoped to Audio, *when* they export, *then* only Audio rows are included (enforced server-side, not by the UI).
|
||||||
|
- *Given* any export, *then* an `export.generated` audit row records dataset, format, filters, row count and requester — and the file expires in 7 days.
|
||||||
|
- *Given* an export request over 25,000 rows or 90 days, *then* the dialog blocks it with a plain-language explanation and suggests narrowing the range.
|
||||||
|
|
||||||
|
### F16 — AI (phase 4, optional but specified)
|
||||||
|
|
||||||
|
- **Ask the schedule:** a search box on `/admin/schedule` — "who can do audio Dec 7?" returns a table of eligible people with reasons, and a link to assign. Read-only tools only.
|
||||||
|
- **Draft copy:** in the announcement/reminder editor, "Draft with AI" with tone selector (warm / brief / urgent). Output lands in the editor as editable rich text.
|
||||||
|
- **Explain auto-fill:** "Why this person?" popover explaining the score.
|
||||||
|
- Every AI surface is labelled "AI draft — review before sending", logs to `ai_runs`, and vanishes if the feature flag is off.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### F17 — Skills, competency, mentoring & growth
|
||||||
|
|
||||||
|
This is the heart of "who can I actually schedule". A volunteer is not one thing: someone can be 90% on ProPresenter, 65% on the FOH console and 20% on the stream encoder. The system models **skills per technology**, lets people self-rate comfort, separates that from an **admin/mentor-verified level**, and uses both — plus availability — to rank who the admin can pick.
|
||||||
|
|
||||||
|
#### Levels
|
||||||
|
|
||||||
|
| Level | Comfort band | Meaning | Solo | Mentors |
|
||||||
|
| --- | --- | --- | :--: | :--: |
|
||||||
|
| `none` | 0–24 | Never touched it | — | — |
|
||||||
|
| `observer` | 25–49 | Watched someone run it | — | — |
|
||||||
|
| `assisted` | 50–74 | Can run it with someone nearby | pair only | — |
|
||||||
|
| `qualified` | 75–89 | Runs it start to finish alone | ✅ | — |
|
||||||
|
| `expert` | 90–100 | Runs it alone and can teach it | ✅ | ✅ |
|
||||||
|
|
||||||
|
Two numbers per skill, and the UI always shows both:
|
||||||
|
|
||||||
|
- **Self comfort (0–100%)** — what the volunteer says. Feeds ranking and warnings.
|
||||||
|
- **Verified level** — what a mentor or admin has signed off after seeing them serve. **This is the gate.**
|
||||||
|
|
||||||
|
Neither alone is trustworthy: self-report inflates and deflates, and a one-time sign-off goes stale.
|
||||||
|
|
||||||
|
#### Volunteer screen — `/profile/skills`
|
||||||
|
|
||||||
|
A card per technology (FOH console, wireless mics, ProPresenter, OBS encoder, cameras, lighting board), each showing:
|
||||||
|
|
||||||
|
- A **comfort slider 0–100** with anchor labels, not a bare number: *0 = never touched it · 50 = I can run it with someone beside me · 75 = I can run it alone start to finish · 100 = I can teach someone else.* Anchors are what make percentages mean the same thing to everyone.
|
||||||
|
- The verified level chip (**"Qualified — verified by Marcus, Apr 12"**) and, where they differ, a gentle line: *"You rate yourself 40% but you're verified qualified. Bump it if you're comfortable."*
|
||||||
|
- **Last served** and a **Needs refresher** badge when stale.
|
||||||
|
- An optional note for the admin: *"I'd rather not run the board alone yet."*
|
||||||
|
- **"I want to learn this"** → creates a growth request with a target level (default `qualified`) and optional target date.
|
||||||
|
- **Mentor opt-in** appears once a skill reaches expert: *"Willing to train others on Slides?"*
|
||||||
|
|
||||||
|
*Given* a volunteer sets comfort and nothing else, *then* their verified level is unchanged and they are still ranked below verified people — comfort never silently certifies anyone.
|
||||||
|
|
||||||
|
#### Admin screen — `/admin/skills`
|
||||||
|
|
||||||
|
A matrix: rows = volunteers, columns = skills, cells = level chip + comfort dot (`90` / `75` / `50` / `25`).
|
||||||
|
|
||||||
|
- Filter by skill, level, category, or "everyone who can run Audio alone".
|
||||||
|
- **Gap analysis panel:** *"Livestream: 1 expert, 2 qualified — single point of failure if Marcus is away."* and *"No mentor for Cameras."*
|
||||||
|
- **Coverage-by-skill view:** for any future Sunday, who is available, who is away, who is already serving.
|
||||||
|
- Cell click → that person's skill detail: assessment history, last served, notes, and buttons **Verify level**, **Assign as mentor**, **Set growth goal**.
|
||||||
|
- Verify level is a modal that requires a short note and writes a `skill_assessments` row — no silent edits, ever.
|
||||||
|
- Export as XLSX/CSV/PDF through the existing export engine (F15).
|
||||||
|
|
||||||
|
#### Admin screen — `/admin/growth`
|
||||||
|
|
||||||
|
- Requests sorted by wait time: volunteer, target skill, current level, requested date.
|
||||||
|
- **Mentor suggestion:** up to 3 mentors for that skill, ranked by availability overlap with the volunteer and current shadow load. *"Recommend Marcus — both free 3 of the next 4 Sundays, 0 shadows in progress."*
|
||||||
|
- Assign mentor → goal moves to `mentor_assigned`, both are notified.
|
||||||
|
- **Shadow queue:** suggested pairings (growth volunteer + mentor + service where both are free and the position is staffed). One click creates a shadow slot paired to the mentor's slot.
|
||||||
|
- Progress column: shadows completed, last assessment, mentor's latest note.
|
||||||
|
- **Sign off** → level change + assessment row + the volunteer gets a congratulatory email and becomes eligible for solo slots.
|
||||||
|
- Requests with no available mentor are flagged plainly: *"No mentor for Lighting — needs training-only path."*
|
||||||
|
|
||||||
|
#### Scheduling integration (what the admin actually experiences)
|
||||||
|
|
||||||
|
Opening an empty Audio slot on a Sunday:
|
||||||
|
|
||||||
|
```
|
||||||
|
Best match Sort: Best match ▾
|
||||||
|
──────────────────────────────────────────────────────────────────────────────────
|
||||||
|
● Marcus Hale Readiness 96% FOH expert · Mics expert Comfort 95% mentor
|
||||||
|
● Sarah Kim Readiness 88% FOH qualified · Mics assisted Comfort 80%
|
||||||
|
● Jordan Ellis Readiness 71% FOH assisted · Mics qualified Comfort 65% ⚠ wants to learn
|
||||||
|
○ Dana Ruiz AWAY Nov 21–28 — view blackouts
|
||||||
|
○ Chris Okafor Already serving 11:00 — see roster
|
||||||
|
```
|
||||||
|
|
||||||
|
- Ranked by availability → core-skill gate → fairness + competency blend.
|
||||||
|
- Hover any row for **"Why this person?"**: *"Fairness 62 (5 of 9 Sundays), competency 88 (qualified, verified Apr 12), confirmed 100% of 6 assignments, hasn't served audio in 24 days."*
|
||||||
|
- Picking a row below the position's `required_level` blocks with a clear message and offers **"Pair with Marcus (mentor)"** or **"Override with reason"** (audited, and the slot is labelled *unqualified — override*).
|
||||||
|
- If a growth volunteer is picked as a shadow, the mentor is required in the same instance — the UI refuses to save a lone shadow.
|
||||||
|
|
||||||
|
#### Acceptance criteria
|
||||||
|
|
||||||
|
- *Given* a volunteer with `qualified` on Slides and `observer` on Audio, *when* the admin opens an Audio slot, *then* they rank below qualified audio people, and assigning them requires a mentor pair or an audited override.
|
||||||
|
- *Given* a volunteer is away on the date, *then* they appear greyed with their blackout range and cannot be assigned.
|
||||||
|
- *Given* five people are eligible, *then* the list is ordered by the readiness score and every row exposes its breakdown — no unexplainable ordering.
|
||||||
|
- *Given* a volunteer requests to learn Livestream, *then* an admin sees it in `/admin/growth` with suggested mentors, and pairing them creates a shadow slot that does not count toward coverage.
|
||||||
|
- *Given* a shadow slot exists, *then* it cannot be saved without a `mentor_ready` person on the same skill in the same service.
|
||||||
|
- *Given* a mentor marks the trainee `qualified` after the service, *then* the level updates immediately, the volunteer can be scheduled solo next week, and an assessment row records who signed off and when.
|
||||||
|
- *Given* a skill untouched for 120 days, *then* the volunteer shows **Needs refresher**, ranks lower, is not blocked, and receives a refresher suggestion.
|
||||||
|
- *Given* an admin tries to change a level directly, *then* they must enter a note and the change is written to both `skill_assessments` and `audit_log`.
|
||||||
|
|
||||||
|
### F19 — Configurable catalog (nothing hardcoded)
|
||||||
|
|
||||||
|
The church will buy a new switcher, rename "Slides" to "Graphics", add a lighting desk, and hire a volunteer who only runs cameras. None of that should require a developer. **Every taxonomy list below is data an admin edits in the app.**
|
||||||
|
|
||||||
|
#### The ontology — five lists and one composition
|
||||||
|
|
||||||
|
| List | What it is | Example rows | Used by |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| **Categories** | domains | Audio · Video · Slides · Lighting · Networking | grouping, matrix columns, chips |
|
||||||
|
| **Companies** (vendors) | who makes the gear | Blackmagic Design · Renewed Vision · Roland · Shure | technology records, support lookup |
|
||||||
|
| **Technologies** (products) | a specific tool | ATEM Mini Pro · ProPresenter 7 · V-1HD · QL5 | skills, gear notes, lessons |
|
||||||
|
| **Functions** | an operation a person performs | Camera switching · Lyric playback · Gain staging · Stream encoding | skill composition |
|
||||||
|
| **Positions** | a schedulable seat on a service | Audio · Livestream · Slides · Lighting | slots, requirements |
|
||||||
|
| **Skills** | *composed*: function × technology (either may be generic) | "Switch cameras on ATEM Mini Pro" · "Run FOH audio (any console)" | volunteer ratings, mentors, growth |
|
||||||
|
|
||||||
|
The sentence to keep straight: a **position** is a seat, a **function** is an operation, a **technology** is the tool, and a **skill** is the rated ability to perform a function on that tool.
|
||||||
|
|
||||||
|
#### Screen — `/admin/catalog`
|
||||||
|
|
||||||
|
Six tabs, one shared table pattern: search, "show inactive", usage count (`12 volunteers · 2 positions`), drag to reorder, and a row menu of **Edit · Deactivate · Merge**. No Delete button exists anywhere in this screen.
|
||||||
|
|
||||||
|
1. **Categories** — name, colour, icon, order.
|
||||||
|
2. **Companies** — name, support URL, support phone, notes. *("Who do we call when the board dies at 8:40?" answered in the app.)*
|
||||||
|
3. **Technologies** — company + category + product name + model/version + docs URL + optional purchase date and serial + **Replaced by** (points at the successor).
|
||||||
|
4. **Functions** — name, category, one-line description.
|
||||||
|
5. **Positions** — name, colour, call-time offset, "requires certification" toggle, and the **requirements editor**: rows of `Skill · weight 1–5 · required level · core?`. Validation: at least one core skill or the position cannot be published (rule 23).
|
||||||
|
6. **Skills** — the composer. Pick category (required) → technology (optional) → function (optional); the name is **prefilled** ("Switch cameras on ATEM Mini Pro") and then editable. Plus description of what "qualified" means, mentor minimum level, staleness threshold, and a "gear changed — recertify holders" toggle.
|
||||||
|
|
||||||
|
Leaving technology blank creates a technology-agnostic skill ("Run FOH audio"), which is what most churches actually need — the volunteer knows *audio*, not the specific console model.
|
||||||
|
|
||||||
|
#### Bulk operations
|
||||||
|
|
||||||
|
- **CSV import** with a downloadable template and a **dry run**: row-level errors shown before anything is committed; a bad file commits nothing.
|
||||||
|
- **CSV/XLSX/PDF export** of each list through the existing export engine (F15).
|
||||||
|
- **Merge** (the one that saves you): pick two duplicate skills → preview affected counts → confirm. All ratings, assessments, growth goals, position mappings and equivalencies repoint to the survivor in one transaction, keeping each volunteer's **highest** verified level. Audit row records the merge.
|
||||||
|
|
||||||
|
#### Empty and first-run states
|
||||||
|
|
||||||
|
A fresh install shows a guided setup, not a blank screen: *"Start from the starter library (3 positions, 7 technologies, 12 skills — all editable)"* or *"Define your own."* The starter library is a JSON seed, never code; after load it is indistinguishable from admin-created data.
|
||||||
|
|
||||||
|
#### Acceptance criteria
|
||||||
|
|
||||||
|
- *Given* an admin adds company "Resolume", technology "Arena", and skill "VJ playback on Resolume Arena", *then* the skill appears in the matrix and can be attached to a position — **with no deploy, no code change, and no restart**.
|
||||||
|
- *Given* a skill is required by a position, *when* an admin tries to deactivate it, *then* saving is blocked with the exact positions listed and a **Replace with…** action.
|
||||||
|
- *Given* two duplicate skills, *when* merged, *then* every rating, assessment and growth goal points at the survivor, each volunteer keeps their highest level, and one audit row records the merge.
|
||||||
|
- *Given* a position with no core skill, *when* an admin publishes a week, *then* publishing is blocked with "Audio has no core skill requirement — anyone could be assigned."
|
||||||
|
- *Given* a CSV import with 3 invalid rows, *then* nothing is written and each bad row is reported by line number and reason.
|
||||||
|
- *Given* a technology is retired, *then* positions using it show a warning with a one-click **replace with successor**, and existing assignments are flagged for review rather than invalidated.
|
||||||
|
- *Given* an admin renames the position "Slides" to "Graphics", *then* the grid, notifications, exports and history all show the new name with no broken links (slugs are frozen).
|
||||||
|
- *Given* a volunteer opens `/profile/skills` after a catalog change, *then* the new items appear without a reload or a stale cache.
|
||||||
|
|
||||||
|
### F20 — Events & photography assignment
|
||||||
|
|
||||||
|
Weekly services repeat. A wedding, baptism, youth night, outreach or Christmas production does not: it has a requester, a shot brief, a deliverable deadline and often two shooters. Events are a **second scheduling axis** on the same engine — separate screens, identical availability, skill, reminder, confirm and audit machinery.
|
||||||
|
|
||||||
|
The key design decision: **photography is a position, not a separate app.** `Photographer`, `Second Shooter` and `Videographer` live in the normal positions catalog, under a `Photography` category, with cameras, lenses and flash as technologies. So a photographer has a comfort %, a verified level, a mentor and a growth path exactly like an audio volunteer.
|
||||||
|
|
||||||
|
#### Event request → coverage
|
||||||
|
|
||||||
|
1. A ministry leader submits a request (public `/request-event` form or an admin creates it): title, type, date/time, location, what's happening, what they want photographed, who to coordinate with.
|
||||||
|
2. Admin creates the event, picks the type (which prefills positions), sets headcount and minimum level, writes or pastes the **shot brief** in the rich text editor.
|
||||||
|
3. Admin assigns from the same picker — availability first, then photography skill, then fairness. Overlapping events are a hard conflict.
|
||||||
|
4. Publish → assignees get email + SMS immediately; a T-2 day reminder follows, and a T-7/T-3 alert fires if any position is still open.
|
||||||
|
5. Photographer opens the brief on their phone: shot list, who's who, location, call time, gear note, "what not to miss", and a contact number.
|
||||||
|
6. After the event: `covered` → `uploaded` → `editing` → `delivered`, with the requester able to rate the coverage.
|
||||||
|
|
||||||
|
#### Screens
|
||||||
|
|
||||||
|
**`/admin/events`** — filterable list: upcoming, needs coverage, delivered. Each row shows date, type, positions filled (`2/2`), brief status, and a red flag when a past event is still `covered` with no upload.
|
||||||
|
|
||||||
|
**`/admin/events/[id]`** — details, positions with assignee avatars, brief editor, status stepper, and a "remind photographers" action. Buttons to duplicate last year's event.
|
||||||
|
|
||||||
|
**`/events/[id]/brief`** — read-only, mobile-first, printable. Large type, the shot list as a checklist, a map link, and a tap-to-call coordinator. This page is what the photographer actually reads in the parking lot, so it gets designed, not dashed off.
|
||||||
|
|
||||||
|
**`/events`** — volunteer view of their event assignments, with confirm/decline and add-to-calendar.
|
||||||
|
|
||||||
|
#### Acceptance criteria
|
||||||
|
|
||||||
|
- *Given* an event with a Photographer position, *when* the admin opens the picker, *then* candidates are filtered by availability and ranked by photography skill, with non-photographers shown as unqualified.
|
||||||
|
- *Given* two events whose times overlap, *then* assigning the same person to both is blocked with the conflicting event named.
|
||||||
|
- *Given* an event is published, *then* the photographer gets email + SMS with the date, call time, and a link to the brief — no login required.
|
||||||
|
- *Given* an event with no assignee 7 days out, *then* admins get an `event.unfilled` alert exactly like an open service slot.
|
||||||
|
- *Given* an event in the past with status `covered` for 3 days, *then* the dashboard flags it as an incomplete deliverable and the photographer gets a reminder.
|
||||||
|
- *Given* a volunteer is away on the event date, *then* they are excluded from the picker and shown greyed with their blackout range.
|
||||||
|
- *Given* an event has `media_release_required`, *then* the event shows a release warning on the brief and, once the library exists, gallery publishing is blocked until an admin confirms consent.
|
||||||
|
|
||||||
|
### F21 — Event media library & RAW delivery (phase 2 — spec now, build later)
|
||||||
|
|
||||||
|
**Not in v1.** It is specified here because the storage and permission decisions affect the event model, and because "download the RAW files" is a much bigger promise than it sounds.
|
||||||
|
|
||||||
|
#### What the photographer does
|
||||||
|
1. Upload originals to the event from a phone or laptop; the upload is **resumable** and survives a dropped connection.
|
||||||
|
2. Duplicates are detected by checksum — re-uploading is a friendly no-op, not a second copy.
|
||||||
|
3. Optionally attach JPEG proxies exported from Lightroom/Capture One so the gallery has previews (browsers cannot render CR3/NEF/ARW).
|
||||||
|
|
||||||
|
#### What the editor does
|
||||||
|
4. Browse the event gallery with previews, mark `selected` / `rejected`.
|
||||||
|
5. Download the originals they need — **individually or as a filtered selection, plus a manifest CSV**. A 60 GB "download everything" ZIP is deliberately not offered.
|
||||||
|
6. Re-upload edited finals, which are marked `edited` and kept permanently.
|
||||||
|
|
||||||
|
#### Hard requirements before this phase starts
|
||||||
|
|
||||||
|
| Requirement | Why |
|
||||||
|
| --- | --- |
|
||||||
|
| A written retention policy (default: originals deleted after 90 days) | Otherwise storage grows forever and nobody decides |
|
||||||
|
| `media.raw_download` as a named permission, audited per file | RAW originals are not for every volunteer |
|
||||||
|
| A consent/release rule for photos of minors | Blocks publishing until an admin confirms |
|
||||||
|
| Photographers habitually exporting JPEG proxies | Avoids building a server-side RAW decoder |
|
||||||
|
| A storage budget agreed with the church | ~$12/month at 20 events/year; needs a yes |
|
||||||
|
|
||||||
|
#### Acceptance criteria for that phase
|
||||||
|
|
||||||
|
- *Given* a 40 GB batch on unstable wifi, *when* the connection drops at 60%, *then* resume continues from the last completed part and no partial file is visible in the gallery.
|
||||||
|
- *Given* the same file is uploaded twice, *then* one record exists and the second attempt reports "already uploaded".
|
||||||
|
- *Given* a volunteer without `media.raw_download` requests an original, *then* the request is refused server-side and no URL is issued.
|
||||||
|
- *Given* any RAW download, *then* a `media_downloads` row records user, file, purpose and time.
|
||||||
|
- *Given* an event with `media_release_required` and no confirmed consent, *then* publishing the gallery is blocked with the reason shown.
|
||||||
|
- *Given* an original past its retention date, *then* the object is deleted, the row remains for audit, and edited finals are untouched.
|
||||||
|
- *Given* an event with 900 images, *then* the gallery loads in under 3 seconds by paginating and serving proxies, never originals.
|
||||||
|
|
||||||
|
## 6. Notification content (exact copy to start from)
|
||||||
|
|
||||||
|
> **Launch scope:** email-only. The SMS copies below are kept for the later phase (E5) and need no rework to activate.
|
||||||
|
|
||||||
|
**Email subject:** `You're serving this Sunday — Slides, 9:00 AM`
|
||||||
|
|
||||||
|
**Email body (rich text, mobile-first):**
|
||||||
|
|
||||||
|
> Hi Brian,
|
||||||
|
>
|
||||||
|
> You're scheduled for **Slides** at **Sunday 9:00 AM** on **November 22**.
|
||||||
|
> **Call time: 8:15 AM** · Main Auditorium — Booth
|
||||||
|
>
|
||||||
|
> Serving with you: Brian (Audio), Sarah (Livestream).
|
||||||
|
>
|
||||||
|
> [I'll be there] [I can't make it]
|
||||||
|
>
|
||||||
|
> Before you arrive: [Open the run sheet] · [Add to calendar]
|
||||||
|
> Questions? Reply to this email or text your team lead at (555) 123-4567.
|
||||||
|
>
|
||||||
|
> — Media Team, Grace Church
|
||||||
|
|
||||||
|
**SMS (Friday, 18:00 local):**
|
||||||
|
`Grace Church Media: Brian, you're on SLIDES this Sun Nov 22, 9:00 AM. Call time 8:15 AM, Main Auditorium booth. Confirm: https://…/r/abc123 Reply STOP to opt out.`
|
||||||
|
|
||||||
|
**Day-of SMS (06:30 local):** `Good morning Brian — you're on SLIDES today at 9:00 AM (call 8:15). Run sheet: https://… Reply STOP to opt out.`
|
||||||
|
|
||||||
|
**Unfilled slot (to coordinators):** `2 open slots this Sunday: Slides 9:00, Audio 11:00. Fill: https://…/admin/schedule?week=…`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Business rules (single source of truth)
|
||||||
|
|
||||||
|
1. A volunteer cannot hold two active assignments in the same service instance.
|
||||||
|
2. One active assignment per slot (DB-enforced).
|
||||||
|
3. Only published weeks are visible to volunteers.
|
||||||
|
4. Confirmed assignments block deletion — they must be unassigned or swapped, both of which notify.
|
||||||
|
5. Blackouts never auto-unassign; they generate a conflict the admin resolves.
|
||||||
|
6. Trainee-level certification cannot fill a slot requiring `qualified` unless it is a trainee slot or an audited override.
|
||||||
|
7. Monthly cap default 3 services per volunteer (configurable per user).
|
||||||
|
8. Reminders are computed from the **instance start**, never from publish time.
|
||||||
|
9. A declined assignment returns the slot to `open` immediately and alerts coordinators.
|
||||||
|
10. Publishing is idempotent: re-publishing sends only deltas.
|
||||||
|
11. All times display in the viewer's timezone; all scheduling math uses the church timezone.
|
||||||
|
12. Every admin mutation writes an audit row.
|
||||||
|
13. A **core** skill verified below a position's `required_level` blocks solo assignment; the only escapes are a paired mentor or an audited override.
|
||||||
|
14. `self_comfort` never blocks an assignment. It lowers rank and raises a warning the admin must see.
|
||||||
|
15. A mentor is **per skill**, requires `verified_level >= skill.mentor_min_level`, an explicit opt-in, and admin approval. Expertise alone does not make someone a mentor.
|
||||||
|
16. A shadow slot is invalid without a `mentor_ready` person on that skill in the same service instance, and never counts toward coverage.
|
||||||
|
17. Levels change only through `skill_assessments` rows — no direct edits, including by admins.
|
||||||
|
18. `last_served_on` per skill is system-maintained from completed assignments, never typed in.
|
||||||
|
19. A volunteer may hold many skills at different levels, but only one active growth goal per skill.
|
||||||
|
20. Categories, companies, technologies, functions, positions and skills are **admin-defined rows**. No such name appears in application code outside the seed file.
|
||||||
|
21. Nothing in the catalog is deleted. Deactivate only; every reference and every assessment survives.
|
||||||
|
22. Slugs freeze after creation because they appear in URLs, calendar feeds and notification links. Display names stay editable.
|
||||||
|
23. A position requires at least one core skill to be publishable.
|
||||||
|
24. Duplicates are removed by **merge**, never by delete, and a merge repoints all references in one transaction.
|
||||||
|
25. Events are separate rows from recurring services and never consume a weekly service slot.
|
||||||
|
26. A slot belongs to exactly one of a service instance or an event (DB CHECK constraint).
|
||||||
|
27. Event assignments use the same availability, skill gating, confirm/decline and notification pipeline as services — no parallel path.
|
||||||
|
28. A volunteer cannot be assigned to two events whose times overlap.
|
||||||
|
29. RAW originals are downloadable only with `media.raw_download`, and every download is audited.
|
||||||
|
30. An upload requires a stored photographer usage-licence acknowledgement before files are accepted.
|
||||||
|
31. Original media expires per policy; edited finals do not.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. Validation & edge cases
|
||||||
|
|
||||||
|
| Case | Expected behaviour |
|
||||||
|
| --- | --- |
|
||||||
|
| DST spring-forward Sunday | 9:00 AM local stays 9:00 AM; stored UTC differs by an hour; reminder lands Friday 18:00 local |
|
||||||
|
| Volunteer declines 2 hours before service | Slot goes red, coordinators get SMS immediately, dashboard shows "at risk" |
|
||||||
|
| Volunteer has no phone | Email only; UI says "Add a phone to get texts" |
|
||||||
|
| Phone number invalid | Inline validation with country hint; cannot save |
|
||||||
|
| Two admins edit the same slot | Last write wins with a warning toast; audit records both |
|
||||||
|
| Volunteer submits a blackout for a date they're confirmed | Warning + swap offer, blackout still recorded |
|
||||||
|
| Service cancelled (weather) | Instance `cancelled` → pending reminders cancelled, volunteers emailed |
|
||||||
|
| Admin deletes a service | Soft-delete; future unpublished instances removed; published weeks untouched and flagged |
|
||||||
|
| Email bounces | Status `bounced`, user flagged in roster, dashboard prompts to fix contact |
|
||||||
|
| SMS STOP received | Channel disabled, audit row, volunteer sees it and can re-opt-in |
|
||||||
|
| Cron fails for 24h | Dashboard banner; a manual "send queued now" button exists |
|
||||||
|
| Very long lesson with 12 videos | Lazy-loaded embeds, page budget enforced |
|
||||||
|
| Volunteer pastes 4 MB image into editor | Rejected with "max 10 MB, will be compressed" and compression applied |
|
||||||
|
| Export requested for 2 years of history | Blocked with the 90-day / 25k-row limit and a suggested range |
|
||||||
|
| Name contains commas, quotes, emoji or `=` | CSV stays valid, XLSX keeps the text intact, PDF renders the glyph or a fallback |
|
||||||
|
| 3 services × 6 roles don't fit one PDF page | Header repeats, rows never split; booth sheet falls back to one page per role |
|
||||||
|
| Export job fails mid-render | Job marked `failed`, admin sees a retry action, no partial file is ever downloaded |
|
||||||
|
| Two exports requested at once | Both run; each gets its own job row and signed URL |
|
||||||
|
| Admin leaves the page during a large export | Job continues server-side; link is waiting in *Recent exports* and emailed |
|
||||||
|
| Volunteer rates 100% but has never served | Verified level stays `none → observer`; they rank low and are offered a shadow, never a solo slot |
|
||||||
|
| Volunteer rates 10% on a skill they're expert at | Warning shown with the mismatch; admin can ask; rank penalty is modest, not a block |
|
||||||
|
| Only expert for Livestream is away | Coverage risk flagged at T-14 with "single point of failure", plus a growth nudge for qualified backups |
|
||||||
|
| Mentor declines a growth goal | Goal returns to `mentor_assigned`, admin notified, next mentor suggested |
|
||||||
|
| Volunteer wants a skill nobody mentors | Goal marked `requested` with "no mentor available"; training-only path offered instead |
|
||||||
|
| Trainee shadowed 3 times but never signed off | Still not solo-eligible; shows in the mentor's "assessment due" list |
|
||||||
|
| Skill retired or renamed | Deactivated, not deleted; historical assessments and levels preserved |
|
||||||
|
| Position changes its required skill mid-season | Existing assignments flagged for review, not silently invalidated |
|
||||||
|
| Two admins create "Cameras" and "Camera Ops" the same week | Second create is allowed; the catalog flags likely duplicates (same category, similar name) and offers Merge |
|
||||||
|
| Technology filed under the wrong company | Move it; skills keep working because they reference the technology id, not the name |
|
||||||
|
| Vendor with products is deactivated | Blocked until its technologies are moved or retired (restrict, with the list shown) |
|
||||||
|
| Fresh install with an empty catalog | Guided setup with the starter library or a blank start; scheduling is unavailable until one position exists, with that reason shown |
|
||||||
|
| Gear swapped mid-season (Roland → ATEM) | Equivalency rule transfers competency at one level lower until assessed; slots show "transferable — confirm on new gear" |
|
||||||
|
| Admin renames a category | Names propagate everywhere; history keeps ids, audit records the rename |
|
||||||
|
| Event overlaps a Sunday service for the same person | Allowed (different times) but warns if the gap is under 60 minutes |
|
||||||
|
| Two events at the same time, same photographer | Blocked with the conflicting event named |
|
||||||
|
| Event cancelled after photographers confirmed | Assignments cancelled, reminders cancelled, everyone emailed with the reason |
|
||||||
|
| Photographer shoots but never uploads | Stuck at `covered`; flagged on the dashboard after `deliverable_due`, reminder sent |
|
||||||
|
| Event photos include minors with no release | Gallery publishing blocked; event marked `no_publish` until an admin confirms |
|
||||||
|
| Upload interrupted at 60% of a 40 GB batch | Resume from the last completed part; nothing partial appears in the gallery |
|
||||||
|
| Editor asks for "all 900 originals" | Manifest CSV plus selection download offered; no giant ZIP is generated |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 9. Non-functional requirements
|
||||||
|
|
||||||
|
| Area | Requirement |
|
||||||
|
| --- | --- |
|
||||||
|
| Performance | Volunteer pages LCP < 2 s on 4G; schedule grid drag < 100 ms |
|
||||||
|
| Availability | 99.9% during Sunday 06:00–13:00 local; read-only degradation acceptable |
|
||||||
|
| Mobile | All volunteer flows fully usable at 360 px width, thumb-reachable primary actions |
|
||||||
|
| Accessibility | WCAG 2.1 AA, keyboard-complete scheduling grid, visible focus, alt text required |
|
||||||
|
| Browser support | Last 2 versions of Chrome/Safari/Firefox/Edge, iOS Safari 16+, Android Chrome |
|
||||||
|
| Data retention | Assignments & audit 24 months; notifications 12 months; analytics aggregates only |
|
||||||
|
| Backup | Daily DB snapshot, 30-day point-in-time, weekly export to object storage, restore tested once |
|
||||||
|
| Security | See Architecture §10; every server action authorizes; PII masked; no secrets client-side |
|
||||||
|
| Localization | Single language (English), but all copy in one strings file; timezone-aware formatting |
|
||||||
|
| Observability | Errors to Sentry with release; cron heartbeat + notification failure alerts to admin |
|
||||||
|
| Documentation | README with setup, env vars, seed, deploy, runbook; ADRs in the repo |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 10. Build plan
|
||||||
|
|
||||||
|
Assumes one developer. "Full-time" ≈ 35 h/week; part-time ≈ 12 h/week.
|
||||||
|
|
||||||
|
| Phase | Weeks (full-time) | Deliverables | Exit criteria |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| **0 — Discovery & design** | 1 | Final requirements sign-off, wireframes for 8 screens, data model, Twilio 10DLC registration started, Postmark domain set up | Church approves flows; DNS/registration submitted (external lead time) |
|
||||||
|
| **1 — Foundation** | 1 | Repo, CI, auth, invite/approval, users & roles, layout/nav, seed data | Admin can invite and approve a volunteer; they can sign in |
|
||||||
|
| **2 — Scheduling core** | 2 | Services/requirements, instance generation, grid, conflict engine, blackout submission, draft/publish | A full week can be scheduled and published with zero gaps in a pilot |
|
||||||
|
| **3 — Notifications** | 1.5 | Outbox, rules, email templates, Friday reminder, magic-link confirm/decline, admin log, failure alerts | Acceptance test in §F6/F7 passes end-to-end |
|
||||||
|
| **4 — SMS** | 0.5 | Twilio integration, consent, STOP/HELP, day-of reminder, fallback | Real SMS received on a real phone, STOP honoured |
|
||||||
|
| **5 — Training + rich text** | 2 | TipTap everywhere, courses, lessons, video, progress, gating, revision history | 2 courses published, new volunteer gated until complete |
|
||||||
|
| **6 — Extras** | 1 | Swaps, ICS, run sheets, announcements, dashboard, audit, exports, print sheet | Pilot team uses it for 4 consecutive Sundays without a spreadsheet |
|
||||||
|
| **7 — AI (optional)** | 1 | Ask-the-schedule, draft copy, explain auto-fill, flags & caps | Degrades cleanly with AI off |
|
||||||
|
| **8 — Launch** | 0.5 | Migration/import, training session, runbook, monitoring, handoff | 100% of active volunteers invited; first fully system-run Sunday |
|
||||||
|
|
||||||
|
**Total:** ~10.5 weeks full-time, ~6 months part-time. **Recommended pilot:** one service (Sunday 9:00) for 4 weeks, then 11:00, then retire the spreadsheet.
|
||||||
|
|
||||||
|
**Milestones to brag about internally:** M1 = one volunteer confirms via text on a real phone (week 4). M2 = first Friday where nobody had to be reminded by hand (week 6). M3 = a brand-new volunteer completes Audio 101 and is scheduled without a walkthrough (week 9).
|
||||||
|
|
||||||
|
### 10.1 Launch checklist
|
||||||
|
|
||||||
|
- [ ] 10DLC brand + campaign approved; test SMS delivered
|
||||||
|
- [ ] Postmark domain verified, DKIM/SPF/DMARC pass, test mail not in spam (Gmail + Outlook + iCloud)
|
||||||
|
- [ ] Cron heartbeats green for 7 days in preview
|
||||||
|
- [ ] Reminder dry-run for 3 consecutive Sundays verified by two people
|
||||||
|
- [ ] Restore-from-backup drill completed
|
||||||
|
- [ ] Accessibility pass on volunteer flows (keyboard + VoiceOver)
|
||||||
|
- [ ] Two admins trained; runbook printed for the booth
|
||||||
|
- [ ] Roster CSV imported and spot-checked (20 random volunteers)
|
||||||
|
- [ ] Opt-out and deactivation tested
|
||||||
|
- [ ] Rollback plan written (keep the spreadsheet read-only until Sunday +2)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 11. Recommended extras (beyond your list)
|
||||||
|
|
||||||
|
You asked what else is worth adding for a church media team. Ranked by value per unit of effort. Everything in **P1** is folded into the plan above; the rest are ready to schedule next.
|
||||||
|
|
||||||
|
| # | Feature | Why it matters in a church media booth | Priority | Effort |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| 1 | **Call time ≠ service time** | Audio needs 90 min; slides 45. "Be here at 8:15" removes day-of chaos | P1 (core) | S |
|
||||||
|
| 2 | **ICS calendar feed** | Volunteers live in Google Calendar. Subscription > another app to check | P1 | S |
|
||||||
|
| 3 | **Confirm/decline without login** | The moment of contact is a text message. Any friction kills response rates | P1 | S |
|
||||||
|
| 4 | **Publish/draft separation** | Stops accidental notification storms when the schedule is half-built | P1 | S |
|
||||||
|
| 5 | **Coverage risk alerts** | Tells the director on Tuesday, not Saturday night | P1 | S |
|
||||||
|
| 6 | **Run sheet per service** | The single most-requested artifact in media teams: order of service, cues, "extra mic for baptism" | P1 | M |
|
||||||
|
| 7 | **Certification gating + trainee slots** | Prevents dropping a first-timer alone on the audio board; makes shadowing structured | P1 | M |
|
||||||
|
| 8 | **Printable booth sheet** | Tape it to the desk. Some things should not require a phone | P1 | S |
|
||||||
|
| 9 | **On-call backup / waitlist** | "Who can cover at 7 AM Sunday?" answered by a ranked list, not a group text | P2 | M |
|
||||||
|
| 10 | **Reliability & fairness report** | Sunday-heavy servers see the data; the director can say "you've served 9 of 10 weeks, take a break" | P2 | M |
|
||||||
|
| 11 | **Pre-service tech checklist** | Timestamped checkboxes (batteries, SD card, stream test) so "did anyone test the stream?" stops being a question | P2 | M |
|
||||||
|
| 12 | **Equipment incident log** | "Wireless mic 2 drops out" becomes a ticket with history instead of a memory | P2 | M |
|
||||||
|
| 13 | **Onboarding pathway** | New volunteer: application → orientation lesson → shadow 2 services → certified. Visible progress, less director time | P2 | M |
|
||||||
|
| 14 | **Recertification reminders** | Live-stream platforms and gear change; annual refresher assigned automatically | P2 | S |
|
||||||
|
| 15 | **Training quizzes** | 5 questions per lesson proves comprehension, gates certification properly | P2 | M |
|
||||||
|
| 16 | **Gear inventory + maintenance** | Serial numbers, purchase dates, "cable 14 is flaky" — helps budgets and handoffs | P3 | M |
|
||||||
|
| 17 | **Serving history & leadership report pack** | Monthly/quarterly PDF + XLSX pack for the pastor and board: services covered, hours, growth, training completion — auto-emailed, built for budget season | P2 | S |
|
||||||
|
| 18 | **Slack / Google Chat push** | For teams already living in chat; one more channel, same outbox | P3 | S |
|
||||||
|
| 19 | **Multi-campus** | Only if the church plants. Design leaves `campus_id` out on purpose until then | P3 | L |
|
||||||
|
| 20 | **AI training assistant (RAG)** | "How do I set gain on the board?" answered from your own lessons, with citations | P3 | M |
|
||||||
|
| 21 | **Service recording → transcript → captions archive** | Reuses the training video pipeline; serves accessibility and the sermon archive | P3 | L |
|
||||||
|
| 22 | **ProPresenter/OBS status widget** | Read-only "stream is live" indicator on the run sheet. Nice, not needed | P3 | L |
|
||||||
|
|
||||||
|
**Two things I would deliberately not build:** in-app chat (you already have text threads; a dead chat tab is worse than none), and a public-facing "who's serving" page (privacy for no real benefit).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 12. Open questions for the church
|
||||||
|
|
||||||
|
Answer these before Phase 1 ends; they change the data model or the copy, not the architecture.
|
||||||
|
|
||||||
|
1. Exact service times and how many (9:00/11:00? midweek? Saturday?), and the timezone.
|
||||||
|
2. Do you need **more than one person per role** on normal Sundays, or only for special services?
|
||||||
|
3. Who are the admins vs. coordinators? Does a coordinator own one role or one service?
|
||||||
|
4. Current system: Google Sheet, Planning Center, or paper? Can we get a CSV export for migration?
|
||||||
|
5. Are any volunteers **minors**? If yes, we need guardian contacts and a stricter notification policy.
|
||||||
|
6. Is there a budget owner for Twilio (~$10–20/mo) and a legal EIN for 10DLC registration?
|
||||||
|
7. Do you have a church domain we can send from (`media@yourchurch.org`)? Who controls DNS?
|
||||||
|
8. Where do training videos live today (YouTube unlisted? Google Drive? nowhere)? That decides the first migration task.
|
||||||
|
9. Do volunteers want a **team feed** (announcements) or would that duplicate an existing group chat?
|
||||||
|
10. What is the "call time" convention per role today — the real answer, not the ideal one?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 13. Definition of done (v1)
|
||||||
|
|
||||||
|
- All **Must** features in §3.1 implemented and demoed on a phone.
|
||||||
|
- Reminder acceptance test passes for three consecutive weeks in a staging environment with real time zones.
|
||||||
|
- A volunteer can go from invite → approval → training → scheduled → confirmed → reminded without an admin touching anything after publish.
|
||||||
|
- Two admins can build and publish a week in under 10 minutes, measured.
|
||||||
|
- Every screen usable at 360 px, keyboard-navigable, with no console errors.
|
||||||
|
- PDF, XLSX and CSV exports verified by opening each file in Excel, Google Sheets and a PDF reader — booth sheet fits on one page and is legible from arm's length.
|
||||||
|
- An event with a photographer can be created, staffed, reminded, shot and marked delivered without touching the weekly service schedule.
|
||||||
|
- An admin can add a new company, technology, skill and position end to end, with every screen reflecting it, without a deploy.
|
||||||
|
- Skill matrix populated for every active volunteer, every position mapping verified, and at least one mentor designated per skill the church depends on.
|
||||||
|
- A new volunteer can self-rate comfort, request a skill-up, get a mentor, shadow a service, and be signed off — end to end, without an admin editing a level by hand.
|
||||||
|
- README with setup, env vars, deploy, and a runbook for the five failure modes in §8.
|
||||||
|
- The spreadsheet can be retired.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 14. Glossary
|
||||||
|
|
||||||
|
| Term | Meaning |
|
||||||
|
| --- | --- |
|
||||||
|
| **Service / instance** | The recurring template (Sunday 9:00) vs. one specific Sunday's occurrence |
|
||||||
|
| **Role** | A production position: Audio, Livestream, Slides |
|
||||||
|
| **Slot** | One required person for one role at one instance |
|
||||||
|
| **Assignment** | A person in a slot, with a response status |
|
||||||
|
| **Call time** | When they must arrive, earlier than the service start |
|
||||||
|
| **Blackout** | A date range a volunteer is unavailable |
|
||||||
|
| **Draft / published** | Whether a week is visible and notified |
|
||||||
|
| **Certification** | A volunteer's level for a role: trainee, qualified, lead |
|
||||||
|
| **Run sheet** | The order of service with cues and owners |
|
||||||
|
| **Outbox** | The notifications table that the cron worker drains |
|
||||||
|
| **10DLC** | US carrier registration required to send application-to-person SMS |
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
# Media Team Scheduling — Feature Summary
|
||||||
|
|
||||||
|
**For:** Media Director / ministry leader
|
||||||
|
**Purpose:** Confirm this covers what your team actually needs before we build
|
||||||
|
**Date:** November 17, 2026
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## What this is, in one paragraph
|
||||||
|
|
||||||
|
One place to schedule the three production roles — **Audio, Livestream, Slides** — instead of a spreadsheet and a group text. Volunteers tell it when they're away, the admin builds the week, and everyone gets an **email and a text the Friday before** with their arrival time. It also holds the how-to videos and written guides, so new people can learn a role without you standing behind them.
|
||||||
|
|
||||||
|
The goal is simple: **you never chase someone about a Sunday again.**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## The features, grouped by what they do for you
|
||||||
|
|
||||||
|
### 1. Scheduling the week
|
||||||
|
- A weekly grid showing every service and every role, with who's filling each spot.
|
||||||
|
- Assign by clicking an empty slot and picking from a ranked list, or drag a name onto the grid.
|
||||||
|
- It warns you before you create a problem: the person is away, already serving that morning, or not yet cleared on that position.
|
||||||
|
- **Copy last week** to fill a normal Sunday in seconds.
|
||||||
|
- **Draft vs. published** — build the schedule quietly all week, then publish when it's ready. Nothing notifies anyone until you publish.
|
||||||
|
- Special services (Christmas Eve, Good Friday) get their own times and extra people.
|
||||||
|
- A printed **booth sheet** for each service: role, name, arrival time, run order.
|
||||||
|
|
||||||
|
### 2. Availability and blackout dates
|
||||||
|
- Volunteers mark date ranges they're unavailable — a vacation, a work trip, every other Sunday.
|
||||||
|
- Those dates automatically drop them out of the picker, so you're never guessing.
|
||||||
|
- You can see a month view of who's out before you build the schedule.
|
||||||
|
- If someone marks away a date they're already scheduled, you get a warning instead of a silent hole.
|
||||||
|
|
||||||
|
### 3. Reminders — the Friday email and text
|
||||||
|
- **The Friday-before reminder is automatic**, by email and text, with the day, time, arrival time and location.
|
||||||
|
- A second short text the morning they serve.
|
||||||
|
- A reminder mid-week if they haven't confirmed yet.
|
||||||
|
- You get alerted when a slot is still unfilled or unconfirmed, so you can fix it before Saturday night.
|
||||||
|
- **Texts are deferred to a later phase** (launch is email-only). When added, texts are optional per volunteer, with proper consent and a STOP opt-out. (US carriers require a registration for church texting — 1–3 weeks — so that registration can start whenever you decide to turn SMS on.)
|
||||||
|
- Reminder timing is a setting, not code — move Friday to Thursday and it just works.
|
||||||
|
|
||||||
|
### 4. Confirming, declining, swapping
|
||||||
|
- Volunteers confirm or decline from the text or email **without logging in** — one tap.
|
||||||
|
- Declining puts the slot back on your board and tells you within a minute.
|
||||||
|
- Volunteers can request a swap with someone else; you approve it.
|
||||||
|
- Everyone can subscribe to the schedule in Google Calendar so it shows up next to everything else in their life.
|
||||||
|
|
||||||
|
### 5. People and approvals
|
||||||
|
- People request to join; you approve or decline, with a note.
|
||||||
|
- You set what each person is cleared to run.
|
||||||
|
- You can see who's serving too often and who hasn't served in months.
|
||||||
|
- Deactivating someone removes their access and their calendar link immediately.
|
||||||
|
|
||||||
|
### 6. Skills and mentoring (so you know who can actually run what)
|
||||||
|
- Each person rates how comfortable they are on each piece of gear — say 90% on slides, 60% on the audio board, 30% on the stream.
|
||||||
|
- **You or a mentor verify the real level.** Comfort is what they say; verified level is what you trust. The schedule uses both.
|
||||||
|
- The picker shows you who's available, what they're cleared for, and how comfortable they are — so "who can cover audio Sunday?" is a five-second answer.
|
||||||
|
- People can ask to **learn a new position**. You match them with a mentor, and they shadow a service without counting as coverage.
|
||||||
|
- After they shadow, the mentor taps one button to say how it went. That's how someone gets cleared.
|
||||||
|
- Mentors are set per skill: being good at slides doesn't make you the audio trainer.
|
||||||
|
- If someone hasn't run a position in months, it's flagged as **needs refresher** rather than quietly assumed.
|
||||||
|
|
||||||
|
### 7. Training and the how-to library
|
||||||
|
- Courses made of lessons: video at the top, written steps below, with headings, photos, warnings and checklists.
|
||||||
|
- A **rich text editor** for everything you write — lessons, announcements, run sheets, service notes, even the wording of the reminder emails.
|
||||||
|
- Progress tracking: who's finished what, who's mid-course.
|
||||||
|
- A volunteer can't be scheduled alone on a position until they're cleared for it.
|
||||||
|
- Draft and publish, so half-finished lessons aren't visible.
|
||||||
|
|
||||||
|
### 8. Reporting and getting data out
|
||||||
|
- Dashboard at a glance: this Sunday's coverage, open slots, unconfirmed people, who's waiting for approval.
|
||||||
|
- Export anything to **PDF** (printed booth sheet, leadership report), **Excel** (sort, filter, pivot), or **CSV** (import anywhere else).
|
||||||
|
- A monthly or quarterly summary for the pastor or board: services covered, hours served, training completed.
|
||||||
|
|
||||||
|
### 9. Events and photography
|
||||||
|
- Separate from the weekly schedule: weddings, baptisms, youth nights, outreaches, Christmas productions.
|
||||||
|
- A ministry leader requests coverage; you assign a **photographer** and a **second shooter** from the same availability-and-skill list you use for Sundays.
|
||||||
|
- Each event has a **shot brief** the photographer opens on their phone — what's happening, who matters, what not to miss, where to stand, who to call.
|
||||||
|
- Same reminders and confirmations as a Sunday, with the reminder two days out instead of Friday.
|
||||||
|
- You can see at a glance which events still need a photographer, and which past events haven't been delivered yet.
|
||||||
|
- Photographers use the same skill levels and mentors as everyone else: a second shooter grows into a lead photographer with a sign-off, not a guess.
|
||||||
|
|
||||||
|
**Coming later (phase 2), not in the first release:** a photo library where photographers upload the originals and your editors download the **RAW files** to edit. We're designing it now so the storage and privacy decisions are right, but the first release stops at assigning and briefing the photographer.
|
||||||
|
|
||||||
|
### 10. Everything is yours to define
|
||||||
|
Nothing about your gear or positions is fixed. **Categories, equipment brands, specific products, job functions, positions and skills** are all things you (or an admin) create and rename in the app. Buy a new switcher or rename "Slides" to "Graphics" and the system follows — no developer, no waiting.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## What a normal week looks like
|
||||||
|
|
||||||
|
| When | What happens |
|
||||||
|
| --- | --- |
|
||||||
|
| **Mon–Tue** | You open the grid, see last week's pattern, fill this Sunday. Five minutes. |
|
||||||
|
| **Wed** | Anyone who's away is already excluded; you assign the rest from a ranked list. |
|
||||||
|
| **Thu** | You publish. Confirmations start coming in by themselves. |
|
||||||
|
| **Friday 6pm** | Everyone scheduled gets an email and a text with their arrival time. |
|
||||||
|
| **Saturday** | You check one screen: who hasn't confirmed. Nudge only those people. |
|
||||||
|
| **Sunday 6:30am** | A short "you're on today" text goes out. |
|
||||||
|
| **After the service** | Mentors get a one-tap prompt about anyone who shadowed. |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Does this cover what you need? — please tick and comment
|
||||||
|
|
||||||
|
Copy this into an email, or print it and mark it up.
|
||||||
|
|
||||||
|
| # | Requirement | Covers it? | Notes / changes |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| 1 | Schedule Audio, Livestream and Slides every week | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 2 | Volunteers can submit blackout dates | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 3 | Admin approves new volunteers | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 4 | Email the volunteer the Friday before | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 5 | **Text** the volunteer the Friday before (later phase; email is the launch channel) | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 6 | Volunteers confirm or decline easily | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 7 | See who's available and who's capable, in one view | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 8 | People can say what they're comfortable running (as a %) | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 9 | People can ask to be trained on a new position | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 10 | Mentors assigned per skill | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 11 | Training library with videos and written guides | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 12 | Rich text editing for lessons, announcements and notes | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 13 | Printable sheet for the booth on Sunday | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 14 | Export to PDF / Excel / CSV for leadership | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 15 | Add positions and equipment ourselves, without a developer | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 16 | Assign a photographer to weddings and events | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 17 | Photographer gets a shot brief on their phone | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
| 18 | Works well on a phone | ☐ Yes ☐ Partly ☐ No | |
|
||||||
|
|
||||||
|
**Anything missing from this list that your team needs?**
|
||||||
|
|
||||||
|
<br><br><br>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Deliberately not included (so there are no surprises)
|
||||||
|
|
||||||
|
- Worship team, ushers, greeters, kids ministry or parking schedules.
|
||||||
|
- Controlling the slides or stream software — this schedules *people*, it doesn't run the gear.
|
||||||
|
- A native iPhone/Android app (it works as a phone web app you can add to your home screen).
|
||||||
|
- In-app chat — announcements only, so we don't create a second place messages go unread.
|
||||||
|
- Payroll or volunteer-hour compliance.
|
||||||
|
- The photo library and RAW downloads — planned for phase 2, after the scheduling release is stable.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## What we need from you to start
|
||||||
|
|
||||||
|
1. **Service times** and timezone (e.g., Sundays 9:00 and 11:00, Central).
|
||||||
|
2. **How many people per role** on a normal Sunday — and on big ones.
|
||||||
|
3. **Who the admins and team leads are**, and what each should be able to do.
|
||||||
|
4. **Your current system** (spreadsheet, Planning Center, paper) and whether we can export it.
|
||||||
|
5. **A phone number budget** — texting costs roughly $10–20/month plus a small carrier registration.
|
||||||
|
6. **Any volunteers under 18**, so we set up guardian notifications correctly.
|
||||||
|
7. **Who owns the church domain / DNS**, for the sending email address.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Sign-off
|
||||||
|
|
||||||
|
| | |
|
||||||
|
| --- | --- |
|
||||||
|
| Reviewed by | |
|
||||||
|
| Date | |
|
||||||
|
| Approved to build as described | ☐ Yes ☐ Yes with changes noted above ☐ Not yet |
|
||||||
|
| Comments | |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*Technical companion documents for the build team: [`BUILD-SPEC.md`](./BUILD-SPEC.md) (screen-by-screen requirements) and [`ARCHITECTURE.md`](./ARCHITECTURE.md) (how it's built).*
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { config } from "dotenv";
|
||||||
|
import { defineConfig } from "drizzle-kit";
|
||||||
|
|
||||||
|
config();
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
schema: "./src/db/schema.ts",
|
||||||
|
out: "./drizzle",
|
||||||
|
dialect: "postgresql",
|
||||||
|
dbCredentials: { url: process.env.DATABASE_URL! },
|
||||||
|
});
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import { dirname } from "path";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
|
import { FlatCompat } from "@eslint/eslintrc";
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = dirname(__filename);
|
||||||
|
|
||||||
|
const compat = new FlatCompat({
|
||||||
|
baseDirectory: __dirname,
|
||||||
|
});
|
||||||
|
|
||||||
|
const eslintConfig = [
|
||||||
|
...compat.extends("next/core-web-vitals", "next/typescript"),
|
||||||
|
{
|
||||||
|
ignores: [
|
||||||
|
"node_modules/**",
|
||||||
|
".next/**",
|
||||||
|
"out/**",
|
||||||
|
"build/**",
|
||||||
|
"next-env.d.ts",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default eslintConfig;
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import type { NextConfig } from "next";
|
||||||
|
|
||||||
|
const nextConfig: NextConfig = {
|
||||||
|
/* config options here */
|
||||||
|
};
|
||||||
|
|
||||||
|
export default nextConfig;
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"name": "glenlochmedia",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "next dev --turbopack",
|
||||||
|
"build": "next build",
|
||||||
|
"start": "next start",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"typecheck": "tsc --noEmit",
|
||||||
|
"test": "vitest run",
|
||||||
|
"test:watch": "vitest",
|
||||||
|
"db:generate": "drizzle-kit generate",
|
||||||
|
"db:migrate": "drizzle-kit migrate",
|
||||||
|
"db:seed": "echo 'seed script wired in A2'"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@radix-ui/react-label": "^2.1.17",
|
||||||
|
"@radix-ui/react-slot": "^1.5.0",
|
||||||
|
"class-variance-authority": "^0.7.1",
|
||||||
|
"clsx": "^2.1.1",
|
||||||
|
"drizzle-orm": "^0.45.4",
|
||||||
|
"lucide-react": "^1.74.0",
|
||||||
|
"next": "15.5.29",
|
||||||
|
"postgres": "^4.1.1",
|
||||||
|
"react": "19.1.0",
|
||||||
|
"react-dom": "19.1.0",
|
||||||
|
"tailwind-merge": "^3.7.0",
|
||||||
|
"tailwindcss-animate": "^1.0.7",
|
||||||
|
"zod": "^4.6.7"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@eslint/eslintrc": "^3",
|
||||||
|
"@tailwindcss/postcss": "^4",
|
||||||
|
"@testing-library/jest-dom": "^7.0.1",
|
||||||
|
"@testing-library/react": "^16.3.3",
|
||||||
|
"@testing-library/user-event": "^14.6.12",
|
||||||
|
"@types/node": "^20",
|
||||||
|
"@types/react": "^19",
|
||||||
|
"@types/react-dom": "^19",
|
||||||
|
"dotenv": "^18.0.10",
|
||||||
|
"drizzle-kit": "^0.31.11",
|
||||||
|
"eslint": "^9",
|
||||||
|
"eslint-config-next": "15.5.29",
|
||||||
|
"jsdom": "^31.0.1",
|
||||||
|
"shadcn": "^4.23.0",
|
||||||
|
"tailwindcss": "^4",
|
||||||
|
"typescript": "^5",
|
||||||
|
"vitest": "^5.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+7203
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
|||||||
|
const config = {
|
||||||
|
plugins: ["@tailwindcss/postcss"],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
|
||||||
|
After Width: | Height: | Size: 391 B |
@@ -0,0 +1 @@
|
|||||||
|
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
||||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
||||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>
|
||||||
|
After Width: | Height: | Size: 128 B |
@@ -0,0 +1 @@
|
|||||||
|
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
|
||||||
|
After Width: | Height: | Size: 385 B |
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,121 @@
|
|||||||
|
@import "tailwindcss";
|
||||||
|
@plugin "tailwindcss-animate";
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--radius: 0.625rem;
|
||||||
|
--background: oklab(1 0 0);
|
||||||
|
--foreground: oklab(0.145 0 0);
|
||||||
|
--card: oklab(1 0 0);
|
||||||
|
--card-foreground: oklab(0.145 0 0);
|
||||||
|
--popover: oklab(1 0 0);
|
||||||
|
--popover-foreground: oklab(0.145 0 0);
|
||||||
|
--primary: oklab(0.205 0 0);
|
||||||
|
--primary-foreground: oklab(0.985 0 0);
|
||||||
|
--secondary: oklab(0.97 0.006 0.015);
|
||||||
|
--secondary-foreground: oklab(0.205 0 0);
|
||||||
|
--muted: oklab(0.97 0.006 0.015);
|
||||||
|
--muted-foreground: oklab(0.451 0 0);
|
||||||
|
--accent: oklab(0.97 0.006 0.015);
|
||||||
|
--accent-foreground: oklab(0.205 0 0);
|
||||||
|
--destructive: oklab(0.583 0.185 -0.047);
|
||||||
|
--destructive-foreground: oklab(0.985 0 0);
|
||||||
|
--border: oklab(0.922 0.005 0.082);
|
||||||
|
--input: oklab(0.922 0.005 0.082);
|
||||||
|
--ring: oklab(0.708 0 0);
|
||||||
|
--chart-1: oklab(0.646 0.222 0.107);
|
||||||
|
--chart-2: oklab(0.6 0.115 -0.064);
|
||||||
|
--chart-3: oklab(0.398 0.063 0.064);
|
||||||
|
--chart-4: oklab(0.826 0.185 -0.024);
|
||||||
|
--chart-5: oklab(0.89 0.049 0.344);
|
||||||
|
--sidebar: oklab(0.985 0 0);
|
||||||
|
--sidebar-foreground: oklab(0.145 0 0);
|
||||||
|
--sidebar-primary: oklab(0.205 0 0);
|
||||||
|
--sidebar-primary-foreground: oklab(0.985 0 0);
|
||||||
|
--sidebar-accent: oklab(0.97 0.006 0.015);
|
||||||
|
--sidebar-accent-foreground: oklab(0.205 0 0);
|
||||||
|
--sidebar-border: oklab(0.922 0.005 0.082);
|
||||||
|
--sidebar-ring: oklab(0.708 0 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark {
|
||||||
|
--background: oklab(0.145 0 0);
|
||||||
|
--foreground: oklab(0.985 0 0);
|
||||||
|
--card: oklab(0.205 0 0);
|
||||||
|
--card-foreground: oklab(0.985 0 0);
|
||||||
|
--popover: oklab(0.205 0 0);
|
||||||
|
--popover-foreground: oklab(0.985 0 0);
|
||||||
|
--primary: oklab(0.985 0 0);
|
||||||
|
--primary-foreground: oklab(0.205 0 0);
|
||||||
|
--secondary: oklab(0.269 0 0);
|
||||||
|
--secondary-foreground: oklab(0.985 0 0);
|
||||||
|
--muted: oklab(0.269 0 0);
|
||||||
|
--muted-foreground: oklab(0.637 0 0);
|
||||||
|
--accent: oklab(0.269 0 0);
|
||||||
|
--accent-foreground: oklab(0.985 0 0);
|
||||||
|
--destructive: oklab(0.396 0.141 -0.093);
|
||||||
|
--destructive-foreground: oklab(0.985 0 0);
|
||||||
|
--border: oklab(0.269 0 0);
|
||||||
|
--input: oklab(0.269 0 0);
|
||||||
|
--ring: oklab(0.544 0 0);
|
||||||
|
--chart-1: oklab(0.488 0.24 -0.021);
|
||||||
|
--chart-2: oklab(0.617 0.229 -0.111);
|
||||||
|
--chart-3: oklab(0.395 0.124 0.174);
|
||||||
|
--chart-4: oklab(0.714 0.203 -0.028);
|
||||||
|
--chart-5: oklab(0.691 0.128 -0.042);
|
||||||
|
--sidebar: oklab(0.205 0 0);
|
||||||
|
--sidebar-foreground: oklab(0.985 0 0);
|
||||||
|
--sidebar-primary: oklab(0.488 0.24 -0.021);
|
||||||
|
--sidebar-primary-foreground: oklab(0.985 0 0);
|
||||||
|
--sidebar-accent: oklab(0.269 0 0);
|
||||||
|
--sidebar-accent-foreground: oklab(0.985 0 0);
|
||||||
|
--sidebar-border: oklab(0.269 0 0);
|
||||||
|
--sidebar-ring: oklab(0.544 0 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@theme inline {
|
||||||
|
--radius: 0.625rem;
|
||||||
|
--font-sans: var(--font-geist-sans);
|
||||||
|
--font-mono: var(--font-geist-mono);
|
||||||
|
--color-background: var(--background);
|
||||||
|
--color-foreground: var(--foreground);
|
||||||
|
--color-card: var(--card);
|
||||||
|
--color-card-foreground: var(--card-foreground);
|
||||||
|
--color-popover: var(--popover);
|
||||||
|
--color-popover-foreground: var(--popover-foreground);
|
||||||
|
--color-primary: var(--primary);
|
||||||
|
--color-primary-foreground: var(--primary-foreground);
|
||||||
|
--color-secondary: var(--secondary);
|
||||||
|
--color-secondary-foreground: var(--secondary-foreground);
|
||||||
|
--color-muted: var(--muted);
|
||||||
|
--color-muted-foreground: var(--muted-foreground);
|
||||||
|
--color-accent: var(--accent);
|
||||||
|
--color-accent-foreground: var(--accent-foreground);
|
||||||
|
--color-destructive: var(--destructive);
|
||||||
|
--color-destructive-foreground: var(--destructive-foreground);
|
||||||
|
--color-border: var(--border);
|
||||||
|
--color-input: var(--input);
|
||||||
|
--color-ring: var(--ring);
|
||||||
|
--color-chart-1: var(--chart-1);
|
||||||
|
--color-chart-2: var(--chart-2);
|
||||||
|
--color-chart-3: var(--chart-3);
|
||||||
|
--color-chart-4: var(--chart-4);
|
||||||
|
--color-chart-5: var(--chart-5);
|
||||||
|
--color-sidebar: var(--sidebar);
|
||||||
|
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||||
|
--color-sidebar-primary: var(--sidebar-primary);
|
||||||
|
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
||||||
|
--color-sidebar-accent: var(--sidebar-accent);
|
||||||
|
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||||
|
--color-sidebar-border: var(--sidebar-border);
|
||||||
|
--color-sidebar-ring: var(--sidebar-ring);
|
||||||
|
}
|
||||||
|
|
||||||
|
@layer base {
|
||||||
|
* {
|
||||||
|
@apply border-border;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
@apply bg-background text-foreground;
|
||||||
|
font-family: var(--font-sans);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
|
import { Geist, Geist_Mono } from "next/font/google";
|
||||||
|
import "./globals.css";
|
||||||
|
|
||||||
|
const geistSans = Geist({
|
||||||
|
variable: "--font-geist-sans",
|
||||||
|
subsets: ["latin"],
|
||||||
|
});
|
||||||
|
|
||||||
|
const geistMono = Geist_Mono({
|
||||||
|
variable: "--font-geist-mono",
|
||||||
|
subsets: ["latin"],
|
||||||
|
});
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: "Media Team Hub",
|
||||||
|
description: "Church media team scheduling and training platform.",
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function RootLayout({
|
||||||
|
children,
|
||||||
|
}: Readonly<{
|
||||||
|
children: React.ReactNode;
|
||||||
|
}>) {
|
||||||
|
return (
|
||||||
|
<html lang="en">
|
||||||
|
<body
|
||||||
|
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
import Image from "next/image";
|
||||||
|
|
||||||
|
export default function Home() {
|
||||||
|
return (
|
||||||
|
<div className="font-sans grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20">
|
||||||
|
<main className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
|
||||||
|
<Image
|
||||||
|
className="dark:invert"
|
||||||
|
src="/next.svg"
|
||||||
|
alt="Next.js logo"
|
||||||
|
width={180}
|
||||||
|
height={38}
|
||||||
|
priority
|
||||||
|
/>
|
||||||
|
<ol className="font-mono list-inside list-decimal text-sm/6 text-center sm:text-left">
|
||||||
|
<li className="mb-2 tracking-[-.01em]">
|
||||||
|
Get started by editing{" "}
|
||||||
|
<code className="bg-black/[.05] dark:bg-white/[.06] font-mono font-semibold px-1 py-0.5 rounded">
|
||||||
|
src/app/page.tsx
|
||||||
|
</code>
|
||||||
|
.
|
||||||
|
</li>
|
||||||
|
<li className="tracking-[-.01em]">
|
||||||
|
Save and see your changes instantly.
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<div className="flex gap-4 items-center flex-col sm:flex-row">
|
||||||
|
<a
|
||||||
|
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] font-medium text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 sm:w-auto"
|
||||||
|
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
className="dark:invert"
|
||||||
|
src="/vercel.svg"
|
||||||
|
alt="Vercel logomark"
|
||||||
|
width={20}
|
||||||
|
height={20}
|
||||||
|
/>
|
||||||
|
Deploy now
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
className="rounded-full border border-solid border-black/[.08] dark:border-white/[.145] transition-colors flex items-center justify-center hover:bg-[#f2f2f2] dark:hover:bg-[#1a1a1a] hover:border-transparent font-medium text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 w-full sm:w-auto md:w-[158px]"
|
||||||
|
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
Read our docs
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer className="row-start-3 flex gap-[24px] flex-wrap items-center justify-center">
|
||||||
|
<a
|
||||||
|
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
|
||||||
|
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
aria-hidden
|
||||||
|
src="/file.svg"
|
||||||
|
alt="File icon"
|
||||||
|
width={16}
|
||||||
|
height={16}
|
||||||
|
/>
|
||||||
|
Learn
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
|
||||||
|
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
aria-hidden
|
||||||
|
src="/window.svg"
|
||||||
|
alt="Window icon"
|
||||||
|
width={16}
|
||||||
|
height={16}
|
||||||
|
/>
|
||||||
|
Examples
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
|
||||||
|
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
aria-hidden
|
||||||
|
src="/globe.svg"
|
||||||
|
alt="Globe icon"
|
||||||
|
width={16}
|
||||||
|
height={16}
|
||||||
|
/>
|
||||||
|
Go to nextjs.org →
|
||||||
|
</a>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import * as React from "react"
|
||||||
|
import { cva, type VariantProps } from "class-variance-authority"
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
const badgeVariants = cva(
|
||||||
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
||||||
|
{
|
||||||
|
variants: {
|
||||||
|
variant: {
|
||||||
|
default:
|
||||||
|
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
||||||
|
secondary:
|
||||||
|
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
||||||
|
destructive:
|
||||||
|
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
||||||
|
outline: "text-foreground",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaultVariants: {
|
||||||
|
variant: "default",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
export interface BadgeProps
|
||||||
|
extends React.HTMLAttributes<HTMLDivElement>,
|
||||||
|
VariantProps<typeof badgeVariants> {}
|
||||||
|
|
||||||
|
function Badge({ className, variant, ...props }: BadgeProps) {
|
||||||
|
return (
|
||||||
|
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Badge, badgeVariants }
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import * as React from "react"
|
||||||
|
import { Slot } from "@radix-ui/react-slot"
|
||||||
|
import { cva, type VariantProps } from "class-variance-authority"
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
const buttonVariants = cva(
|
||||||
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
||||||
|
{
|
||||||
|
variants: {
|
||||||
|
variant: {
|
||||||
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
||||||
|
destructive:
|
||||||
|
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
||||||
|
outline:
|
||||||
|
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
||||||
|
secondary:
|
||||||
|
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
||||||
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
||||||
|
link: "text-primary underline-offset-4 hover:underline",
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
default: "h-10 px-4 py-2",
|
||||||
|
sm: "h-9 rounded-md px-3",
|
||||||
|
lg: "h-11 rounded-md px-8",
|
||||||
|
icon: "h-10 w-10",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaultVariants: {
|
||||||
|
variant: "default",
|
||||||
|
size: "default",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
export interface ButtonProps
|
||||||
|
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
||||||
|
VariantProps<typeof buttonVariants> {
|
||||||
|
asChild?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||||
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
||||||
|
const Comp = asChild ? Slot : "button"
|
||||||
|
return (
|
||||||
|
<Comp
|
||||||
|
className={cn(buttonVariants({ variant, size, className }))}
|
||||||
|
ref={ref}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
Button.displayName = "Button"
|
||||||
|
|
||||||
|
export { Button, buttonVariants }
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
import * as React from "react"
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
const Card = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div
|
||||||
|
ref={ref}
|
||||||
|
className={cn(
|
||||||
|
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
Card.displayName = "Card"
|
||||||
|
|
||||||
|
const CardHeader = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div
|
||||||
|
ref={ref}
|
||||||
|
className={cn("flex flex-col space-y-1.5 p-6", className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardHeader.displayName = "CardHeader"
|
||||||
|
|
||||||
|
const CardTitle = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div
|
||||||
|
ref={ref}
|
||||||
|
className={cn(
|
||||||
|
"text-2xl font-semibold leading-none tracking-tight",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardTitle.displayName = "CardTitle"
|
||||||
|
|
||||||
|
const CardDescription = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div
|
||||||
|
ref={ref}
|
||||||
|
className={cn("text-sm text-muted-foreground", className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardDescription.displayName = "CardDescription"
|
||||||
|
|
||||||
|
const CardContent = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
||||||
|
))
|
||||||
|
CardContent.displayName = "CardContent"
|
||||||
|
|
||||||
|
const CardFooter = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div
|
||||||
|
ref={ref}
|
||||||
|
className={cn("flex items-center p-6 pt-0", className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardFooter.displayName = "CardFooter"
|
||||||
|
|
||||||
|
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import * as React from "react"
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
||||||
|
({ className, type, ...props }, ref) => {
|
||||||
|
return (
|
||||||
|
<input
|
||||||
|
type={type}
|
||||||
|
className={cn(
|
||||||
|
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
ref={ref}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
Input.displayName = "Input"
|
||||||
|
|
||||||
|
export { Input }
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
"use client"
|
||||||
|
|
||||||
|
import * as React from "react"
|
||||||
|
import * as LabelPrimitive from "@radix-ui/react-label"
|
||||||
|
import { cva, type VariantProps } from "class-variance-authority"
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
const labelVariants = cva(
|
||||||
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
||||||
|
)
|
||||||
|
|
||||||
|
const Label = React.forwardRef<
|
||||||
|
React.ElementRef<typeof LabelPrimitive.Root>,
|
||||||
|
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
||||||
|
VariantProps<typeof labelVariants>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<LabelPrimitive.Root
|
||||||
|
ref={ref}
|
||||||
|
className={cn(labelVariants(), className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
Label.displayName = LabelPrimitive.Root.displayName
|
||||||
|
|
||||||
|
export { Label }
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import postgres from "postgres";
|
||||||
|
import { drizzle } from "drizzle-orm/postgres-js";
|
||||||
|
import * as schema from "./schema";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Database client (postgres.js + Drizzle). Reads DATABASE_URL from the
|
||||||
|
* environment — provided by docker-compose in production, or .env locally.
|
||||||
|
*
|
||||||
|
* Phase A2: this client is the single entry point for all DB access. Domain
|
||||||
|
* logic (src/domain/**) must NOT touch the DB directly.
|
||||||
|
*/
|
||||||
|
const connection = postgres(process.env.DATABASE_URL!, {
|
||||||
|
max: 10,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const db = drizzle(connection, { schema });
|
||||||
|
|
||||||
|
export { schema };
|
||||||
|
export * from "./schema";
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* Database schema — Phase A2 populates the full data model here.
|
||||||
|
*
|
||||||
|
* Full spec: ARCHITECTURE.md §4 (users, roles, services, instances, slots,
|
||||||
|
* assignments, the skill taxonomy, notifications outbox, etc.).
|
||||||
|
*
|
||||||
|
* Conventions (from the spec):
|
||||||
|
* - `id` is a UUIDv7 text column
|
||||||
|
* - timestamps are `*_at` in UTC ISO-8601
|
||||||
|
* - dates are `*_date` in the church's local timezone
|
||||||
|
* - soft-delete only where noted; no hard deletes in the taxonomy graph
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Placeholder: A2 replaces this object with the real tables.
|
||||||
|
export const schema = {};
|
||||||
|
|
||||||
|
export type Schema = typeof schema;
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { describe, it, expect } from "vitest";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
|
describe("cn (class merge)", () => {
|
||||||
|
it("collapses conflicting classes to the last one", () => {
|
||||||
|
expect(cn("bg-red-500", "bg-green-500")).toBe("bg-green-500");
|
||||||
|
expect(cn("px-2", "px-4")).toBe("px-4");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("combines non-conflicting classes", () => {
|
||||||
|
expect(cn("px-2", "py-4", "text-sm")).toBe("px-2 py-4 text-sm");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("ignores falsy values", () => {
|
||||||
|
expect(cn(false, undefined, null, "", "keep")).toBe("keep");
|
||||||
|
expect(cn()).toBe("");
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { clsx, type ClassValue } from "clsx";
|
||||||
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Merge Tailwind class names, resolving conflicts (e.g. `bg-red-500 bg-green-500`
|
||||||
|
* collapses to the last one). This is the standard shadcn/ui helper.
|
||||||
|
*/
|
||||||
|
export function cn(...inputs: ClassValue[]) {
|
||||||
|
return twMerge(clsx(inputs));
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2017",
|
||||||
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
|
"allowJs": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"jsx": "preserve",
|
||||||
|
"incremental": true,
|
||||||
|
"plugins": [
|
||||||
|
{
|
||||||
|
"name": "next"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./src/*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { defineConfig } from "vitest/config";
|
||||||
|
import { resolve } from "path";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@": resolve(__dirname, "./src"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
test: {
|
||||||
|
// Domain logic (src/domain/**) is pure — node env is correct there.
|
||||||
|
// UI/component tests opt into jsdom per-file via `// @vitest-environment jsdom`.
|
||||||
|
environment: "node",
|
||||||
|
globals: true,
|
||||||
|
include: ["src/**/*.{test,spec}.ts", "src/**/*.{test,spec}.tsx"],
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user