How haitruongfla-max/chatpht works
SwiftChat is a mobile 1-to-1 messaging app. Its documented main journey is account creation or login, finding a user by username, sending and accepting a friend request, then chatting and sharing media. The graph includes the client, API/domain layer, and storage/push services, plus the substantial calling implementation present in the tree. The README says calling is not yet implemented, so treat that branch as code present rather than a documented user capability; unsampled modules and their connections are not inferred.
Main entry points: routers.ts Domain procedures · trpc.ts API client · [id].tsx Conversation · media-access.ts Media authorization
Components 18
Mobile app
- Login
app/login.tsx - Auth state
hooks/use-auth.ts - Session storage
lib/_core/auth.ts - Find friends
app/search.tsx - Inbox and contacts
app/(tabs)/index.tsx - Conversation
app/chat/[id].tsx - API client
lib/trpc.ts
API and domain
- Domain procedures
server/routers.ts - Application data
server/db.ts - Push notifications
server/push.ts - Realtime server
server/_core/realtime.ts
Media and storage
- Direct media upload
lib/direct-media-upload.ts - Object storage
server/storage.ts - Media authorization
server/media-access.ts
Calling implementation
- Call manager
components/calling-manager.tsx - WebRTC controller
src/features/webrtc-calling/hooks/useWebRTC.ts - Call signaling
src/features/webrtc-calling/services/callSignaling.ts
Other components
- User
Connections 21
- User → Login: signs in
README.md - Login → Auth state: establishes session
- Auth state → Session storage: reads session
hooks/use-auth.ts - User → Find friends: finds username
README.md - User → Inbox and contacts: opens inbox
README.md - User → Conversation: opens conversation
README.md - Find friends → API client: requests search
app/search.tsx - Inbox and contacts → API client: loads inbox
app/(tabs)/index.tsx - Conversation → API client: loads and sends
app/chat/[id].tsx - API client → Domain procedures: calls procedures
lib/trpc.ts - Domain procedures → Application data: reads and writes
server/routers.ts - Domain procedures → Push notifications: dispatches alerts
server/routers.ts - Conversation → Direct media upload: uploads media
app/chat/[id].tsx - Domain procedures → Object storage: creates upload URL
server/routers.ts - Domain procedures → Media authorization: creates signed access
server/routers.ts - Media authorization → Application data: checks membership
server/media-access.ts - Media authorization → Object storage: resolves media
server/media-access.ts - Call manager → WebRTC controller: controls calls
components/calling-manager.tsx - WebRTC controller → Call signaling: exchanges signals
src/features/webrtc-calling/hooks/useWebRTC.ts - WebRTC controller → API client: calls procedures
src/features/webrtc-calling/hooks/useWebRTC.ts - Domain procedures → Realtime server: uses realtime
server/routers.ts