Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AfterWord Banner
Typing Animation

🎬   See It In Action

Watch Demo on Google Drive

πŸ“‚ Or watch locally: demo/Afterword_Digital_Legacy.mp4


Next.js TypeScript Convex Tailwind CSS HuggingFace MIT License

Status Infrastructure Cost Accounts in DB PRs Welcome



✦   The Problem

When a person dies, their family inherits a digital life they never asked to manage.

100 online accounts. Banks, streaming services, social media, government portals, insurance, healthcare, e-commerce β€” all sitting open, many still billing.

15 months is the average time a family spends trying to close them.
$2,160/year in subscriptions continue charging the estate.
0 tools existed to help β€” until now.

3,600,000  US deaths per year
      100  avg accounts per person
   15 mo.  avg digital estate closeout
   $2,160  avg annual ghost charges
        0  open-source tools (before this)

"94.5% of families report the digital estate process caused physical and mental health deterioration on top of their grief." β€” Empathy Cost of Dying Report, 2024



✦   The Solution

╔═══════════════════════════════════════════════════════════════════════╗
β•‘                                                                       β•‘
β•‘        πŸ§“  OWNER                              πŸ‘€  FAMILY              β•‘
β•‘        Plans ahead                            Closes accounts         β•‘
β•‘                                                                       β•‘
β•‘   Add accounts + notes          Unlock trigger: name + date + state   β•‘
β•‘   Choose invitees + roles     β†’ Trusted guardian receives OTP code    β•‘
β•‘   Name a trusted guardian     β†’ Estate unlocks + invites fire         β•‘
β•‘   Update vault anytime        β†’ AI letters + playbooks + tracking     β•‘
β•‘                                 ↓                                     β•‘
β•‘                          Evidence bundle for probate                  β•‘
β•‘                                                                       β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Afterword is a two-sided platform. A living person can set up their estate in 20 minutes β€” adding accounts, writing executor notes, and designating a trusted guardian who controls the unlock key. When they pass, their family unlocks the estate through a two-factor verification system, then follows AI-generated playbooks to close every account.

No prior setup required. If the deceased never used Afterword, the family can still use every feature β€” manual account entry, AI letter generation, real-time Kanban tracking, and the evidence bundle β€” without any pre-registration.



πŸ”‘ Β  The Trusted Guardian Unlock

The most security-critical feature. Two factors are required to unlock an estate β€” neither alone is sufficient.

Step Factor What It Is What It Prevents
1 Knowledge Deceased's full legal name + date of passing + state Requires genuine knowledge of the deceased
2 Possession 6-digit OTP emailed to the trusted guardian Blocks anyone who read an obituary
Anyone β†’  /unlock  β†’  Enter name + date + state
                              ↓
                    [Match found in estate DB]
                              ↓
                    OTP β†’ Guardian's email inbox
                              ↓
              Guardian verifies request is legitimate
                              ↓
                    Guardian shares 6-digit code
                              ↓
                    Estate unlocks. Invitations fire.

Why not just the death date? Obituaries are public. Anyone can know a name, death date, and state. The trusted guardian is the human firewall that no algorithm can replace.



πŸ€– Β  AI Legal Letters β€” Powered by Saul-Instruct-v1

Model: Equall/Saul-Instruct-v1
Training: 30 billion tokens of legal text
License: MIT
Cost: Free via HuggingFace Serverless Inference

Afterword generates a unique legal closure letter for every account, tailored by urgency tier:

  • πŸ”΄ CHARGING β€” Immediate cancellation + refund demand
  • 🟠 IDENTITY β€” Closure + data deletion + CCPA/GDPR reference
  • πŸ’™ SENTIMENTAL β€” Data export request before closure
  • βšͺ ADMIN β€” Standard administrative closure

Letters are RUFADAA-aware β€” the Revised Uniform Fiduciary Access to Digital Assets Act is referenced automatically for the 46 states that have adopted it. Every letter is editable inline before sending.



πŸ—οΈ Β  Architecture

