scripts/products/app.sh and app.env.template.json; app in SUPPORTED_PRODUCTS; crosscode add <church> app (Accounts first); crosscode demo <church> app --profile <s>, and the App's turn, last, in a whole demo scenario. app.bats and demo.bats; app.sh linted. The full bats suite wasn't run (stopped for low memory); app.bats and demo.bats pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 KiB
15 KiB
Changelog — Church App
[Unreleased]
Being built for app@1.0.0 (docs/APP-1.0-PLAN.md). Six migrations so far (20261201000000_init,
20261202000000_house_of_prayer, 20261203000000_prayer_requests, 20261204000000_content,
20261205000000_messaging, 20261206000000_media).
Ships @crosscode/seo 1.1.0 (articleJsonLd, workspace).
Added
- The foundation (plan §1, §2, §10, §12):
backend/(Express, Prisma, pg-boss) andfrontend/(Next.js 16), as the Website.- The Hub: registers with a
CCP-key fromHUB_LICENCE_KEY, a heartbeat every 15 minutes withhub.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.changedfrom Accounts. - Signing in through Accounts (
@crosscode/auth-client), back to the exact page. Everyone signed in is a Member (Member, keyed by the account'ssub, 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_NEEDEDotherwise; the admin's sign-in asks Accounts for a second step). The first Owner fromHUB_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 (
modulessetting,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 Hub: registers with a
- 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;minefor 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 newAccessLog), booking for a member, cancelling any slot, the wall's rules (AppSettingprayer_wall), campaigns, testimonies. - Jobs:
prayer-reminders(every minute) andprayer-renewals(09:00; 14 and 3 days before the end) queue messages inOutboxMessage, sent by email and WhatsApp (plan §8, below). - The heartbeat's
prayercounts (last 7 days' coverage, active commitments);user.exportanduser.deletedcover 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.
- Slots of the church's length (60 minutes by default; 15 or 30) in its timezone, daylight saving
included (
- 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 (AppSettingprayer_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, authorteam) 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.
- Announcements (plan §5,
src/content/announcements.ts): title, markdown text (shown without HTML,react-markdown), image, an optional button, a campus from the church profile, everyone or members only, pinned, a publish time and an end. Public ones are pages of their own (canonical, Article JSON-LD, in the sitemap); members-only ones ask for a sign-in and are noindex. Content admins write them (/admin/announcements). "Also send it" by email or WhatsApp sends it once, at the publish time (§8, below). The heartbeat counts the last 30 days. - Devotionals (plan §6,
src/content/devotionals.ts): Cross Code's from the Hub (crosscode-devotionals, 01:15, and Sync now: the next 2 weeks from today in the church's timezone, with the licence; exactly those days replaced, earlier ones kept, so a Hub outage changes nothing), or the church's own (Settings → Devotionals, AppSettingdevotionals_source), written by Devotional writers or imported from the Hub's CSV (a preview first; days already filled kept or replaced). Only KJV and BSB. The passage in full with its copyright line (and a disclaimer where there is one) and Read in YouVersion; today's from midnight or the most recent; the archive by month; members-only ones; the Acknowledgements page; Article JSON-LD. - Events (plan §7,
src/events/): simple events made by Content admins in the church's timezone (/admin/events), and the event feed both ways, as the Website's: the App's own published ascrosscode.event/1(/api/feed/v1/events, removals for 90 days,event.changedto siblings), and read-only copies of Cross Events' and the Website's (event-feed, every 15 minutes and on theirevent.changed) with Register on the Events site and a canonical to the origin. Event JSON-LD on the App's own events only. Linked products: publish, and show events from each sibling. - Email and WhatsApp (plan §8,
src/messaging/):- The church's one set of settings from Accounts (
messaging.get; the SMTP password and WAWP token sealed with the link's secret, kept encrypted in AppSettingmessaging_settings): fetched when the App links to Accounts, on Accounts' signedmessaging.changed(/api/accounts/v1/messaging-changed), once a day, and on Fetch again. The App never asks for its own (decision 4); the last copy keeps working while Accounts can't be reached. messages-send(every minute,MESSAGES_ENABLED): the outbox, 100 a run, email (nodemailer) and WhatsApp (WAWP), laid out as Accounts' and Events' emails with a plain-text version. STOP is checked before every WhatsApp (the member'swhatsapp_opted_outfrom Accounts, and anyone in the App with the same number). What a member asked for (reminders, renewals, notices, the devotional) goes by email when WhatsApp can't reach them; announcements never do. Tried again after 2, 4, 8 and 16 minutes, then given up; a reminder never after its slot started, nothing more than 3 days late; while the church has neither email nor WhatsApp, messages wait. No prayer request's text in any message.announcement-sends(every minute): "Also send it" once at the publish time, to members who turned announcements on, on the channels the admin chose and the member allows (their choice and their news consent in Accounts, now kept asMember.newsEmail/newsWhatsApp).devotional-sends(every 5 minutes): today's devotional at each member's time (06:00 by default), once a day, with the title, the verse and its translation's notice, and a link.- Me → What the App sends me (
NotificationSettings): email, WhatsApp, both or off for request updates (email by default), announcements and the devotional (off), the devotional's time; WhatsApp only to a verified number that hasn't replied STOP. Home offers the devotional once after the first sign-in. Booking a slot picks WhatsApp for its reminder when it reaches them. - Admin → Email and WhatsApp (Owner, Church admin): the address and WAWP instance it sends from (no secrets), where they're changed (Cross Events or Accounts), Fetch again, Send me a test (email or WhatsApp), what's waiting and what wasn't sent in 7 days.
- Counts per day and channel (
MessageCount) for the heartbeat'smessages.email30d/whatsapp30d;user.exporthas the notification choices, deleted with the account.
- The church's one set of settings from Accounts (
- The admin (plan §10,
src/admin/):- One frame for every admin page, as the Website's and Events' (decision 9): a bar across the top, a white side menu in groups showing only what the person's roles and the modules allow, a drawer on a phone.
- The dashboard: the setup checklist for an Owner or Church admin (the church's details and icon, the wall's rules, prayer coordinators, a first announcement, sharing the App), active members, modules and connections, what waits for the prayer team (requests, testimonies, escalations), this week on the prayer wall with its gaps, and recent changes.
- Members and roles (Owner, Church admin): members searched by name or email; roles given and
taken (only an Owner makes or changes an Owner, nobody changes their own), or someone added by
email with a role through Accounts'
people.ensure. - Settings: modules on and off, the licence and active members, and each module's settings. Background jobs: each job's switch and schedule (winning over the .env) and Run now. Audit and access logs in plain words, 100 at a time.
- Share the App: its link and a printable A4 poster with a QR code (
qrcode, drawn on the server); "I've shared it" ticks the checklist.
- Uploaded images (
src/media/, migrationmedia): photos for announcements, campaigns and events, checked by their bytes, turned upright, stripped of their metadata and kept at most 2000 px wide in backend/uploads (UPLOAD_DIR), served at/api/uploads; 5 GB or the licence's storage; one in use can't be deleted. The forms have Upload a photo next to the address. - Backups (
src/backups/, as the Website's): a gzippedpg_dumpevery night (backup, 02:40) and on Back up now (app-YYYYMMDD-HHMMSS.sql.gz, the newest 14 kept), then a snapshot of the uploads hard-linking what hasn't changed; Settings → Backups lists, downloads (audited) and sets them. The heartbeat reports the newest backup. - The church export (plan §11,
src/export/,scripts/export-church.ts): theapppart ofcrosscode.church-export/1: members with their roles, the wall, commitments as rules, "I prayed", campaigns, testimonies, prayer requests with their moderation, the emergency numbers, announcements, the church's own devotionals and events, and the uploads; no internal ids. - The demo scenarios (plan §12,
src/demo/,scripts/demo.ts):npm run demoloads Acacia Hill;--profile <scenario>(with--scenario, as the agent sends it) any of the eight demo churches, around@crosscode/demo's people with the same account ids as Accounts, so their sign-ins find them. Each is in its scenario's active-member band (0–100 to 2 001–5 000), with its leads' roles; three months of prayer commitments with the scenario's coverage (a quiet parish wall, 30-minute slots in the Karoo, every hour twice at Northpoint, students on the 02:00 slots), a few skips and renewals due, "I prayed" on most of the last three weeks; a campaign (Lent from Ash Wednesday to Easter Eve for St Columba's), testimonies, prayer requests waiting for approval, announcements (per campus at Riverside, in Afrikaans in the Karoo), and Harbour City's setup checklist half done. Devotionals: Cross Code's fetched from the Hub, or the church's own for St Columba's (KJV), Harbour City and Karoo Gemeenskapskerk (Afrikaans, quoting the BSB). Events come from Cross Events (else the Website) through the feed when linked, else the App's own. Demo members of an earlier scenario go; real members and their roles stay; an App whose real members have used it needs--force. - The demo devotionals' passages are copied word for word from the public-domain KJV and BSB by
scripts/demo-passages.tsintosrc/demo/passages.ts(no Bible text typed or generated). - Nothing is sent to a demo person (an address at
example.com): the sender marks their messages done without sending (isDemoPerson). - The
crosscodescript (ships with this release):scripts/products/app.sh(the Website's hooks for the App: ports 5400 / 3400,contracts,ui,auth-client,seoanddemo, backups asapp-*.sql.gz, the export and uploads),scripts/products/app.env.template.json,appinSUPPORTED_PRODUCTS;crosscode add <church> app(onapp.<address>, Accounts first);crosscode demo <church> app --profile <s>and the App's turn, last, in a whole scenario (crosscode demo <church> --scenario <s>); bats tests (app.bats,demo.bats). - Home shows today's devotional, the latest announcements (pinned first) and what's on. A sitemap
of the public pages (
/sitemap.xml, never prayer, members-only items or imported events), named in robots.txt.GET /api/v1/appgives the App's own address (url). env.template.json(read by the Hub at the tag),ecosystem.config.example.cjs(ports 5400 / 3400 in development).