How deus-kh/velo works
Velo is a React Native secure messenger backed by a Node/Express service. A user authenticates, the client prepares identity and prekeys and connects its socket; a chat then establishes an X3DH session, encrypts messages, and exchanges live traffic or loads encrypted history. The server provides authentication, key bundles, user/conversation APIs, message history, socket delivery, and push support. The map includes documented UI, notification, and security capabilities, but source excerpts are incomplete; unverified links are omitted or marked dashed.
Main entry points: index.ts Express service · useChatE2EE.ts Encrypted chat coordinator · auth.store.ts Auth state · keys.routes.ts Key bundle routes
Components 31
Mobile client
- App navigation
chats-client/src/app/Navigation.tsx - Login and registration
chats-client/src/screens/LoginScreen.tsx - Chat list
chats-client/src/screens/ChatListScreen.tsx - Conversation screen
chats-client/src/screens/ChatScreen.tsx - User and settings screens
chats-client/src/screens/SettingsScreen.tsx - Auth state
chats-client/src/store/auth.store.ts - Authentication API client
chats-client/src/shared/api/auth.api.ts - Messaging and user APIs
chats-client/src/shared/api/messages.api.ts
Encryption and local state
- Encrypted chat coordinator
chats-client/src/shared/chat/useChatE2EE.ts - X3DH and message crypto
chats-client/src/shared/crypto/x3dh.ts - Session bootstrap
chats-client/src/shared/crypto/sessionBootstrap.ts - Session storage
chats-client/src/shared/storage/sessionStore.ts - Identity and prekeys
chats-client/src/shared/crypto/prekeys.ts - Pending messages and keys
chats-client/src/shared/storage/pendingMessageStore.ts
Server APIs
- Express service
chats-server/src/index.ts - Auth routes
chats-server/src/routes/auth.routes.ts - User routes
chats-server/src/routes/users.routes.ts - Key bundle routes
chats-server/src/routes/keys.routes.ts - Conversation routes
chats-server/src/routes/conversations.routes.ts - Message history routes
chats-server/src/routes/messages.routes.ts - JWT authorization
chats-server/src/middleware/auth.ts - User records
chats-server/src/models/User.ts - Message records
chats-server/src/models/Message.ts - Conversation records
chats-server/src/models/Conversation.ts
Realtime and notifications
- Socket client
chats-client/src/shared/socket/socket.ts - Socket messaging
chats-client/src/shared/socket/messaging.ts - Push and local notifications
chats-client/src/shared/notifications/push.ts - Socket delivery
chats-server/src/socket/setupSocket.ts - Firebase push
chats-server/src/push/firebase.ts
Other components
- Messenger user
- Firebase messaging
Connections 45
- Messenger user → App navigation: uses
chats-client/src/app/Navigation.tsx - App navigation → Login and registration: routes to
chats-client/src/app/Navigation.tsx - App navigation → Chat list: routes to
chats-client/src/app/Navigation.tsx - Login and registration → Auth state: authenticates via
- Auth state → Authentication API client: calls
chats-client/src/store/auth.store.ts - Authentication API client → Auth routes: HTTP auth
- Auth routes → User records: reads and writes
chats-server/src/routes/auth.routes.ts - Auth routes → JWT authorization: protects password change
chats-server/src/routes/auth.routes.ts - Auth state → Identity and prekeys: prepares keys
chats-client/src/store/auth.store.ts - Auth state → Socket client: initializes
chats-client/src/store/auth.store.ts - Auth state → Push and local notifications: syncs push token
chats-client/src/store/auth.store.ts - Chat list → Conversation screen: opens chats
- Conversation screen → Encrypted chat coordinator: uses
- Encrypted chat coordinator → Socket messaging: subscribes
chats-client/src/shared/chat/useChatE2EE.ts - Encrypted chat coordinator → Session bootstrap: establishes sessions
chats-client/src/shared/chat/useChatE2EE.ts - Encrypted chat coordinator → Session storage: loads and deletes
chats-client/src/shared/chat/useChatE2EE.ts - Encrypted chat coordinator → Pending messages and keys: queues messages
chats-client/src/shared/chat/useChatE2EE.ts - Session bootstrap → X3DH and message crypto: derives X3DH keys
chats-client/src/shared/crypto/sessionBootstrap.ts - Session bootstrap → Session storage: creates sessions
chats-client/src/shared/crypto/sessionBootstrap.ts - X3DH and message crypto → Identity and prekeys: uses key material
chats-client/src/shared/crypto/x3dh.ts - X3DH and message crypto → Key bundle routes: fetches peer bundle
- Encrypted chat coordinator → Messaging and user APIs: loads history
chats-client/src/shared/chat/useChatE2EE.ts - Messaging and user APIs → Message history routes: HTTP history
- Message history routes → Message records: reads and updates
chats-server/src/routes/messages.routes.ts - App navigation → User and settings screens: routes to
- Express service → Auth routes: mounts routes
chats-server/src/index.ts - Express service → User routes: mounts routes
chats-server/src/index.ts - Express service → Key bundle routes: mounts routes
chats-server/src/index.ts - Express service → Conversation routes: mounts routes
chats-server/src/index.ts - Express service → Message history routes: mounts routes
chats-server/src/index.ts - Express service → Socket delivery: sets up socket
chats-server/src/index.ts - User routes → JWT authorization: protects routes
chats-server/src/routes/users.routes.ts - User routes → User records: reads and writes
chats-server/src/routes/users.routes.ts - Key bundle routes → JWT authorization: protects routes
chats-server/src/routes/keys.routes.ts - Key bundle routes → User records: reads and writes
chats-server/src/routes/keys.routes.ts - Key bundle routes → Express service: stores prekeys
chats-server/src/index.ts - Conversation routes → JWT authorization: protects routes
chats-server/src/routes/conversations.routes.ts - Conversation routes → Conversation records: reads and writes
chats-server/src/routes/conversations.routes.ts - Message history routes → JWT authorization: protects routes
chats-server/src/routes/messages.routes.ts - Socket delivery → Message records: stores messages
chats-server/src/socket/setupSocket.ts - Socket delivery → Conversation records: uses conversations
chats-server/src/socket/setupSocket.ts - Socket delivery → Firebase push: triggers push
chats-server/src/socket/setupSocket.ts - Socket client → Socket delivery: WebSocket traffic
- Push and local notifications → Firebase messaging: receives push
- Firebase push → Firebase messaging: sends notifications