diff --git a/AMPLIFY_DEPLOY.md b/AMPLIFY_DEPLOY.md index 7e22b95..4d6006b 100644 --- a/AMPLIFY_DEPLOY.md +++ b/AMPLIFY_DEPLOY.md @@ -98,7 +98,7 @@ useful to confirm env vars are wired correctly. ## Step 4 — Custom domain (optional) -Amplify can attach a custom domain (e.g. `check-in.fci.coop`) with +Amplify can attach a custom domain (e.g. `survey.fci.coop`) with auto-issued TLS in a few minutes: 1. In the app, **Hosting** → **Custom domains** → **Add domain**. diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 3532b2a..66a1523 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -28,7 +28,7 @@ Verify all of the above against your live CiviCRM by hitting `/api/health` (in d | `CIVI_HTTP_AUTH_USER` | only if Civi sits behind webserver-level Basic Auth | HTTP Basic Auth username. | | `CIVI_HTTP_AUTH_PASS` | only if CIVI_HTTP_AUTH_USER is set | HTTP Basic Auth password. | | `HEALTH_TOKEN` | recommended | Long random string (e.g. `openssl rand -hex 32`). Required to access `/api/health` in production. If unset, that route returns 404. | - | `PUBLIC_ORIGIN` | optional | e.g. `https://check-in.fci.coop` — used in absolute self-links if needed later. | + | `PUBLIC_ORIGIN` | optional | e.g. `https://survey.fci.coop` — used in absolute self-links if needed later. | 3. **Trigger the first deploy.** Render will run `npm ci && npm run build` then `npm run start`. The platform health check hits `/healthz` (lightweight, no Civi dependency). @@ -37,7 +37,7 @@ Verify all of the above against your live CiviCRM by hitting `/api/health` (in d - `https:///api/health?token=` → all checks should be green - Visit `https:///?cid=&cs=` → form loads with prefill -5. **Custom domain (optional)** — Render dashboard → Custom Domain → add `check-in.fci.coop`. Update DNS to the provided CNAME. Render auto-issues a Let's Encrypt cert. +5. **Custom domain (optional)** — Render dashboard → Custom Domain → add `survey.fci.coop`. Update DNS to the provided CNAME. Render auto-issues a Let's Encrypt cert. ## Security defaults diff --git a/EMAIL_DELIVERY.md b/EMAIL_DELIVERY.md index df0ab07..432cd34 100644 --- a/EMAIL_DELIVERY.md +++ b/EMAIL_DELIVERY.md @@ -1,10 +1,10 @@ # Email link delivery -The check-in form is reached via a personalized URL that carries the +The survey form is reached via a personalized URL that carries the contact's CiviCRM ID + a server-issued checksum: ``` -https://check-in.fci.coop/?cid=&cs= +https://survey.fci.coop/?cid=&cs= ``` This document covers the three pieces needed to actually get those links @@ -24,10 +24,10 @@ The preview endpoint (#3) is a debugging convenience. In CiviCRM: 1. Navigate to **Mailings → Message Templates → Add Message Template**. -2. Title: `Co-op Check-in invitation` +2. Title: `Co-op Survey invitation` 3. Subject: ``` - Time for your co-op check-in + Time for your co-op survey ``` 4. Plain-text body (substitute your real domain): @@ -38,8 +38,8 @@ In CiviCRM: month. The form pre-fills your prior responses — you only need to update what's changed. - Open your check-in: - https://check-in.fci.coop/?cid={contact.contact_id}&cs={contact.checksum} + Open your survey: + https://survey.fci.coop/?cid={contact.contact_id}&cs={contact.checksum} The link is personalized to you and expires in 14 days. If you no longer have it, reply to this email and we'll send a fresh one. @@ -58,11 +58,11 @@ In CiviCRM: what's changed.

- - Open your check-in + Open your survey

