Create your family
-Set up chores and how much each one is worth. Your kids join in seconds with an invite code.
++ Set up chores and how much each one is worth. Your kids join in seconds with an invite + code. +
From 40d7bf73982b72b277512382ea99cca5e01f02b5 Mon Sep 17 00:00:00 2001 From: JCEEE <0xjceee@proton.me> Date: Tue, 1 Sep 2026 11:58:43 +0100 Subject: [PATCH] final flows including emails for passwords --- frontend/package.json | 1 + frontend/src/env.ts | 20 +- .../src/lib/components/AccordionItem.svelte | 89 +- frontend/src/lib/components/Button.svelte | 101 +- frontend/src/lib/components/Sidebar.svelte | 2 +- frontend/src/lib/pocketbase.ts | 6 +- frontend/src/lib/server/email.ts | 45 + frontend/src/lib/server/member-otp.ts | 90 +- frontend/src/lib/server/migrate.ts | 1068 +++++++++-------- frontend/src/new-hooks.ts | 59 - frontend/src/routes/+page.svelte | 204 +++- frontend/src/routes/[fam]/+layout.svelte | 2 +- .../[fam]/[username]/settings/+page.server.ts | 75 +- .../[fam]/[username]/settings/+page.svelte | 522 +++++--- .../[fam]/join/[username]/+page.server.ts | 54 +- .../routes/[fam]/join/[username]/+page.svelte | 56 +- frontend/src/routes/api/email/+server.ts | 62 + frontend/src/routes/login/+page.svelte | 128 +- .../login/verify/[token]/+page.server.ts | 95 ++ .../routes/login/verify/[token]/+page.svelte | 114 ++ frontend/src/routes/logout/+page.server.ts | 3 +- pnpm-lock.yaml | 40 + 22 files changed, 1977 insertions(+), 859 deletions(-) create mode 100644 frontend/src/lib/server/email.ts delete mode 100644 frontend/src/new-hooks.ts create mode 100644 frontend/src/routes/api/email/+server.ts create mode 100644 frontend/src/routes/login/verify/[token]/+page.server.ts create mode 100644 frontend/src/routes/login/verify/[token]/+page.svelte diff --git a/frontend/package.json b/frontend/package.json index 5fa09a9..d35ee34 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -35,6 +35,7 @@ "chart.js": "^4.4.0", "pocketbase": "^0.27.0", "qrcode": "^1.5.4", + "resend": "^6.25.0", "stripe": "^22.5.0" } } diff --git a/frontend/src/env.ts b/frontend/src/env.ts index fdb3a00..bcfd3e1 100644 --- a/frontend/src/env.ts +++ b/frontend/src/env.ts @@ -1,16 +1,17 @@ import { defineEnvVars } from '@sveltejs/kit/hooks'; // Default when the env var isn't set, so a missing value never crashes startup. -const withDefault = (value: string) => ({ - '~standard': { - version: 1, - vendor: 'famchamp', - validate: (v: unknown) => ({ value: typeof v === 'string' && v ? v : value }) - } -} as const); +const withDefault = (value: string) => + ({ + '~standard': { + version: 1, + vendor: 'famchamp', + validate: (v: unknown) => ({ value: typeof v === 'string' && v ? v : value }) + } + }) as const; export const variables = defineEnvVars({ - SERVER_IP: { public: true, schema: withDefault('192.168.1.225') }, + SERVER_IP: { public: true, schema: withDefault('192.168.1.225') }, // PB superuser creds (server-only). PB_EMAIL: { public: false, schema: withDefault('debug@famchamp.dev') }, PB_PASSWORD: { public: false, schema: withDefault('debug123') }, @@ -28,5 +29,6 @@ export const variables = defineEnvVars({ STRIPE_PRICE_MONTHLY: { public: false, schema: withDefault('') }, STRIPE_PRICE_YEARLY: { public: false, schema: withDefault('') }, // Stripe publishable key (client-side for Checkout redirect). - PUBLIC_STRIPE_PUBLISHABLE_KEY: { public: true, schema: withDefault('') } + PUBLIC_STRIPE_PUBLISHABLE_KEY: { public: true, schema: withDefault('') }, + RESEND_API: { public: false, schema: withDefault('') } }); diff --git a/frontend/src/lib/components/AccordionItem.svelte b/frontend/src/lib/components/AccordionItem.svelte index a95f800..8fd2f8d 100644 --- a/frontend/src/lib/components/AccordionItem.svelte +++ b/frontend/src/lib/components/AccordionItem.svelte @@ -1,17 +1,24 @@
Free to get going. Takes about a minute.
Create my family- See pricing {@html chevronRightIcon} + See pricing {@html chevronRightIcon}
Already have a family? Log in
@@ -72,17 +79,26 @@
Set up chores and how much each one is worth. Your kids join in seconds with an invite code.
+ Set up chores and how much each one is worth. Your kids join in seconds with an invite
+ code.
+ They see today's chores as a simple card board and tick them off as they go — points are added instantly.
+ They see today's chores as a simple card board and tick them off as they go — points are
+ added instantly.
+ Points add up, then turn into pocket money on payday. Rewards and monthly bonuses keep it fun.
+ Points add up, then turn into pocket money on payday. Rewards and monthly bonuses keep it
+ fun.
+ Realtime sync across the whole family — see points and progress update the moment a chore is done.
+ Realtime sync across the whole family — see points and progress update the moment a chore
+ is done.
+ A simple, colourful interface kids love — big buttons, clear feedback, their own space.
+ A simple, colourful interface kids love — big buttons, clear feedback, their own space.
+ Everything is scoped to your family. Kids join with an invite code and stay in your family.
+ Everything is scoped to your family. Kids join with an invite code and stay in your
+ family.
+ Create your family
- Kids do the work
- Allowance pays out
- Live progress
- Automatic allowance
@@ -109,17 +128,27 @@
Kid-friendly
- Private by design
-
@@ -232,35 +269,53 @@
Group chores into seasons. Tick a season on to make it available for assignment; untick to disable it.
++ Group chores into seasons. Tick a season on to make it available for assignment; untick to + disable it. +