How karthikks26/ciper-chat works
CipherChat is a browser-based encrypted room chat with protected attachments and live audio/video. The main workflow is create or open a room, obtain its fragment-held encryption key, authenticate a room identity, then exchange encrypted messages and files; the browser decrypts content for display. Separate branches cover file-access auditing, live discussion and recording, and standalone screen recording. API, authentication and persistence relationships are included where the excerpts or README support them; unsampled client wiring is not inferred.
Main entry points: ChatShell.js Chat and realtime · RoomClient.js Room access · prisma.js PostgreSQL · route.js Message API
Components 30
Room entry
- Landing page
components/Landing.js - Room creation
app/api/rooms/route.js - Room access
components/RoomClient.js - Join room
components/JoinRoom.js
Encrypted chat
- Chat and realtime
components/ChatShell.js - Browser encryption
lib/client-crypto.js - Room key storage
lib/client-storage.js - Message composer
components/Composer.js - Message display
components/MessageBubble.js - Message API
app/api/rooms/[slug]/messages/route.js - Message serialization
lib/serializers.js
Identity and files
- Room management
app/api/rooms/[slug]/route.js - Session endpoint
app/api/rooms/[slug]/session/route.js - Identity and session
app/api/rooms/[slug]/join/route.js - Signed sessions
lib/server-auth.js - Session tokens
lib/session-core.js - Request validation
lib/validators.js - Protected viewer
components/SecureViewer.js - PostgreSQL
lib/prisma.js - Encrypted upload API
app/api/rooms/[slug]/upload/route.js - Encrypted file storage
lib/cloudinary.js - File access policy
app/api/rooms/[slug]/files/[messageId]/access/route.js - Access audit
app/api/rooms/[slug]/audit/route.js - Access log panel
components/AccessLogPanel.js
Live media
- Live discussion
components/CallPanel.js - Media recording
lib/media-recording.js - Camera capture
components/CameraCapture.js - Standalone recorder
components/StandaloneRecorder.js - Realtime server
server.js
Other components
- Visitor
Connections 41
- Visitor → Landing page: opens
README.md - Landing page → Room creation: creates room
- Visitor → Room access: opens room link
README.md - Room access → Room key storage: reads key
components/RoomClient.js - Room access → Join room: requests identity
components/RoomClient.js - Join room → Identity and session: joins room
- Room creation → PostgreSQL: creates records
app/api/rooms/route.js - Room creation → Signed sessions: sets session
app/api/rooms/route.js - Identity and session → PostgreSQL: reads and writes
app/api/rooms/[slug]/join/route.js - Identity and session → Signed sessions: sets session
app/api/rooms/[slug]/join/route.js - Signed sessions → Session tokens: signs tokens
lib/server-auth.js - Room access → Room management: loads room
components/RoomClient.js - Room access → Session endpoint: checks session
components/RoomClient.js - Room access → Chat and realtime: opens chat
components/RoomClient.js - Chat and realtime → Browser encryption: encrypts and decrypts
components/ChatShell.js - Chat and realtime → Room key storage: builds share link
components/ChatShell.js - Chat and realtime → Message composer: renders composer
components/ChatShell.js - Chat and realtime → Message display: renders messages
components/ChatShell.js - Chat and realtime → Live discussion: opens discussion
components/ChatShell.js - Chat and realtime → Access log panel: opens audit
components/ChatShell.js - Chat and realtime → Message API: posts messages
components/ChatShell.js - Message API → PostgreSQL: reads and writes
app/api/rooms/[slug]/messages/route.js - Message API → Message serialization: serializes messages
app/api/rooms/[slug]/messages/route.js - Message API → Realtime server: emits message event
app/api/rooms/[slug]/messages/route.js - Message display → Browser encryption: decrypts content
components/MessageBubble.js - Message display → Protected viewer: opens attachment
components/MessageBubble.js - Message composer → Camera capture: captures media
components/Composer.js - Message composer → Browser encryption: encrypts files
- Chat and realtime → Encrypted upload API: uploads ciphertext
- Encrypted upload API → Encrypted file storage: stores encrypted blobs
README.md - Encrypted upload API → Signed sessions: checks session
app/api/rooms/[slug]/upload/route.js - File access policy → PostgreSQL: records access
app/api/rooms/[slug]/files/[messageId]/access/route.js - Access audit → PostgreSQL: reads activity
app/api/rooms/[slug]/audit/route.js - Access log panel → Access audit: loads audit
- Live discussion → Media recording: records discussion
components/CallPanel.js - Live discussion → Realtime server: signals peers
README.md - Landing page → Standalone recorder: opens recorder
README.md - Room management → Encrypted file storage: removes room files
app/api/rooms/[slug]/route.js - Room management → PostgreSQL: destroys room records
app/api/rooms/[slug]/route.js - Message API → Request validation: validates input
app/api/rooms/[slug]/messages/route.js - Identity and session → Request validation: validates input
app/api/rooms/[slug]/join/route.js