How bkabondo/timelock works
TimeLock lets users seal encrypted messages for a future unlock date, then revisit or share links to reveal them. The main workflow is browser-side encryption, capsule and content storage (either signed-in or guest), and later token/key-based retrieval and decryption. The tree also shows authentication, public capsule browsing, admin activity views, and an email-sharing module. Several page and integration implementations were not sampled, so uncertain internal wiring is omitted; documented guest-token and fragment behavior is retained.
Main entry points: server.ts Server database client · new/page.tsx Create capsule · admin.ts Admin database client · [id]/page.tsx Capsule detail
Components 25
Capsule creation
- Create capsule
app/capsules/new/page.tsx - Browser encryption
lib/capsule-crypto.ts - Guest capsule API
app/api/capsules/guest/route.ts
Capsule access
- Capsule listing
app/capsules/page.tsx - Capsule detail
app/capsules/[id]/page.tsx - Guest capsule loader
app/capsules/[id]/GuestCapsuleLoader.tsx - Capsule view
app/capsules/[id]/CapsuleView.tsx - Letter reveal
app/capsules/[id]/LetterReveal.tsx - Link fragment parser
lib/capsule-fragment.ts - Token database client
lib/supabase/token-client.ts - Unlock countdown
components/Countdown.tsx - Email sharing
api/email/share.py
Identity and admin
- Login
app/login/page.tsx - Sign up
app/signup/page.tsx - Auth callback
app/auth/callback/route.ts - Create profile API
app/api/auth/create-profile/route.ts - Admin dashboard
app/admin/page.tsx - Seed admin API
app/api/seed/route.ts
Data and services
- Browser database client
lib/supabase/client.ts - Server database client
lib/supabase/server.ts - Admin database client
lib/supabase/admin.ts - Supabase database and auth
- Rate limiter
lib/rate-limit.ts
Other components
- Visitor
- Signed-in user
Connections 32
- Visitor → Create capsule: creates
- Signed-in user → Create capsule: creates
- Create capsule → Browser encryption: encrypts locally
- Create capsule → Browser database client: writes signed-in capsule
- Create capsule → Guest capsule API: posts guest capsule
- Guest capsule API → Rate limiter: checks limit
- Guest capsule API → Admin database client: stores guest capsule
- Browser database client → Supabase database and auth: reads and writes
- Server database client → Supabase database and auth: reads and writes
- Admin database client → Supabase database and auth: privileged access
- Signed-in user → Capsule listing: views capsules
- Visitor → Capsule detail: opens link
- Signed-in user → Capsule detail: opens capsule
- Capsule detail → Guest capsule loader: loads guest capsule
- Guest capsule loader → Link fragment parser: reads link secrets
- Guest capsule loader → Token database client: requests token access
- Token database client → Supabase database and auth: reads under RLS
- Capsule detail → Capsule view: renders capsule
- Capsule view → Letter reveal: presents letter
- Letter reveal → Browser encryption: decrypts locally
- Capsule view → Unlock countdown: shows unlock time
- Signed-in user → Login: authenticates
- Visitor → Sign up: registers
- Login → Server database client: uses auth session
- Sign up → Server database client: uses auth session
- Auth callback → Server database client: exchanges auth code
- Create profile API → Server database client: checks session
- Create profile API → Admin database client: creates profile
- Admin dashboard → Server database client: checks identity
- Admin dashboard → Admin database client: queries activity
- Seed admin API → Admin database client: seeds admin account
- Email sharing → Visitor: shares capsule by email