How nikcodepro/ai-chat-app works
This Expo app provides account access and an authenticated AI chat experience, with separate voice- and video-call screens. The main path is app startup and session restoration, authentication when needed, then home/chat interactions; shared state coordinates API access, chat history, and messages. Voice calls use a hook to coordinate audio capture/playback and a WebSocket, while video screens use a WebRTC service. The README describes only the Expo starter, so feature coverage and relationships here rely on the supplied source index and excerpts; unsampled details are not inferred.
Main entry points: appStore.ts Application state · AppNavigator.tsx App navigator · ChatScreen.tsx Chat screen · useVoiceCall.ts Voice call coordination
Components 20
App and navigation
- App entry
App.tsx - App navigator
src/navigation/AppNavigator.tsx
Account and profile
- Auth screens
src/screens/auth - Home screen
src/screens/home/HomeScreen.tsx - Profile screen
src/screens/profile/ProfileScreen.tsx
Chat experience
- Chat screen
src/screens/chat/ChatScreen.tsx - Chat components
src/components
Realtime calls
- Voice call screen
src/screens/chat/VoiceCallScreen.tsx - Video call screen
src/screens/chat/VideoCallScreen.tsx - Voice call coordination
src/hooks/useVoiceCall.ts - Audio service
src/services/audioService.ts - Voice WebSocket
src/services/websocketService.ts - WebRTC service
src/services/webrtcService.ts - Audio hooks
src/hooks/useAudioRecorder.ts
State and services
- Chat API
src/services/chatApi.ts - Application state
src/store/appStore.ts - Authentication API
src/services/api.ts - Token storage
src/services/tokenStorage.ts - Theme tokens
src/theme/colors.ts
Other components
- App user
Connections 31
- App user → App entry: opens
- App entry → App navigator: renders
App.tsx - App navigator → Auth screens: routes
src/navigation/AppNavigator.tsx - App navigator → Home screen: routes
src/navigation/AppNavigator.tsx - App navigator → Profile screen: routes
src/navigation/AppNavigator.tsx - App navigator → Chat screen: routes
src/navigation/AppNavigator.tsx - App navigator → Voice call screen: routes
src/navigation/AppNavigator.tsx - App navigator → Video call screen: routes
src/navigation/AppNavigator.tsx - App navigator → Application state: restores session
src/navigation/AppNavigator.tsx - Auth screens → Authentication API: requests auth
src/screens/auth/LoginScreen.tsx - Auth screens → Application state: updates state
src/screens/auth/LoginScreen.tsx - Home screen → Authentication API: requests data
src/screens/home/HomeScreen.tsx - Home screen → Application state: reads state
src/screens/home/HomeScreen.tsx - Profile screen → Authentication API: updates profile
src/screens/profile/ProfileScreen.tsx - Profile screen → Application state: reads state
src/screens/profile/ProfileScreen.tsx - Chat screen → Chat components: renders
src/screens/chat/ChatScreen.tsx - Chat screen → Application state: reads and updates
src/screens/chat/ChatScreen.tsx - Chat screen → Chat API: requests chats
src/screens/chat/ChatScreen.tsx - Application state → Chat API: loads chat data
src/store/appStore.ts - Application state → Authentication API: uses auth API
src/store/appStore.ts - Application state → Token storage: stores tokens
src/store/appStore.ts - Authentication API → Token storage: reads tokens
src/services/api.ts - Voice call screen → Voice call coordination: uses call controls
src/screens/chat/VoiceCallScreen.tsx - Voice call screen → Audio hooks: uses audio capture
src/screens/chat/VoiceCallScreen.tsx - Video call screen → Voice call coordination: uses call controls
src/screens/chat/VideoCallScreen.tsx - Video call screen → WebRTC service: uses WebRTC
src/screens/chat/VideoCallScreen.tsx - Voice call coordination → Audio service: controls audio
src/hooks/useVoiceCall.ts - Voice call coordination → Voice WebSocket: streams voice
src/hooks/useVoiceCall.ts - Voice call coordination → Application state: reads token
src/hooks/useVoiceCall.ts - Chat screen → Theme tokens: uses styling
src/screens/chat/ChatScreen.tsx - Chat components → Theme tokens: uses styling
src/components/GradientCard.tsx