afterword/
β”œβ”€β”€ apps/
β”‚   └── web/
β”‚       β”œβ”€β”€ app/                        # Next.js 15 App Router
β”‚       β”‚   β”œβ”€β”€ page.tsx               # Landing β€” dual-path hero
β”‚       β”‚   β”œβ”€β”€ unlock/                # Estate unlock trigger
β”‚       β”‚   β”œβ”€β”€ verify/[token]/        # Invitee verification gate
β”‚       β”‚   β”œβ”€β”€ dashboard/             # Owner vault
β”‚       β”‚   β”‚   β”œβ”€β”€ new/               # Account creation
β”‚       β”‚   β”‚   └── preview/           # Dry-run mode
β”‚       β”‚   β”œβ”€β”€ setup/                 # Owner setup flow
β”‚       β”‚   β”‚   β”œβ”€β”€ about-you/
β”‚       β”‚   β”‚   β”œβ”€β”€ accounts/
β”‚       β”‚   β”‚   β”œβ”€β”€ invitees/
β”‚       β”‚   β”‚   └── guardian/          # Trusted guardian config
β”‚       β”‚   β”œβ”€β”€ estate/[id]/           # Executor estate board
β”‚       β”‚   β”‚   β”œβ”€β”€ account/[id]/      # Account detail + playbook
β”‚       β”‚   β”‚   β”‚   └── letter/        # AI letter preview + edit
β”‚       β”‚   β”‚   └── export/            # Evidence bundle download
β”‚       β”‚   └── api/auth/callback/     # Gmail OAuth callback (only API route)
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ estate/                # Board, cards, kanban
β”‚       β”‚   β”œβ”€β”€ letter/                # Letter preview, editor
β”‚       β”‚   β”œβ”€β”€ onboarding/            # Owner setup steps
β”‚       β”‚   └── ui/                    # Design system components
β”‚       └── lib/
β”‚           β”œβ”€β”€ crypto.ts              # AES-256-GCM client encryption
β”‚           └── session.ts             # Session token management
β”‚
β”œβ”€β”€ convex/                            # ALL backend logic lives here
β”‚   β”œβ”€β”€ schema.ts                      # Single source of truth β€” 10 tables
β”‚   β”œβ”€β”€ accounts.ts                    # Account queries + mutations
β”‚   β”œβ”€β”€ estates.ts                     # Estate lifecycle
β”‚   β”œβ”€β”€ owners.ts                      # Owner vault management
β”‚   β”œβ”€β”€ unlock.ts                      # Unlock trigger + OTP system
β”‚   β”œβ”€β”€ invites.ts                     # Invitation token system
β”‚   β”œβ”€β”€ crons.ts                       # 90-day auto-delete scheduler
β”‚   β”œβ”€β”€ ai/
β”‚   β”‚   β”œβ”€β”€ generateLetter.ts          # Saul-Instruct letter generation
β”‚   β”‚   └── classifyService.ts         # Account tier classification
β”‚   └── export/
β”‚       └── evidenceBundle.ts          # pdf-lib evidence bundle
β”‚
└── packages/
    └── platforms-db/                  # Community-maintained platform data
        └── data/
            β”œβ”€β”€ streaming.ts           # Netflix, Spotify, Disney+...
            β”œβ”€β”€ financial.ts           # Chase, PayPal, Robinhood...
            β”œβ”€β”€ social.ts              # Facebook, LinkedIn, TikTok...
            β”œβ”€β”€ health.ts              # Insurance, pharmacy, fitness...
            └── government.ts          # SSA, IRS, Medicare, USPS...


⚑   Tech Stack

Layer Technology Version Why
Frontend Next.js 16.1.6 App Router, React 19, Turbopack
Language TypeScript 5.x End-to-end type safety with Convex
Styling Tailwind CSS 4.x CSS-first, design tokens in globals.css
Database + Backend Convex 1.32.0 Replaces Express + Prisma + Postgres entirely
AI Saul-Instruct-v1 2024-03 Legal-domain LLM, MIT license, free tier
Email Resend latest Invitation + OTP + alert emails
PDF pdf-lib 1.17.1 Evidence bundle + individual letter PDFs
Monorepo Turborepo 2.x Shared types across Next.js + Convex
Deployment Vercel + Convex Cloud β€” Both free tier, git-push deploy

Total monthly infrastructure cost: $0
Convex Starter (50GB free) + HuggingFace Serverless (free) + Vercel Hobby (free) + Resend (free tier) = zero spend.



πŸ” Β  Privacy Architecture

This is not a policy promise. It is a technical guarantee.

AES-256-GCM encryption β€” in the browser
Every piece of PII (names, emails, account notes, guardian contact) is encrypted before it leaves your browser. Convex stores only ciphertext. A full database breach reveals nothing readable.

No email body access β€” ever
The Gmail integration uses gmail.metadata scope only β€” the most restricted scope available. It physically cannot access email bodies, attachments, drafts, or sent mail. This is enforced by the OAuth scope, not by policy.

Token revoked immediately post-scan
The Gmail OAuth token is stored encrypted for a maximum of 2 hours and is programmatically revoked via Google's token revocation endpoint the moment scanning completes.

90-day auto-delete
Every estate auto-erases 90 days after final closure. Implemented as a Convex scheduled cron function β€” not a checkbox in a settings menu.

Client Browser
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  AES-256-GCM encrypt    β”‚
β”‚  all PII fields         β”‚
β”‚  before any fetch()     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚ ciphertext only
             β–Ό
Convex Database
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Stores encrypted blobs β”‚
β”‚  Session token SHA-256  β”‚
β”‚  hash only β€” no raw     β”‚
β”‚  tokens ever stored     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Gmail API
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  scope: gmail.metadata  β”‚
β”‚  reads: sender, subject β”‚
β”‚  CANNOT: read bodies    β”‚
β”‚  Token: revoked in 2hr  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


πŸ–₯️ Β  Screens Overview

22 screens across three user paths.

Path A β€” Owner (8 screens) β€” The living person planning ahead
Screen Route Description
Landing Page / Dual-path hero. Two equal CTAs. Stats bar. Guardian explainer.
Create Account /dashboard/new 4-word passphrase setup. Recovery warning.
Personal Details /setup/about-you Full legal name. Verification key preview.
Add Accounts /setup/accounts Manual entry with notes. 200+ platform autocomplete.
Choose Invitees /setup/invitees 4 role types. Personal message.
Name Guardian /setup/guardian Trusted guardian email. OTP email preview.
Vault Dashboard /dashboard Completeness score. Account list. Invitee panel.
Dry Run Preview /dashboard/preview Owner previews the full invitee experience.
Path B β€” Unlock Event (4 screens) β€” The moment everything activates
Screen Route Description
Unlock Entry /unlock Name + date + state form. Accessible to anyone.
OTP Waiting /unlock (state) 6-box OTP input. 10-minute countdown. Guardian note.
No Match /unlock (state) Non-revealing message. Offers standalone executor path.
Unlock Confirmed /unlock (state) Checkmark animation. Invitations firing confirmation.
Path C β€” Executor / Invitee (8 screens) β€” Closing every account
Screen Route Description
Verification Gate /verify/[token] 3-field identity check. 5 attempts. Warm tone.
Estate Board /estate/[id] 4-column Kanban. Urgency tiers. Real-time sync.
Account Detail /estate/[id]/account/[id] Owner notes first. Playbook steps. Confirmation field.
Letter Preview /estate/[id]/account/[id]/letter AI letter. Inline editing. PDF download.
Evidence Bundle /estate/[id]/export Bundle download. Confetti on first download.
System Screens (2)
Screen Route Description
Demo Mode /?demo=true Pre-seeded "Estate of Maria Santos". Amber banner.
Account Locked /unlock or /verify Rate limit lockout. Countdown. Support link.


πŸš€ Β  Getting Started

Prerequisites

node >= 20.0.0
npm >= 10.0.0

1. Clone and install

git clone https://github.com/your-team/afterword.git
cd afterword
npm install

2. Configure environment

# apps/web/.env.local
NEXT_PUBLIC_CONVEX_URL=https://your-project.convex.cloud
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Set Convex environment variables (in Convex dashboard or CLI)
npx convex env set HF_TOKEN hf_your_token
npx convex env set RESEND_API_KEY re_your_key
npx convex env set ENCRYPTION_SECRET your_32_byte_secret

3. Start development

# Starts Next.js (Turbopack) + Convex dev server simultaneously
npm run dev

4. Seed the platforms database

npx convex run scripts/seedPlatforms

5. Load demo estate

npx convex run scripts/resetDemo
# Then visit: http://localhost:3000?demo=true


🌍   Contributing

The platforms database (packages/platforms-db/) is the highest-value community asset in this project. Platform closure processes change. New services launch. Old ones close.

Every PR that adds or updates a platform playbook is meaningful.

// packages/platforms-db/data/streaming.ts β€” example entry
{
  name:         "Netflix",
  domain:       "netflix.com",
  category:     "STREAMING",
  closureUrl:   "https://www.netflix.com/cancelplan",
  docsRequired: ["Death Certificate"],
  playbook: [
    { step: 1, text: "Sign in to the account at netflix.com" },
    { step: 2, text: "Go to Account β†’ Membership & Billing β†’ Cancel Membership" },
    { step: 3, text: "If access is unavailable, call 1-866-579-7172 and reference bereavement policy" },
    { step: 4, text: "Request written confirmation and refund of any charges after date of death" },
  ],
  avgCloseDays: 3,
  lastVerified: "2026-01",
}

How to add a platform

  1. Fork the repository
  2. Add your platform entry to the appropriate file in packages/platforms-db/data/
  3. Verify the closure URL is current and the playbook steps are tested
  4. Submit a pull request with the platform name in the title

See CONTRIBUTING.md for the full guide.



βš–οΈ Β  Legal Context

Afterword generates letters that reference RUFADAA β€” the Revised Uniform Fiduciary Access to Digital Assets Act, adopted in 46 US states. This law grants executors and personal representatives the legal right to access and manage a deceased person's digital assets.

Afterword is not a substitute for legal advice. The evidence bundle it produces may be submitted to probate court but should be reviewed by an estate attorney.



πŸ—ΊοΈ Β  Roadmap

v1.0  βœ…  Owner vault + Trusted guardian unlock + AI letters + Evidence bundle
v1.1  πŸ”²  Outlook / Microsoft inbox scan
v1.2  πŸ”²  Spanish + French letter generation
v1.3  πŸ”²  International platforms β€” UK, Canada, Australia
v2.0  πŸ”²  Direct closure APIs for top 10 platforms
v2.1  πŸ”²  Upgrade to SaulLM-54B when available on HF free tier
v2.2  πŸ”²  Crypto wallet notification workflows
v3.0  πŸ”²  EU GDPR letter templates + international jurisdiction support


Afterword Β Β·Β  MIT License Β Β·Β  sudo make world 2026

Built with πŸ•―οΈ for the people left behind.

About

πŸ•―οΈ Afterword: Close the final chapter. A privacy-first digital estate management platform that helps families discover, close, and document online accounts after a loss. Built with Next.js 16, Convex.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages