Add transactional emails (SMTP) and planner features (no-go areas, notes, crash recovery)
Transactional emails: - Add nodemailer SMTP email module with dev-mode console logging - Magic link template and welcome template with HTML + plain text - Wire sendMagicLink into login flow, sendWelcome into registration - Update privacy page and deploy docs for SMTP configuration Planner features: - No-go areas: draw polygons on map (leaflet-geoman), synced via Yjs, passed to BRouter as nogos parameter, route recomputes on change - Session notes: collaborative Y.Text textarea in sidebar tab - Crash recovery: periodic localStorage save of Yjs state, restore on reconnect - Rate limit session creation (10/IP/hour) in /new route Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
05b5f6febf
commit
0a8dd0b766
27 changed files with 1030 additions and 69 deletions
|
|
@ -1,30 +1,30 @@
|
|||
## 1. Email Infrastructure
|
||||
|
||||
- [ ] 1.1 Add `resend` package to Journal dependencies
|
||||
- [ ] 1.2 Create `apps/journal/app/lib/email.server.ts` with sendEmail(to, subject, html, text) — uses Resend in production, logs to console in dev
|
||||
- [ ] 1.3 Add `RESEND_API_KEY` env var to docker-compose.yml
|
||||
- [ ] 1.4 Write unit test for sendEmail (mock Resend, verify dev-mode logging)
|
||||
- [x] 1.1 Add `nodemailer` package to Journal dependencies
|
||||
- [x] 1.2 Create `apps/journal/app/lib/email.server.ts` with sendEmail(to, subject, html, text) — uses SMTP in production, logs to console in dev
|
||||
- [x] 1.3 Add `SMTP_URL` and `SMTP_FROM` env vars to docker-compose.yml
|
||||
- [x] 1.4 Write unit test for sendEmail (mock nodemailer, verify dev-mode logging)
|
||||
|
||||
## 2. Email Templates
|
||||
|
||||
- [ ] 2.1 Create magicLinkTemplate(link: string) returning { html, text } — includes link, 15-min expiry note, trails.cool branding
|
||||
- [ ] 2.2 Create welcomeTemplate(username: string) returning { html, text } — greeting, what they can do, link to routes
|
||||
- [ ] 2.3 Wire sendMagicLink(email, link) and sendWelcome(email, username) helper functions
|
||||
- [x] 2.1 Create magicLinkTemplate(link: string) returning { html, text } — includes link, 15-min expiry note, trails.cool branding
|
||||
- [x] 2.2 Create welcomeTemplate(username: string) returning { html, text } — greeting, what they can do, link to routes
|
||||
- [x] 2.3 Wire sendMagicLink(email, link) and sendWelcome(email, username) helper functions
|
||||
|
||||
## 3. Integration
|
||||
|
||||
- [ ] 3.1 Update api.auth.login.ts: call sendMagicLink in production instead of just logging
|
||||
- [ ] 3.2 Update registration flow: call sendWelcome after successful passkey registration
|
||||
- [ ] 3.3 Verify dev mode still works (devLink returned, no email sent)
|
||||
- [x] 3.1 Update api.auth.login.ts: call sendMagicLink in production instead of just logging
|
||||
- [x] 3.2 Update registration flow: call sendWelcome after successful passkey registration
|
||||
- [x] 3.3 Verify dev mode still works (devLink returned, no email sent)
|
||||
|
||||
## 4. Privacy & Config
|
||||
|
||||
- [ ] 4.1 Update /privacy page: document email sending, provider (Resend), what data is shared
|
||||
- [ ] 4.2 Add `RESEND_API_KEY` to CD secrets and deploy documentation
|
||||
- [ ] 4.3 Document sender domain DNS setup (DKIM/SPF for noreply@trails.cool)
|
||||
- [x] 4.1 Update /privacy page: document email sending, provider (Resend), what data is shared
|
||||
- [x] 4.2 Add `SMTP_URL` to server env and deploy documentation
|
||||
- [x] 4.3 Document sender domain DNS setup (SPF/DKIM/DMARC for noreply@trails.cool)
|
||||
|
||||
## 5. Verify
|
||||
|
||||
- [ ] 5.1 Test magic link email delivery locally with Resend test API key
|
||||
- [ ] 5.2 Test welcome email on registration
|
||||
- [ ] 5.3 Verify existing E2E tests still pass (dev mode unchanged)
|
||||
- [x] 5.1 Test magic link email delivery locally with SMTP
|
||||
- [x] 5.2 Test welcome email on registration
|
||||
- [x] 5.3 Verify existing E2E tests still pass (dev mode unchanged)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue