How project-rewire/app works
Rewire is a mobile addiction-recovery app combining onboarding and assessment, recovery tasks, an AI chat, community features, and emergency support. The user enters through the app navigation, authenticates, and can move into recovery activities; the backend includes profile, questionnaire, recommendation, and chat domains. Sampled code confirms authentication requests, chat persistence, and recommendation generation from AI profiles. Several feature branches are documented or visible in the tree but their detailed runtime wiring was not sampled, so those links are omitted or marked unverified.
Main entry points: App.js App navigation · jwt-auth-service.js Auth provider · service.py Recommendation engine · RebotChatInterface.js Rebot chat
Components 24
Mobile experience
- App navigation
frontend/App.js - API configuration
frontend/app/app.settings.ts - Chat history store
frontend/app/app.db.service.ts
Identity and assessment
- Auth provider
frontend/app/hooks/jwt-auth-service.js - Login and signup
frontend/app/screens/Login.js - Questionnaire
frontend/app/screens/Questionnaire.js - Questionnaire client
frontend/app/hooks/questionnaire-service.js - User profile
frontend/app/screens/Profile.js
Recovery support
- Recovery tasks
frontend/app/screens/tabs/Tasks.js - Task recommendations
backend/rewire/recommendations/views.py - Recommendation engine
backend/rewire/recommendations/service.py - Rebot chat
frontend/app/screens/RebotChatInterface.js - Chat WebSocket client
frontend/app/hooks/rebot-service.js - Emergency support
frontend/app/screens/UrgeShield.js
Backend services
- Questionnaire API
backend/rewire/questionnaire/views.py - AI profile API
backend/rewire/aiprofile/views.py - AI profile data
backend/rewire/aiprofile/models.py - Chat routing
backend/rewire/rebot/routing.py - Chat consumer
backend/rewire/rebot/consumers.py - Core recovery data
backend/rewire/core/models.py
Community
- Community screens
frontend/app/screens/tabs/Community.js - Community posts
frontend/app/screens/CommunityPostsScreen.js
Other components
- App user
- OpenAI service
Connections 26
- App user → App navigation: opens
frontend/App.js - App navigation → Login and signup: routes to
frontend/App.js - App navigation → Auth provider: provides auth
frontend/App.js - Login and signup → Auth provider: uses auth
- Auth provider → API configuration: reads endpoints
frontend/app/hooks/jwt-auth-service.js - Auth provider → App user: authenticates with
- App navigation → Questionnaire: routes to
- Questionnaire → Questionnaire client: uses
- Questionnaire client → Questionnaire API: submits assessment
- Questionnaire API → AI profile API: records profile
- App navigation → Recovery tasks: routes to
frontend/App.js - Recovery tasks → Task recommendations: requests tasks
- Task recommendations → Recommendation engine: generates tasks
- Recommendation engine → AI profile data: reads profile
backend/rewire/recommendations/service.py - Recommendation engine → OpenAI service: requests recommendations
backend/rewire/recommendations/service.py - App navigation → Rebot chat: routes to
frontend/App.js - Rebot chat → Chat history store: loads and saves
frontend/app/screens/RebotChatInterface.js - Rebot chat → API configuration: uses chat endpoint
frontend/app/screens/RebotChatInterface.js - Chat WebSocket client → API configuration: reads socket URL
frontend/app/hooks/rebot-service.js - Chat routing → Chat consumer: routes to
backend/rewire/rebot/routing.py - Chat WebSocket client → Chat routing: exchanges messages
- App navigation → Community screens: routes to
frontend/App.js - Community screens → Community posts: opens posts
- App navigation → Emergency support: routes to
- App navigation → User profile: routes to
frontend/App.js - AI profile API → AI profile data: persists profile