How haitruongproqt1-a11y/kini works
KINI is a mobile and web messaging/social app with authentication, contacts and discovery, AI assistance, media, and voice/video calling. The primary workflow is user sign-in, conversation selection, message composition and delivery, then conversation history and delivery status. The app also supports push notifications, nearby discovery, profile/session management, and release updates. The graph follows documented client/server paths and sampled calls; some feature routes and server operations are represented by their exact enclosing paths where their internals were not excerpted.
Main entry points: trpc.ts API client · [id].tsx Conversation view · index.ts API runtime · use-auth.ts Auth state
Components 29
App experience
- App tabs
app/(tabs)/index.tsx - OAuth callback
app/oauth/callback.tsx - Auth state
hooks/use-auth.ts - Session storage
lib/_core/auth.ts - API client
lib/trpc.ts - Push manager
components/push-notification-manager.tsx - Release updates
components/release-update-manager.tsx
Messaging and calls
- Conversation view
app/chat/[id].tsx - Message composer
components/chat-composer.tsx - AI assistant
app/(tabs)/assistant.tsx - Contacts
app/(tabs)/contacts.tsx - Discovery
app/(tabs)/discover.tsx - Nearby API
features/nearby/nearby-api.ts - Profile
app/(tabs)/profile.tsx - Media uploads
features/media-upload/media-upload-provider.tsx - Call experience
features/webrtc-calling/call-provider.tsx - WebRTC session
features/webrtc-calling/hooks/useWebRTC.ts - Signaling client
features/webrtc-calling/services/signalingClient.ts - RTC media
features/webrtc-calling/services/webrtcService.native.ts - Device sessions
components/device-sessions.tsx
API services
- Chat API
server/routers.ts - LLM service
server/_core/llm.ts - Object storage
server/storage.ts - Call signaling
server/signaling/index.ts - Push service
server/push.ts - API runtime
server/_core/index.ts
Persistence
- Chat persistence
server/db.ts - Domain schema
drizzle/schema.ts
Other components
- App user
Connections 35
- App user → App tabs: opens app
app/(tabs)/index.tsx - App user → OAuth callback: signs in
app/oauth/callback.tsx - OAuth callback → Auth state: sets session
app/oauth/callback.tsx - Auth state → Session storage: reads credentials
hooks/use-auth.ts - Auth state → API client: verifies user
hooks/use-auth.ts - App tabs → Conversation view: opens conversation
- App user → Message composer: composes message
- Conversation view → Message composer: renders
app/chat/[id].tsx - Conversation view → API client: requests chat data
app/chat/[id].tsx - Message composer → API client: sends message
- API client → Chat API: calls API
lib/trpc.ts - Chat API → Chat persistence: reads and writes
server/routers.ts - Chat persistence → Domain schema: uses tables
server/db.ts - AI assistant → API client: requests answers
- Chat API → LLM service: invokes model
server/routers.ts - Contacts → API client: loads contacts
- Discovery → Nearby API: uses nearby service
- Profile → API client: updates profile
- Conversation view → Media uploads: uploads attachments
app/chat/[id].tsx - Media uploads → API client: requests upload
features/media-upload/media-upload-provider.tsx - Media uploads → Object storage: uploads objects
- Conversation view → Call experience: starts calls
app/chat/[id].tsx - Call experience → WebRTC session: manages call
features/webrtc-calling/call-provider.tsx - WebRTC session → Signaling client: exchanges signaling
features/webrtc-calling/hooks/useWebRTC.ts - WebRTC session → RTC media: creates media peer
features/webrtc-calling/hooks/useWebRTC.ts - Signaling client → Call signaling: connects
- Push manager → Auth state: reads identity
components/push-notification-manager.tsx - Push manager → Call experience: routes call alerts
components/push-notification-manager.tsx - Push manager → API client: registers token
components/push-notification-manager.tsx - Push service → Chat persistence: reads records
server/push.ts - Device sessions → API client: manages devices
- Release updates → API runtime: checks releases
components/release-update-manager.tsx - API runtime → Chat API: registers routes
server/_core/index.ts - API runtime → Push service: loads push service
server/_core/index.ts - API runtime → Call signaling: loads signaling
server/_core/index.ts