# noeylovecatholy/well-buddy architecture

> Architecture diagram of the GitHub repository noeylovecatholy/well-buddy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/noeylovecatholy/well-buddy
- Repository: https://github.com/noeylovecatholy/well-buddy

## Overview

WellBuddy is a React Native family wellness app with a small OTP/password backend. The main user flow enters through the app navigator, completes authentication and a health profile, then uses nutrition, hydration, family, and notification features backed by Firebase. The graph preserves major capabilities visible in the tree and README; some screen-to-service wiring and backend internals are not shown, so those relationships are omitted rather than inferred.

Main entry points: [`app.js`](https://github.com/noeylovecatholy/well-buddy/blob/main/app.js) (App navigation), [`firebase.js`](https://github.com/noeylovecatholy/well-buddy/blob/main/firebase.js) (Firebase services), [`foodLogService.js`](https://github.com/noeylovecatholy/well-buddy/blob/main/foodLogService.js) (Food logs), [`notificationCenterService.js`](https://github.com/noeylovecatholy/well-buddy/blob/main/notificationCenterService.js) (Notification center)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and access"]
  node_navigator["App navigation<br/>[app.js]"]
  node_auth_screens["Authentication screens"]
  node_auth_service["Authentication service<br/>[authservice.js]"]
  node_survey_screens["Health profile flow"]
  node_survey_service["Survey profiles<br/>[surveyService.js]"]
end

subgraph group_wellness["Health tracking"]
  node_nutrition_screens["Food and scan screens"]
  node_insights["Nutrition insights<br/>[InsightsScreen.js]"]
  node_food_logs["Food logs<br/>[foodLogService.js]"]
  node_water_logs["Water tracking<br/>[waterLogService.js]"]
  node_nutrition_calc["Nutrition calculations"]
  node_pantry["Pantry and recipes<br/>[PantryScreen.js]"]
  node_recipe_detail["Recipe details"]
  node_fridge_service["Fridge inventory<br/>[fridgeService.js]"]
  node_menu_service["Menu service<br/>[menuService.js]"]
  node_ingredient_photo["Ingredient photos"]
  node_ai_service["Food analysis<br/>[geminiService.js]"]
end

subgraph group_family["Family and alerts"]
  node_family_screens["Family screens"]
  node_family_service["Family management<br/>[familyService.js]"]
  node_notification_screens["Notifications"]
  node_notification_center["Notification center"]
  node_notification_rules["Notification rules"]
  node_notification_service["Device notifications"]
end

subgraph group_platform["Data and services"]
  node_firebase[("Firebase services<br/>[firebase.js]")]
  node_language["Language context<br/>[LanguageContext.js]"]
  node_translations["Translations<br/>[appI18n.js]"]
  node_otp_frontend["OTP client<br/>[otpService.js]"]
  node_otp_backend["OTP backend<br/>[index.js]"]
end

subgraph group_admin["Administration"]
  node_admin_app["Admin screens<br/>[AdminDashboard.js]"]
  node_admin_web["Admin web tools"]
  node_seed_service["Seed data<br/>[seedService.js]"]
end

node_user(("App user"))
node_resend["Resend email"]
node_firebase_admin["Firebase Admin SDK"]

node_user -->|"opens app"| node_navigator
node_navigator -->|"routes to"| node_auth_screens
node_navigator -->|"routes to"| node_survey_screens
node_navigator -->|"routes to"| node_family_screens
node_navigator -->|"routes to"| node_recipe_detail
node_navigator -->|"routes to"| node_notification_screens
node_navigator -->|"provides context"| node_language
node_auth_screens -->|"calls"| node_auth_service
node_auth_screens -->|"checks profile"| node_survey_service
node_survey_screens -->|"saves profile"| node_survey_service
node_family_screens -->|"calls"| node_family_service
node_family_screens -->|"loads details"| node_family_service
node_family_screens -->|"loads member logs"| node_food_logs
node_family_screens -->|"loads profile"| node_survey_service
node_recipe_detail -->|"records food"| node_food_logs
node_recipe_detail -->|"uses menu"| node_menu_service
node_recipe_detail -->|"uses inventory"| node_fridge_service
node_recipe_detail -->|"loads photos"| node_ingredient_photo
node_insights -.->|"reads nutrition"| node_food_logs
node_food_logs -->|"gets water stats"| node_water_logs
node_notification_center -->|"reads family data"| node_family_service
node_notification_center -->|"reads daily logs"| node_food_logs
node_notification_center -->|"uses rules"| node_notification_rules
node_notification_service -->|"uses rules"| node_notification_rules
node_navigator -->|"configures alerts"| node_notification_service
node_language -->|"translates"| node_translations
node_notification_center -->|"translates messages"| node_translations
node_auth_service -->|"uses auth and data"| node_firebase
node_survey_service -->|"reads and writes"| node_firebase
node_family_service -->|"reads and writes"| node_firebase
node_food_logs -->|"reads and writes"| node_firebase
node_water_logs -->|"reads and writes"| node_firebase
node_fridge_service -->|"stores inventory"| node_firebase
node_notification_center -->|"stores alerts"| node_firebase
node_otp_frontend -.->|"calls API"| node_otp_backend
node_otp_backend -->|"sends OTP email"| node_resend
node_otp_backend -->|"changes password"| node_firebase_admin
node_admin_app -->|"uses backend data"| node_firebase
node_seed_service -->|"writes sample data"| node_firebase

click node_navigator "https://github.com/noeylovecatholy/well-buddy/blob/main/app.js"
click node_auth_service "https://github.com/noeylovecatholy/well-buddy/blob/main/authservice.js"
click node_survey_service "https://github.com/noeylovecatholy/well-buddy/blob/main/surveyService.js"
click node_insights "https://github.com/noeylovecatholy/well-buddy/blob/main/InsightsScreen.js"
click node_food_logs "https://github.com/noeylovecatholy/well-buddy/blob/main/foodLogService.js"
click node_water_logs "https://github.com/noeylovecatholy/well-buddy/blob/main/waterLogService.js"
click node_nutrition_calc "https://github.com/noeylovecatholy/well-buddy/blob/main/nutritionCalculator.js"
click node_pantry "https://github.com/noeylovecatholy/well-buddy/blob/main/PantryScreen.js"
click node_recipe_detail "https://github.com/noeylovecatholy/well-buddy/blob/main/RecipeDetailScreen.js"
click node_fridge_service "https://github.com/noeylovecatholy/well-buddy/blob/main/fridgeService.js"
click node_menu_service "https://github.com/noeylovecatholy/well-buddy/blob/main/menuService.js"
click node_ingredient_photo "https://github.com/noeylovecatholy/well-buddy/blob/main/ingredientPhotoService.js"
click node_ai_service "https://github.com/noeylovecatholy/well-buddy/blob/main/geminiService.js"
click node_family_service "https://github.com/noeylovecatholy/well-buddy/blob/main/familyService.js"
click node_notification_screens "https://github.com/noeylovecatholy/well-buddy/blob/main/NotificationScreen.js"
click node_notification_center "https://github.com/noeylovecatholy/well-buddy/blob/main/notificationCenterService.js"
click node_notification_rules "https://github.com/noeylovecatholy/well-buddy/blob/main/notificationRules.js"
click node_notification_service "https://github.com/noeylovecatholy/well-buddy/blob/main/notificationService.js"
click node_firebase "https://github.com/noeylovecatholy/well-buddy/blob/main/firebase.js"
click node_language "https://github.com/noeylovecatholy/well-buddy/blob/main/LanguageContext.js"
click node_translations "https://github.com/noeylovecatholy/well-buddy/blob/main/appI18n.js"
click node_otp_frontend "https://github.com/noeylovecatholy/well-buddy/blob/main/otpService.js"
click node_otp_backend "https://github.com/noeylovecatholy/well-buddy/blob/main/backend/index.js"
click node_admin_app "https://github.com/noeylovecatholy/well-buddy/blob/main/AdminDashboard.js"
click node_admin_web "https://github.com/noeylovecatholy/well-buddy/tree/main/admin/js"
click node_seed_service "https://github.com/noeylovecatholy/well-buddy/blob/main/seedService.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_navigator,node_auth_screens,node_auth_service,node_survey_screens,node_survey_service,node_user toneBlue
class node_nutrition_screens,node_insights,node_food_logs,node_water_logs,node_nutrition_calc,node_pantry,node_recipe_detail,node_fridge_service,node_menu_service,node_ingredient_photo,node_ai_service toneAmber
class node_family_screens,node_family_service,node_notification_screens,node_notification_center,node_notification_rules,node_notification_service toneMint
class node_firebase,node_language,node_translations,node_otp_frontend,node_otp_backend toneRose
class node_admin_app,node_admin_web,node_seed_service,node_resend,node_firebase_admin toneIndigo
```

## Components

### App and access

- [App navigation](https://github.com/noeylovecatholy/well-buddy/blob/main/app.js): `app.js`
- **Authentication screens**
- [Authentication service](https://github.com/noeylovecatholy/well-buddy/blob/main/authservice.js): `authservice.js`
- **Health profile flow**
- [Survey profiles](https://github.com/noeylovecatholy/well-buddy/blob/main/surveyService.js): `surveyService.js`

### Health tracking

- **Food and scan screens**
- [Nutrition insights](https://github.com/noeylovecatholy/well-buddy/blob/main/InsightsScreen.js): `InsightsScreen.js`
- [Food logs](https://github.com/noeylovecatholy/well-buddy/blob/main/foodLogService.js): `foodLogService.js`
- [Water tracking](https://github.com/noeylovecatholy/well-buddy/blob/main/waterLogService.js): `waterLogService.js`
- [Nutrition calculations](https://github.com/noeylovecatholy/well-buddy/blob/main/nutritionCalculator.js): `nutritionCalculator.js`
- [Pantry and recipes](https://github.com/noeylovecatholy/well-buddy/blob/main/PantryScreen.js): `PantryScreen.js`
- [Recipe details](https://github.com/noeylovecatholy/well-buddy/blob/main/RecipeDetailScreen.js): `RecipeDetailScreen.js`
- [Fridge inventory](https://github.com/noeylovecatholy/well-buddy/blob/main/fridgeService.js): `fridgeService.js`
- [Menu service](https://github.com/noeylovecatholy/well-buddy/blob/main/menuService.js): `menuService.js`
- [Ingredient photos](https://github.com/noeylovecatholy/well-buddy/blob/main/ingredientPhotoService.js): `ingredientPhotoService.js`
- [Food analysis](https://github.com/noeylovecatholy/well-buddy/blob/main/geminiService.js): `geminiService.js`

### Family and alerts

- **Family screens**
- [Family management](https://github.com/noeylovecatholy/well-buddy/blob/main/familyService.js): `familyService.js`
- [Notifications](https://github.com/noeylovecatholy/well-buddy/blob/main/NotificationScreen.js): `NotificationScreen.js`
- [Notification center](https://github.com/noeylovecatholy/well-buddy/blob/main/notificationCenterService.js): `notificationCenterService.js`
- [Notification rules](https://github.com/noeylovecatholy/well-buddy/blob/main/notificationRules.js): `notificationRules.js`
- [Device notifications](https://github.com/noeylovecatholy/well-buddy/blob/main/notificationService.js): `notificationService.js`

### Data and services

- [Firebase services](https://github.com/noeylovecatholy/well-buddy/blob/main/firebase.js): `firebase.js`
- [Language context](https://github.com/noeylovecatholy/well-buddy/blob/main/LanguageContext.js): `LanguageContext.js`
- [Translations](https://github.com/noeylovecatholy/well-buddy/blob/main/appI18n.js): `appI18n.js`
- [OTP client](https://github.com/noeylovecatholy/well-buddy/blob/main/otpService.js): `otpService.js`
- [OTP backend](https://github.com/noeylovecatholy/well-buddy/blob/main/backend/index.js): `backend/index.js`

### Administration

- [Admin screens](https://github.com/noeylovecatholy/well-buddy/blob/main/AdminDashboard.js): `AdminDashboard.js`
- [Admin web tools](https://github.com/noeylovecatholy/well-buddy/tree/main/admin/js): `admin/js`
- [Seed data](https://github.com/noeylovecatholy/well-buddy/blob/main/seedService.js): `seedService.js`

### Other components

- **App user**
- **Resend email**
- **Firebase Admin SDK**

## Connections

- App user → App navigation: opens app (evidence: `app.js`)
- App navigation → Authentication screens: routes to (evidence: `app.js`)
- App navigation → Health profile flow: routes to (evidence: `app.js`)
- App navigation → Family screens: routes to (evidence: `app.js`)
- App navigation → Recipe details: routes to (evidence: `app.js`)
- App navigation → Notifications: routes to (evidence: `app.js`)
- App navigation → Language context: provides context (evidence: `app.js`)
- Authentication screens → Authentication service: calls
- Authentication screens → Survey profiles: checks profile
- Health profile flow → Survey profiles: saves profile (evidence: `surveyService.js`)
- Family screens → Family management: calls
- Family screens → Family management: loads details
- Family screens → Food logs: loads member logs
- Family screens → Survey profiles: loads profile
- Recipe details → Food logs: records food (evidence: `RecipeDetailScreen.js`)
- Recipe details → Menu service: uses menu (evidence: `RecipeDetailScreen.js`)
- Recipe details → Fridge inventory: uses inventory (evidence: `RecipeDetailScreen.js`)
- Recipe details → Ingredient photos: loads photos (evidence: `RecipeDetailScreen.js`)
- Nutrition insights → Food logs: reads nutrition
- Food logs → Water tracking: gets water stats (evidence: `foodLogService.js`)
- Notification center → Family management: reads family data (evidence: `notificationCenterService.js`)
- Notification center → Food logs: reads daily logs (evidence: `notificationCenterService.js`)
- Notification center → Notification rules: uses rules (evidence: `notificationCenterService.js`)
- Device notifications → Notification rules: uses rules (evidence: `notificationService.js`)
- App navigation → Device notifications: configures alerts (evidence: `app.js`)
- Language context → Translations: translates (evidence: `LanguageContext.js`)
- Notification center → Translations: translates messages (evidence: `notificationCenterService.js`)
- Authentication service → Firebase services: uses auth and data (evidence: `authservice.js`)
- Survey profiles → Firebase services: reads and writes (evidence: `surveyService.js`)
- Family management → Firebase services: reads and writes (evidence: `familyService.js`)
- Food logs → Firebase services: reads and writes (evidence: `foodLogService.js`)
- Water tracking → Firebase services: reads and writes (evidence: `waterLogService.js`)
- Fridge inventory → Firebase services: stores inventory (evidence: `fridgeService.js`)
- Notification center → Firebase services: stores alerts (evidence: `notificationCenterService.js`)
- OTP client → OTP backend: calls API
- OTP backend → Resend email: sends OTP email (evidence: `README.md`)
- OTP backend → Firebase Admin SDK: changes password (evidence: `README.md`)
- Admin screens → Firebase services: uses backend data (evidence: `AdminDashboard.js`)
- Seed data → Firebase services: writes sample data (evidence: `seedService.js`)
