How wili-201027/pdr_project_3 works
This is a React Native peer-to-peer messaging app, with job/offers and profile features alongside its core chat workflow. A user enters through authentication and app navigation; the app initializes P2P service for signed-in users, discovers peers, and supports encrypted message exchange with local message storage. The README also documents local discovery fallback and optional signaling. The source excerpts establish several app, chat, storage, and P2P relationships; other feature screens and networking internals are represented at their exact tree paths, but their internal calls were not sampled.
Main entry points: RootNavigator.tsx App navigation · App.tsx App bootstrap · integrationExample.ts P2P service · AuthContext.ts Authentication state
Components 26
App and navigation
- App bootstrap
App.tsx - App navigation
src/navigation/RootNavigator.tsx - Sign in and register
src/screens/LoginScreen.tsx - Jobs and offers
src/screens/HomeScreen.js - Profile and settings
src/screens/ProfileScreen.js
Messaging and storage
- Chat screen
src/screens/ChatScreen.tsx - Chat list
src/screens/ChatListScreen.tsx - Chat state
src/contexts/ChatContext.tsx - Chat and message store
src/lib/localDb.ts - App data helpers
src/utils/localDb.ts - Message synchronization
src/lib/meshSync.ts
P2P networking
- P2P service
src/p2p/integrationExample.ts - Peer discovery
src/p2p/discovery.ts - WebRTC peer connections
src/p2p/peerManager.js - Signaling service
src/p2p/signalingServer.ts - P2P encryption
src/p2p/e2ee.ts - Peer trust store
src/p2p/tofuStore.ts
Account and security
- Authentication state
src/contexts/AuthContext.ts - Session and key utilities
src/utils/auth.ts - Key generation
src/utils/crypto_e2e.ts
User experience
- Accessibility settings
src/contexts/AccessibilityContext.ts - Translations
src/utils/i18n.ts - Theme system
src/contexts/ThemeContext.ts - Notifications
src/notifications/initNotifications.ts
Other components
- App user
- Optional signaling server
Connections 28
- App user → App bootstrap: opens
README.md - App bootstrap → Authentication state: provides auth
App.tsx - App bootstrap → App navigation: renders
App.tsx - App bootstrap → P2P service: initializes
App.tsx - App bootstrap → App data helpers: saves received messages
App.tsx - App bootstrap → Notifications: initializes
App.tsx - App navigation → Sign in and register: routes to
src/navigation/RootNavigator.tsx - App navigation → Jobs and offers: routes to
src/navigation/RootNavigator.tsx - App navigation → Profile and settings: routes to
src/navigation/RootNavigator.tsx - App navigation → Chat list: routes to
src/navigation/RootNavigator.tsx - Chat list → Chat screen: opens chat
- Chat screen → App data helpers: reads and saves
src/screens/ChatScreen.tsx - Chat state → Chat and message store: uses storage
src/contexts/ChatContext.tsx - Chat state → Message synchronization: uses sync
src/contexts/ChatContext.tsx - P2P service → WebRTC peer connections: uses connections
src/p2p/integrationExample.ts - P2P service → P2P encryption: uses encryption
src/p2p/integrationExample.ts - P2P service → Peer discovery: discovers peers
- P2P service → Signaling service: uses signaling
- Signaling service → Optional signaling server: connects optionally
- P2P service → Peer trust store: verifies peers
- App user → Sign in and register: authenticates
- Authentication state → Session and key utilities: reads sessions
src/contexts/AuthContext.ts - Authentication state → Key generation: generates keys
src/contexts/AuthContext.ts - Authentication state → App data helpers: reads profile
src/contexts/AuthContext.ts - Accessibility settings → Translations: checks RTL language
src/contexts/AccessibilityContext.ts - Theme system → Accessibility settings: applies contrast
src/contexts/ThemeContext.ts - App navigation → Theme system: reads theme
src/navigation/RootNavigator.tsx - App navigation → Authentication state: reads user state
src/navigation/RootNavigator.tsx