How mrboom192/drx works
Project type and purpose
• This is a full-stack mobile application built with Expo/React Native, focused on telehealth (doctor-patient chat, video calls, booking, and medical records).
• Key signals:
• “create-expo-app” starter in README
• file-based routing under src/app (“(call)”, “(chat)”, “tabs”, etc.)
• firebaseConfig.js + webRTCConfig.ts → real-time backend and peer-to-peer video.
File structure to extract architectural boundaries
• Top-level directories:
• src/app → screen definitions & routes (UI layer)
• src/components → reusable UI building blocks
• src/api → wrappers for server data (medicalRecords.tsx)
• src/config → service configuration (webrtcConfig, firebaseConfig)
• src/contexts + src/stores → state management (React Context + Zustand)
• src/hooks + src/utils → custom logic and helpers
• assets → static data/images/lottie
• Configuration files (babel.config.js, metro.config.js, tsconfig.json) confirm React Native / TypeScript environment.
• package.json lists dependencies: Expo, React Navigation (router), Zustand, Firebase SDKs, etc.
README for techn nical stack
• Expo managed workflow on iOS & Android
• File-based routing via Expo Router
• No in-house backend: uses Firebase for Auth, Firestore/Realtime DB, Storage
• WebRTC for video calls
Main components
a. Mobile App (Expo/React Native)
• UI Layer
– File-based Router → defines navigation tree & protected/public routes
– Screens (Chat, Call, Tabs, Modals, Login, Signup)
– Reusable Components (avatars, lists, headers, inputs)
• State & Context Layer
– React Contexts (AuthContext, SignupContext)
– Zustand Stores (appointments, chats, records, user)
– Hooks (useWebRTCCall, useUserPresence, etc.)
• Service / API Layer
– Firebase SDK
· Auth (email/password, token management)
· Firestore (chat messages, bookings, medical records)
· Storage (profile images, radiology images)
– REST/GraphQL (if any external APIs – e.g. src/api/medicalRecords.tsx)
– WebRTC Peer Connection
· STUN/TURN servers (configured in webrtcConfig.ts)
b. External Services
• Firebase Cloud
– Authentication
– Firestore / Real-time Database
– Cloud Storage
• STUN/TURN servers or signaling server for WebRTC
c. Asset Management
• Local static assets (doctorWave animation, flags)
• Dynamic assets loaded from Storage
Relationships & interactions
• User taps a UI component → Router dispatches to a Screen
• Screen reads/writes global state via Contexts / Zustand Stores
• Stores or Contexts call API Layer (Firebase SDK)
• For chat: Firestore streams data → update chat store → UI updates in real time
• For calls: useWebRTCCall hook uses webrtcConfig to establish P2P → media flows directly
• Images/radiology data fetched from Cloud Storage → displayed in UI
• Local assets loaded via Metro bundler
Architectural patterns & design principles
• File-based routing for navigation (similar to Next.js)
• Separation of concerns: UI vs. State vs. Services
• Hook + Context + Store composition for testable logic
• Modular components for reusability
• Real-time updates via Firebase subscriptions
Essential details to capture
• Authentication flow (login/signup) → AuthContext → Firebase Auth
• Routing structure: Protected vs. Public routes
• Core flows: Chat, Video Call, Booking, Medical Records
• State synchronization: local stores vs. real-time updates
• External dependencies: Firebase, STUN/TURN, any third-party SDKs