Files
crosscode-platform/apps/app/CHANGELOG.md
T
2026-12-01 11:06:17 +02:00

82 lines
6.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Changelog — Church App
## [Unreleased]
Being built for `app@1.0.0` (docs/APP-1.0-PLAN.md). Three migrations so far (`20261201000000_init`,
`20261202000000_house_of_prayer`, `20261203000000_prayer_requests`).
### Added
- **The foundation** (plan §1, §2, §10, §12): `backend/` (Express, Prisma, pg-boss) and
`frontend/` (Next.js 16), as the Website.
- The Hub: registers with a `CCP-` key from `HUB_LICENCE_KEY`, a heartbeat every 15 minutes with
`hub.appStatsSchema` (the active-member band, the modules on; prayer, announcement and message
counts 0 until their modules arrive), the licence checked offline.
- Links: Connect and Disconnect (`crosscode.link/1`) with Accounts, Events and the Website; links
itself to Accounts once the Hub lists it; `church.changed` from Accounts.
- Signing in through Accounts (`@crosscode/auth-client`), back to the exact page. Everyone signed
in is a Member (`Member`, keyed by the account's `sub`, a copy of the profile with the verified
phone number and the WhatsApp opt-out). A sign-in lasts 8 days, renewed by each visit, never
past 90 days from the sign-in (`SESSION_DAYS`, `SESSION_MAX_DAYS`). Back-channel logout.
- Roles (Owner, Church admin, Content admin, Devotional writer, Prayer coordinator, Pastoral
care): only with a 2FA sign-in (`TWO_FACTOR_NEEDED` otherwise; the admin's sign-in asks Accounts
for a second step). The first Owner from `HUB_ADMIN_EMAIL`, verified.
- Active members: `lastActiveAt`, at most one write a day in the church's timezone; the band in
the heartbeat and on the dashboard.
- Modules switched on and off (`modules` setting, `PUT /api/v1/admin/modules`, Owner and Church
admin, audited).
- `GET /api/v1/app`: the church profile, its colours made safe, font pairing and corners, the
modules on, the timezone.
- The frontend's shell: header, bottom tab bar, the church's footer, the manifest and icons
(`/app-icon/192|512|maskable|apple|favicon`), the service worker (`public/sw.js`), "Add to home
screen", the offline notice and page, Me, the admin's first dashboard, the sign-in problem page.
- **The House of Prayer** (plan §3):
- Slots of the church's length (60 minutes by default; 15 or 30) in its timezone, daylight saving
included (`src/lib/zoned.ts`). Commitments are rules (`PrayerCommitment`: start, length, once /
daily / weekly, end) plus skipped dates (`PrayerSkip`), never a row per occurrence
(`src/prayer/rules.ts`).
- The day's coverage as counts only (`GET /api/v1/prayer/day`; `mine` for the signed-in member),
cached until a booking changes; live over server-sent events (`/api/v1/prayer/stream`,
`X-Accel-Buffering: no`, a comment every 25 seconds), polling every 30 seconds without it.
- A member books just once, every week or every day (up to 12 months), several slots in a row, a
reminder and its channel; skips a date, changes or stops it outside the cancel window (8 hours by
default; inside it, who to contact); renews for another year; marks "I prayed" (self-reported)
for slots that ended in the last 14 days. A new time or days ends the old rule and starts a new
one, so the past stays as it was.
- Signed links that need no sign-in (`src/prayer/tokens.ts`): **Renew** (single use: signed over
the end date) and **I prayed**, each on a page that asks for the tap (`/prayer/renew`,
`/prayer/prayed`).
- Campaigns (`PrayerCampaign`: days left, coverage so far, hours prayed; their own target per slot)
and testimonies (`Testimony`: moderated first, first name or Anonymous, removable by the author,
the reason sent when one isn't shared).
- The admin (`/admin/prayer`; Prayer coordinator, Owner, Church admin): the week's coverage and
gaps, who prays when (names, each view in the new `AccessLog`), booking for a member, cancelling
any slot, the wall's rules (AppSetting `prayer_wall`), campaigns, testimonies.
- Jobs: `prayer-reminders` (every minute) and `prayer-renewals` (09:00; 14 and 3 days before the
end) queue messages in `OutboxMessage`; sending them by email and WhatsApp comes with plan §8.
- The heartbeat's `prayer` counts (last 7 days' coverage, active commitments); `user.export` and
`user.deleted` cover commitments, "I prayed" marks and testimonies (future slots open up, the
past stays as counts only).
- Screens: the 24-hour clock on the Prayer tab (tap an hour, Cover it / Join, the open hours as
buttons, back from signing in with the slot's sheet open), the booking sheet, Me → My prayer,
sharing a testimony, and Home's small clock with the next gap and your next slot.
- **Prayer requests** (plan §4, `src/requests/`):
- `PrayerRequest`: the prayer team only (the default) or members of the church, after a
coordinator approves it, with the first name or "Anonymous"; fully anonymous (the team doesn't
see who either) only when the church allows it (AppSetting `prayer_requests`, off by default).
Never public, never in stats, the heartbeat or a message's text.
- Coordinators approve, edit out details (the sender sees what changed) or don't share (with a
reason); anyone on the team replies privately (`PrayerRequestUpdate`, author `team`) or
escalates: Pastoral care is told at once by email and WhatsApp (an Owner or Church admin when
nobody has the role); the request leaves the shared list and the sender sees nothing different.
- Members tap "I prayed" (`RequestPrayer`: the sender sees how many, never who); the sender adds
"Answered!", closes or deletes it. Requests close after 30 days (7–90) and are deleted 12 months
after closing (`prayer-requests-tidy`, 03:30).
- Every admin list with senders goes in the access log (now `src/lib/accessLog.ts`). Export and
delete cover a member's requests.
- Screens: Ask for prayer (who sees it, the emergency numbers, South African by default), Pray for
others, My prayer requests, and the admin's Prayer requests (waiting, open, escalated, closed,
settings). The Prayer tab shows with either prayer module.
- `env.template.json` (read by the Hub at the tag), `ecosystem.config.example.cjs` (ports 5400 / 3400
in development).