Roadmap v3: sign-in returns to where you came from; crosscode-site per phase

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-04 09:31:29 +02:00
co-authored by Claude Opus 5.5
parent ca7a14bcf8
commit 6a5aa29494
+52 -5
View File
@@ -115,6 +115,24 @@ touching anyone's account.
- Sign-in is the standard authorisation-code flow with PKCE. People sign in once at
`accounts.church.co.za` and are signed in to every product of that church.
- **Sign-in always returns you to where you came from.** When a product sends someone to
`accounts.church.co.za` (they clicked Sign in, or opened a page that needs sign-in), it passes
the exact page they were on (path and query, e.g. `/events/youth-camp/register?ticket=adult`)
in the OIDC `state`. After sign-in, Accounts sends them back to **that product and that page**,
not to a dashboard or the account page. This holds through every step in between: 2FA,
"forgot password" and the reset link, creating a new account, the news question and privacy
notice re-acceptance. (Cross Events works this way today with `?redirect=`; the move to Accounts
keeps it.)
- **Safe redirects only:** Accounts only returns to the registered `redirect_uri` of a linked
product of the same church (exact match, no wildcards), and the product only accepts a
relative path from `state` (starting with a single `/`). Anything else falls back to the
product's home page. No open redirects.
- **Signing out** works the same way (`post_logout_redirect_uri`): you end up back on the
product you signed out from, signed out of all of the church's products.
- Opening `accounts.church.co.za` directly (nothing to return to) shows the account page.
- Tests: Playwright checks for each product that signing in from a deep link (including through
2FA and a password reset) lands back on that exact page, and that a foreign or absolute
return URL is refused.
- **Accounts stays in the background** (decided 2026-11-03). Members never see it as a product:
the sign-in page carries the church's name and branding ("Sign in to Hope Family Church"), and
they manage their account from whichever product they're in. Only **admins** see Accounts as
@@ -141,6 +159,10 @@ This is a breaking change, so it's a major version.
table keeps its id (now equal to the account `sub`), role, campus scope and product data.
- Sign-in, forgot password, 2FA, the news question and the notice re-acceptance move to Accounts.
The Events privacy centre links to Accounts for account-level items.
- Every place Events sends someone to sign in today (`/login?redirect=…`, `useRequireAuth`, the
register / ticket flows) goes to Accounts with the current page as the return target, so
members land back exactly where they were (§3, "Sign-in always returns you to where you came
from"). Old `/login?redirect=…` links keep working by forwarding to Accounts with the same target.
- Staff accounts work the same way: roles stay in Events.
---
@@ -366,7 +388,7 @@ browsed without an account. Personal actions need sign-in through Accounts.
| `joshua/hope-events` | Cross Events (unchanged home) |
| `joshua/events-hub` | Cross Code Hub (renamed in the UI; repo name can stay) |
| `joshua/crosscode-platform` (new) | Monorepo: `apps/accounts`, `apps/website`, `apps/app`, `packages/contracts`, `packages/ui` |
| `joshua/crosscode-site` | The marketing site. The Church Website and Church App move from "coming later" to their own pages when they ship |
| `joshua/crosscode-site` | The marketing site (crosscode.co.za). Updated at the end of every phase that changes what's on sale or what a product does (see §9, "Updating crosscode-site") |
**Stack:** the same as Cross Events (Next.js, Express, TypeScript, Prisma, PostgreSQL, pg-boss,
Playwright, Jest), so code and habits carry over.
@@ -388,7 +410,28 @@ Playwright, Jest), so code and habits carry over.
| 7 | Church App 1.x | Reading plans, sermons, groups, pastoral care, serving, giving links, directory | After House of Prayer is in use |
Each phase adds help content, audit log entries, tests, a CHANGELOG entry and updates to the
docs. Branch → merge → tag → push per feature, as before.
docs. Branch → merge → tag → push per feature, as before. **A phase isn't done until
crosscode-site is updated** for it (below), where the phase changes anything the site says.
### Updating crosscode-site
The marketing site (`../crosscode-site`, crosscode.co.za) has to match what's actually shipped.
At the end of each phase, update it in the same sitting and deploy it (its `DEPLOYMENT.md`):
| Phase | What changes on crosscode-site |
|-------|--------------------------------|
| 0 contracts | Nothing |
| 1 Hub 2.0.0 | Bundle discounts (15% / 25%) and the address add-on (own domain R0 · Cross Code address R10 · domain included R25) in `src/data/pricing.mjs`, worded so it's clear the Website and App are still coming. Legal pages if billing terms change |
| 1b Events 2.2.0 | Authenticator app 2FA in the Cross Events feature list (`src/data/cross-events.mjs`) and the security / POPIA wording |
| 2 Events 2.3.0 | "Works with the Church Website and App" (event feed, Linked products) on the Cross Events page, as "coming" until those ship |
| 3 Accounts 1.0.0 | "One sign-in for all your church's products" on the Products page. Accounts isn't sold, so no page or price of its own |
| 4 Website 1.0.0 | **Church Website goes on sale:** `status: "available"` and its own page in `src/data/products.mjs` / `src/pages/products/`, R99 + storage add-on in `pricing.mjs`, screenshots from a demo church (fictional people only), FAQ, home page, contact form product list |
| 5 Events 3.0.0 | Cross Events page: sign-in through the church's shared account. Update screenshots that show the login |
| 6 App 1.0.0 | **Church App goes on sale:** own page, active-member tiers in `pricing.mjs`, House of Prayer screenshots, the bundle examples from §10 |
| 7 App 1.x | New modules added to the App page's feature list as each one ships |
Prices change in the Hub's `frontend/src/lib/tiers.ts` in the same phase, so the site and the
Hub never disagree. Run the site's tests and build before deploying it.
### Release checks (before selling a product)
@@ -397,6 +440,9 @@ docs. Branch → merge → tag → push per feature, as before.
- Stopping one church's install, or the Hub, leaves the others running.
- A feed source going down: its last events keep showing, the other sources keep working.
- Signing in once works across all of a church's products; deleting an account reaches every product.
- Signing in from any page of any product returns to that same page (including through 2FA and a
password reset), and a foreign return URL is refused.
- crosscode-site shows the product as available, with its page, prices and screenshots.
- A database backup is restored successfully.
---
@@ -487,9 +533,10 @@ as a band (like event income for Cross Events). Visitors browsing without signin
| 14 | Accounts visibility | Hidden from members (branded as the church's sign-in). Only admins and the account holder see account pages |
| 15 | 2FA | Add an **authenticator app** (TOTP, with recovery codes) next to email and WhatsApp: in Cross Events 2.2.0 first, then in Accounts |
| 16 | Pricing | Website **R99** with 5 GB, extra storage as an add-on in steps. App **R99** (up to 100 members), then **R249**. Address once per church: own domain R0, **Cross Code address R10**, **domain included R25**. Extra storage R20 per 5 GB; App tiers above 300 members R399 / R649 / R999 / from R1 500. Add-ons aren't bundle-discounted (§10) |
| 17 | Sign-in return | Signing in through `accounts.church.co.za` always returns to the product and page the person came from (through 2FA, reset, sign-up and notice steps), with exact-match redirect URIs only (§3) |
| 18 | Marketing site | crosscode-site is updated at the end of every phase that changes what's on sale or what a product does (§9) |
## Still open
Nothing. When the Website and App go on sale, put the §10 prices in
`crosscode-site/src/data/pricing.mjs` and the Hub's tiers (the Website and App move from "coming
later" to their own prices).
Nothing. crosscode-site is updated at the end of each phase (§9, "Updating crosscode-site"); the
Website and App move from "coming later" to their own pages and prices when they ship.