How bendechrai/workshop-secure-messenger works
This repository is a Next.js workshop starter for a secure messenger. The visible app workflow loads or saves a sender name in browser storage, then opens an in-memory chat where submitted text is rendered as messages. Supporting modules implement RSA key generation, encryption/decryption, browser key persistence, and a Supabase adapter for encrypted messages, public keys, and message subscriptions. Those security and multi-user capabilities are described by the staged workshop, but the sampled chat component does not invoke them; their runtime connections are therefore not inferred.
Main entry points: page.tsx Sender setup · chat.tsx Chat view · supabase.ts Remote data adapter · idb.ts Browser key storage
Components 9
App shell
- Root layout
src/app/layout.tsx - Sender setup
src/app/page.tsx
Chat interface
- Chat view
src/components/chat.tsx - Message model
src/types/Message.ts
Cryptography
- Key and message crypto
src/lib/crypto.ts
Persistence
- Browser key storage
src/lib/idb.ts - Remote data adapter
src/lib/supabase.ts
Other components
- Messenger user
- Supabase service
Connections 8
- Messenger user → Sender setup: sets name
src/app/page.tsx - Sender setup → Browser key storage: loads/saves sender
src/app/page.tsx - Sender setup → Chat view: renders
src/app/page.tsx - Messenger user → Chat view: submits text
src/components/chat.tsx - Chat view → Message model: uses type
src/components/chat.tsx - Browser key storage → Key and message crypto: converts keys
src/lib/idb.ts - Remote data adapter → Supabase service: reads/writes
src/lib/supabase.ts - Remote data adapter → Message model: types updates
src/lib/supabase.ts