@@ -95,14 +95,14 @@ Best for: low volume, one-at-a-time, or you want to review each send. 1. Open the **organization's contact record** in CiviCRM. 2. **Relationships** tab → find the row with **"Primary Contact"** → click the related individual's name. 3. On the individual's contact view: **Actions → Send Email**. -4. **Use Template**: select `Co-op Check-in invitation`. The subject and body populate; tokens render in the preview. +4. **Use Template**: select `Co-op Survey invitation`. The subject and body populate; tokens render in the preview. 5. **Send**. CiviCRM logs the email as an Activity on the contact. Repeat per contact. Slow but bulletproof. ### Option B — Bulk: CiviMail (campaign-style send) -Best for: send the check-in invitation to every active co-op at once (e.g. monthly). +Best for: send the survey invitation to every active co-op at once (e.g. monthly). 1. Build a Smart Group of contacts whose Primary Contact relationships point at orgs in active stages. Example query: - **Contacts** → **Advanced Search** @@ -112,7 +112,7 @@ Best for: send the check-in invitation to every active co-op at once (e.g. month 2. **Mailings → New Mailing**. 3. Recipients: the smart group above. -4. Choose template: `Co-op Check-in invitation`. +4. Choose template: `Co-op Survey invitation`. 5. Schedule send. Each recipient gets their own checksum embedded in the URL — CiviMail @@ -125,10 +125,10 @@ Best for: a button-on-the-org-record workflow. Setup: 1. **Administer → CiviRules → Manage Rules → New Rule**. -2. Title: `Send Co-op Check-in invitation`. +2. Title: `Send Co-op Survey invitation`. 3. **Trigger**: pick a "manually trigger from org row" action if your CiviRules version supports it. Otherwise: trigger on org Stage change (auto-fires when staff advance an org). 4. **Action**: `Send email to contact via message template`. - - Template: `Co-op Check-in invitation`. + - Template: `Co-op Survey invitation`. - Recipient: **Contact in relationship** → "Primary Contact" → side B (the Individual). 5. Save. @@ -153,7 +153,7 @@ contact/org context for verification. **Request:** ```bash -curl "https://check-in.fci.coop/api/preview-link?cid=513&token=$HEALTH_TOKEN" +curl "https://survey.fci.coop/api/preview-link?cid=513&token=$HEALTH_TOKEN" ``` **Response:** @@ -165,7 +165,7 @@ curl "https://check-in.fci.coop/api/preview-link?cid=513&token=$HEALTH_TOKEN" "orgId": 9609, "orgName": "A Sample Food Co-op", "orgStage": "Organizing", - "url": "https://check-in.fci.coop/?cid=513&cs=8d1f...", + "url": "https://survey.fci.coop/?cid=513&cs=8d1f...", "checksum": "8d1f...", "ttlHours": 336 } diff --git a/README.md b/README.md index a7fab2a..1d13939 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Co-op Check-in +# Co-op Survey A tokenized, mobile-friendly web form that lets external co-op contacts update their organization's tracking data on CiviCRM, plus a read-only @@ -11,8 +11,8 @@ Each co-op has a designated **Primary Contact** (the individual) linked to the **Organization** record in CiviCRM. Staff send that contact a personalized link generated against the contact's CiviCRM checksum: -- `https://check-in.fci.coop/?cid=&cs=` — the form -- `https://check-in.fci.coop/report?cid=&cs=` — the report +- `https://survey.fci.coop/?cid=&cs=` — the form +- `https://survey.fci.coop/report?cid=&cs=` — the report When the link is opened, the app verifies the checksum against CiviCRM, resolves the organization through the Primary Contact relationship, and @@ -24,12 +24,12 @@ Build → Fulfill & Stabilize). The org's current stage controls which sections are editable; past and current stages are open for editing, future stages render as previews with their fields locked so the co-op can see the framework ahead. Fields prefill with each value's most -recent non-empty entry from past check-ins. On submit, a new +recent non-empty entry from past surveys. On submit, a new "Check-in (organizing)" activity is created; nothing is overwritten. **Stage authority.** The current stage is derived from the most recent "Check-in (organizing)" activity whose Stage field is set. Staff own -stage transitions by manually setting Stage on a check-in activity they +stage transitions by manually setting Stage on a "Check-in (organizing)" activity they create; the form itself never writes Stage, so org self-submissions can't override a staff transition. Orgs with no stage-bearing activity default to "Inquiry." diff --git a/app/api/preview-link/route.ts b/app/api/preview-link/route.ts index e3b58ee..94aa23a 100644 --- a/app/api/preview-link/route.ts +++ b/app/api/preview-link/route.ts @@ -1,7 +1,7 @@ /** * GET /api/preview-link?cid=&token= * - * Returns a ready-to-send check-in URL for a given contact, plus enough + * Returns a ready-to-send survey URL for a given contact, plus enough * context for staff to verify it's the right org. Used for: * - Generating links to paste into ad-hoc emails (or external tools) * - Testing a contact's setup before sending the real CiviCRM email diff --git a/app/api/report/route.ts b/app/api/report/route.ts index 86c6ab1..26a8d2e 100644 --- a/app/api/report/route.ts +++ b/app/api/report/route.ts @@ -49,11 +49,11 @@ const STUB_PAYLOAD: ReportPayload = (() => { orgName: "Sample Co-op (stub)", currentStage: "Organizing", activities: [ - { id: 9012, date: daysAgo(3), subject: "Co-op Check-in (form submission)" }, - { id: 9008, date: daysAgo(34), subject: "Co-op Check-in (form submission)" }, + { id: 9012, date: daysAgo(3), subject: "Co-op Survey (form submission)" }, + { id: 9008, date: daysAgo(34), subject: "Co-op Survey (form submission)" }, { id: 9001, date: daysAgo(62), stage: "Organizing", subject: "Stage transition (staff)" }, - { id: 8995, date: daysAgo(95), subject: "Co-op Check-in (form submission)" }, - { id: 8980, date: daysAgo(180), stage: "Inquiry", subject: "Initial check-in (staff)" }, + { id: 8995, date: daysAgo(95), subject: "Co-op Survey (form submission)" }, + { id: 8980, date: daysAgo(180), stage: "Inquiry", subject: "Initial survey (staff)" }, ], fieldHistory: { Peer_Group_Participation: [ diff --git a/app/api/submit/route.ts b/app/api/submit/route.ts index 6dce70b..dde4046 100644 --- a/app/api/submit/route.ts +++ b/app/api/submit/route.ts @@ -70,7 +70,7 @@ export async function POST(req: Request) { return NextResponse.json( { error: appEnv().isProduction - ? "Could not save your check-in. Please try again, or contact your engagement coordinator." + ? "Could not save your survey. Please try again, or contact your engagement coordinator." : `Save failed: ${redact(msg)}`, }, { status: 500 }, @@ -110,7 +110,7 @@ async function runSubmit(cid: string, cs: string, values: Record

A read-only summary of every value your co-op has shared through past - check-ins, grouped by stage. The most recent entry sits at the top of + surveys, grouped by stage. The most recent entry sits at the top of each row; expand a row to see how a number or note has changed over time.

diff --git a/components/EngagementForm.tsx b/components/EngagementForm.tsx index 364d027..9aeb48c 100644 --- a/components/EngagementForm.tsx +++ b/components/EngagementForm.tsx @@ -429,7 +429,7 @@ function SubmissionContextHeader({ }) { return (
-

Check-in for

+

Survey for

{orgName}

@@ -551,7 +551,7 @@ function SubmitBar({ } else if (state.kind === "submitting") { secondary = (

- Saving your check-in… + Saving your survey…

); } else if (viewedSectionLabel && viewedRank != null) { @@ -604,10 +604,10 @@ function SubmitBar({ > {state.kind === "submitting" ? ( <> - Saving check-in… + Saving survey… ) : ( - <>Submit check-in + <>Submit survey )} @@ -636,7 +636,7 @@ function LoadingState() { aria-hidden className="mx-auto mb-4 h-7 w-7 animate-spin rounded-full border-[1.5px] border-rule border-t-leaf-700" /> -

Loading your check-in…

+

Loading your survey…

); } @@ -663,10 +663,10 @@ function SuccessDestination({

- Check-in saved + Survey saved

- Thank you. We've recorded this check-in for{" "} + Thank you. We've recorded this survey for{" "} {orgName}. Your engagement coordinator will see it on their next review.

@@ -676,7 +676,7 @@ function SuccessDestination({ onClick={onAnother} className="inline-flex items-center justify-center rounded-md border border-rule bg-paper px-5 py-2 text-sm font-medium text-ink-soft transition hover:bg-paper-2/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-leaf-500/40" > - Submit another check-in + Submit another survey

It's safe to close this window.

@@ -691,7 +691,7 @@ function ErrorState({ message }: { message: string }) { className="rounded-lg border-2 border-clay-200 bg-clay-100/30 px-6 py-7" >

- We couldn't open your check-in. + We couldn't open your survey.

{message}

diff --git a/components/ReportView.tsx b/components/ReportView.tsx index b9d99f2..be102ca 100644 --- a/components/ReportView.tsx +++ b/components/ReportView.tsx @@ -174,7 +174,7 @@ function ReportContextHeader({ {currentStageLabel || "—"}

- +

No entries on file yet.

- Your co-op's first check-in will appear here once it's submitted. + Your co-op's first survey will appear here once it's submitted.

); diff --git a/components/SiteChrome.tsx b/components/SiteChrome.tsx index d9d22f5..75f6814 100644 --- a/components/SiteChrome.tsx +++ b/components/SiteChrome.tsx @@ -19,7 +19,7 @@ export function SiteHeader() { className="h-12 w-auto sm:h-14" /> - Co-op Check-in + Co-op Survey