add embedded checkout

This commit is contained in:
JCEEE
2026-08-20 07:35:31 +01:00
parent c6e987a852
commit 397543c880
45 changed files with 5731 additions and 334 deletions
+8 -5
View File
@@ -12,7 +12,7 @@
- SvelteKit (SSR frontend, internal :2080) + Hono proxy (internal :3456) + nginx (container :3001)
- PocketBase (separate Coolify service at `pb.chores.app.com`, :8090)
- Stripe one-time donations — **not implemented** (only `settings.webhookUrl` exists)
- Stripe payments (subscriptions) — **planned in SvelteKit server routes** (`/account` + `/account/webhook`), NOT the Hono proxy. Not yet implemented (only `settings.webhookUrl` + `fams.stripeCustomerId` exist).
- Coolify CRON → `GET /api/weekly-cron` — **not implemented** (weekly settlement is manual via `complete-week`/`simulateEow`)
- Deployment: Coolify, Cloudflare DNS
@@ -59,8 +59,11 @@
/{fam}/{username}/ledger Rewards / chores / todos ledger
/{fam}/{username}/bonuses Bonus configs & evaluation
/{fam}/{username}/preferences User preferences (parent→users, member→users)
/{fam}/{username}/settings Family admin settings (parent only)
/api/* Hono proxy (data layer; webhooks/CRON not implemented)
/{fam}/{username}/settings Family admin settings (parent only) — includes Stripe connect/manage + pause
/account Account/billing — payment setup & subscription management (Stripe)
/subscriptions 3-tier plan page (trial | monthly | yearly), access via settings
/account/webhook Stripe webhook handler (server route)
/api/* Hono proxy (data layer; CRON not implemented)
```
## Data Flow
@@ -78,7 +81,7 @@
- **Member updates:** Browser → Hono proxy → PB (auth via `Bearer <pb_token>`)
- **Reward creation:** After completion toggle, Hono proxy creates reward if threshold met
- **Weekly settlement:** NOT via CRON — manual `complete-week` action or `simulateEow` preview in settings. `/api/weekly-cron` (Coolify) is not implemented.
- **Stripe / WhatsApp:** not implemented — only the `settings.webhookUrl` field exists.
- **Stripe:** implemented in SvelteKit server routes — `/account` (setup/manage subscription) + `/account/webhook`. Lives in the frontend app, NOT the Hono proxy. **WhatsApp:** not implemented.
### UI reactivity
@@ -244,7 +247,7 @@ All admin and member pages use the following pattern:
3.5 Reward claim flow + admin CRUD
3.6 Monthly bonus evaluation
3.7 CRON handler (Coolify → Hono)
3.8 Stripe checkout + webhook
3.8 Stripe checkout + webhook (SvelteKit `/account` server routes, not Hono)
3.9 Notification interface (WhatsApp deferred)
### Phase 4 — Frontend App