How ahwei/rn-ai-assistant works
Main Components
A. Client Layer:
• React Native Mobile Application (iOS & Android)
• Key frontend modules:
• Chat Interface (/src/components/chat)
• Expert Selection System
• Theme/UI Components
• Context Management (/src/contexts)
B. Backend Layer:
• FastAPI Server
• OpenAI Integration
• Database System
• API Endpoints
C. External Services:
• OpenAI API
• Mobile Platform Services (iOS/Android)
[Mobile Clients]
• ▼
[Frontend Layer]
• ▼
[API Gateway]
• ▼
[Backend Services]
• ▼
[External Services]
Specific Component Details
Frontend Layer (Blue):
• Main app structure (/src/app)
• Chat components
• Contexts and hooks
• State management flow
Backend Layer (Green):
• FastAPI application structure
• API endpoints (/app/api)
• Core configurations
• Database models
External Services (Purple):
• OpenAI API integration
• Platform-specific services
Key Flows to Highlight
A. Chat Flow:
User Input → Chat Interface → API Gateway → Backend Processing → OpenAI API → Response Streaming → UI Update
B. Expert Selection Flow:
Expert Selection → Context Update → Chat Configuration → Backend Configuration → Response Adaptation
Important Elements
• WebSocket connections for real-time chat
• State management flow
• API endpoint groupings
• Database interactions
• Authentication flow (if present)
Architectural Patterns to Emphasize
• Mobile-first architecture
• Microservices approach
• Real-time communication
• Stream processing
• Context-based state management
Implementation Details
• Frontend architecture (React Native)
• Backend services (FastAPI)
• Data persistence
• External service integration
• DevOps components (Docker)