How faisalmushtaq/myphone-mybrain works
MyPhone/MyBrain is a research-project website and participant platform. The public site directs families to the opt-in consent and phone-use donation flow; the app saves consent as soon as it is complete, then supports screenshot donation and later completion. Separate branches support the adult social-media-break study, a New Year study, and research-team operations. The graph combines README-documented capabilities with sampled app and function relationships; unsampled implementations are represented only where the README documents them, and evidence limits are reflected in the edges.
Main entry points: App.tsx Consent journey · index.ts API selection · portal.ts Portal functions · school_pages.rb Project website
Components 21
Public website
- Project website
_plugins/school_pages.rb - School pages
_plugins/school_pages.rb
Family consent
- Consent journey
consent-app/src/App.tsx - Journey rules
consent-app/src/model/journey.ts - App state
consent-app/src/state/context.tsx - Consent submission
consent-app/src/state/useSync.ts - Screenshot upload
consent-app/src/state/useUploader.ts - API selection
consent-app/src/api/index.ts - Mock or Firebase
consent-app/src/api/types.ts
Break study
- Break-study journey
consent-app/src/lab/LabApp.tsx - Lab donations
consent-app/src/lab/useLabSender.ts - Lab functions
consent-app/firebase/functions/src/lab.ts - New Year study
consent-app/src/newyear/NewYearApp.tsx
Research operations
- Staff portal
consent-app/src/portal/TeamViews.tsx - Portal functions
consent-app/firebase/functions/src/portal.ts - Portal rules
consent-app/firebase/functions/src/portalCore.ts - Study exports
consent-app/firebase/functions/src/export.ts - Enquiry handling
consent-app/firebase/functions/src/enquiry.ts - Firestore
Other components
- Families
- Research team
Connections 26
- Families → Project website: visits
- Project website → School pages: generates
_plugins/school_pages.rb - School pages → Consent journey: links to
- Families → Consent journey: completes
- Consent journey → Journey rules: builds steps
consent-app/src/App.tsx - Consent journey → App state: reads state
consent-app/src/App.tsx - App state → Consent submission: coordinates saving
consent-app/src/state/context.tsx - Consent submission → API selection: submits consent
consent-app/src/state/useSync.ts - API selection → Mock or Firebase: selects backend
consent-app/src/api/index.ts - Consent journey → Screenshot upload: collects screenshots
- Screenshot upload → API selection: uploads files
consent-app/src/state/useUploader.ts - Families → Break-study journey: joins break study
- Break-study journey → Lab donations: sends donations
- Lab donations → API selection: submits donation
consent-app/src/lab/useLabSender.ts - API selection → Lab functions: routes lab calls
- Families → New Year study: joins study
- Research team → Staff portal: manages study
- Staff portal → Portal functions: uses portal API
consent-app/src/portal/TeamViews.tsx - Portal functions → Portal rules: calls rules
consent-app/firebase/functions/src/portalCore.ts - Portal functions → Firestore: reads and writes
consent-app/firebase/functions/src/portal.ts - Portal functions → Research team: sends email and notices
consent-app/firebase/functions/src/portal.ts - Research team → Study exports: uses study data
- Study exports → Firestore: reads records
consent-app/firebase/functions/src/export.ts - Project website → Enquiry handling: posts enquiries
- Enquiry handling → Firestore: stores enquiries
- Enquiry handling → Research team: emails team