# amirphiladam2/calorieeapp architecture

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

- Interactive diagram: https://gitdiagram.com/amirphiladam2/calorieeapp
- Repository: https://github.com/amirphiladam2/calorieeapp

## Overview

CalorieeApp is a React Native calorie and fitness tracker. Users enter through authentication and onboarding, then log meals, review calorie and macro progress, and manage goals and profile settings. Recipe generation can feed estimated nutrition into meal logging, while notification preferences support reminders and push alerts. The graph captures documented capabilities and source-index relationships; unsampled screens and integrations are represented at their known paths, but their internal calls are not inferred.

Main entry points: [`lib/supabase.ts`](https://github.com/amirphiladam2/calorieeapp/blob/main/lib/supabase.ts) (Supabase client), [`app/(screens)/ProfileScreen.tsx`](https://github.com/amirphiladam2/calorieeapp/blob/main/app/(screens)/ProfileScreen.tsx) (Profile management), [`services/profileService.ts`](https://github.com/amirphiladam2/calorieeapp/blob/main/services/profileService.ts) (Profile operations), [`components/HomeScreen/RecipeGeneratorCard.tsx`](https://github.com/amirphiladam2/calorieeapp/blob/main/components/HomeScreen/RecipeGeneratorCard.tsx) (Recipe discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and account"]
  node_auth["Sign in or register<br/>[LoginScreen.tsx]"]
  node_onboarding["Onboarding<br/>[Onboarding.tsx]"]
  node_auth_state["Auth session<br/>[useAuth.ts]"]
end

subgraph group_tracking["Meal tracking"]
  node_meal_entry["Add or edit meal<br/>[add-meal.tsx]"]
  node_meal_list["Meal history<br/>[meals.tsx]"]
  node_meal_types["Meal data types<br/>[todayMeals.ts]"]
  node_meal_thunks["Meal operations<br/>[mealsThunks.ts]"]
end

subgraph group_nutrition["Nutrition and recipes"]
  node_home["Daily overview<br/>[home.tsx]"]
  node_macros["Macro monitoring<br/>[macros.tsx]"]
  node_macro_targets["Macro target utilities<br/>[macroTargets.ts]"]
  node_recipe_generator["Recipe generation<br/>[recipeGenerator.ts]"]
  node_recipe_card["Recipe discovery"]
  node_recipe_book["Recipe details<br/>[recipe.tsx]"]
  node_recipe_prefill["Recipe meal prefill"]
end

subgraph group_profile["Profile and goals"]
  node_settings["Settings<br/>[settings.tsx]"]
  node_profile_screen["Profile management<br/>[ProfileScreen.tsx]"]
  node_profile_state["Profile loading<br/>[useProfile.ts]"]
  node_profile_service["Profile operations<br/>[profileService.ts]"]
  node_goals["Goal settings<br/>[GoalsTargets.tsx]"]
end

subgraph group_platform["Services and state"]
  node_meal_store["Meal state<br/>[mealsSlice.ts]"]
  node_redux_store["Redux store<br/>[index.ts]"]
  node_notifications["Notifications<br/>[notifications.ts]"]
  node_notification_manager["Notification bootstrap"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
end

node_user(("App user"))
node_supabase[("Supabase backend")]

node_user -->|"signs in"| node_auth
node_auth -->|"authenticates with"| node_supabase_client
node_auth_state -->|"reads auth session"| node_supabase_client
node_user -->|"logs meals"| node_meal_entry
node_meal_entry -->|"dispatches meal changes"| node_meal_thunks
node_meal_thunks -->|"reads and writes meals"| node_supabase_client
node_meal_thunks -->|"updates state"| node_meal_store
node_redux_store -->|"registers reducer"| node_meal_store
node_user -->|"reviews intake"| node_macros
node_user -->|"sets goals"| node_goals
node_user -->|"manages profile"| node_profile_screen
node_profile_screen -->|"loads profile"| node_profile_state
node_profile_screen -->|"uses profile operations"| node_profile_service
node_profile_state -->|"reads profile"| node_supabase_client
node_profile_service -->|"updates profile data"| node_supabase_client
node_settings -->|"renders profile"| node_profile_screen
node_settings -->|"saves preferences"| node_profile_service
node_settings -->|"configures reminders"| node_notifications
node_notification_manager -->|"schedules and registers"| node_notifications
node_notification_manager -->|"saves push token"| node_profile_service
node_recipe_card -->|"requests recipes"| node_recipe_generator
node_recipe_card -->|"uses recipe book"| node_recipe_book
node_recipe_card -->|"builds meal prefill"| node_recipe_prefill
node_recipe_book -->|"builds meal prefill"| node_recipe_prefill
node_recipe_generator -->|"uses backend"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase

click node_auth "https://github.com/amirphiladam2/calorieeapp/blob/main/app/(auth)/LoginScreen.tsx"
click node_onboarding "https://github.com/amirphiladam2/calorieeapp/blob/main/app/Onboarding.tsx"
click node_auth_state "https://github.com/amirphiladam2/calorieeapp/blob/main/hooks/useAuth.ts"
click node_meal_entry "https://github.com/amirphiladam2/calorieeapp/blob/main/app/(screens)/add-meal.tsx"
click node_meal_list "https://github.com/amirphiladam2/calorieeapp/blob/main/app/(tabs)/meals.tsx"
click node_meal_types "https://github.com/amirphiladam2/calorieeapp/blob/main/data/todayMeals.ts"
click node_meal_thunks "https://github.com/amirphiladam2/calorieeapp/blob/main/store/mealsThunks.ts"
click node_meal_store "https://github.com/amirphiladam2/calorieeapp/blob/main/store/mealsSlice.ts"
click node_redux_store "https://github.com/amirphiladam2/calorieeapp/blob/main/store/index.ts"
click node_home "https://github.com/amirphiladam2/calorieeapp/blob/main/app/(tabs)/home.tsx"
click node_macros "https://github.com/amirphiladam2/calorieeapp/blob/main/app/(tabs)/macros.tsx"
click node_macro_targets "https://github.com/amirphiladam2/calorieeapp/blob/main/utils/macroTargets.ts"
click node_recipe_generator "https://github.com/amirphiladam2/calorieeapp/blob/main/services/recipeGenerator.ts"
click node_recipe_card "https://github.com/amirphiladam2/calorieeapp/blob/main/components/HomeScreen/RecipeGeneratorCard.tsx"
click node_recipe_book "https://github.com/amirphiladam2/calorieeapp/blob/main/app/recipe.tsx"
click node_recipe_prefill "https://github.com/amirphiladam2/calorieeapp/blob/main/utils/recipeMealPrefill.ts"
click node_settings "https://github.com/amirphiladam2/calorieeapp/blob/main/app/(tabs)/settings.tsx"
click node_profile_screen "https://github.com/amirphiladam2/calorieeapp/blob/main/app/(screens)/ProfileScreen.tsx"
click node_profile_state "https://github.com/amirphiladam2/calorieeapp/blob/main/hooks/useProfile.ts"
click node_profile_service "https://github.com/amirphiladam2/calorieeapp/blob/main/services/profileService.ts"
click node_goals "https://github.com/amirphiladam2/calorieeapp/blob/main/app/(screens)/GoalsTargets.tsx"
click node_notifications "https://github.com/amirphiladam2/calorieeapp/blob/main/services/notifications.ts"
click node_notification_manager "https://github.com/amirphiladam2/calorieeapp/blob/main/components/AppNotificationManager.tsx"
click node_supabase_client "https://github.com/amirphiladam2/calorieeapp/blob/main/lib/supabase.ts"

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_auth,node_onboarding,node_auth_state,node_user toneBlue
class node_meal_entry,node_meal_list,node_meal_types,node_meal_thunks,node_supabase toneAmber
class node_home,node_macros,node_macro_targets,node_recipe_generator,node_recipe_card,node_recipe_book,node_recipe_prefill toneMint
class node_settings,node_profile_screen,node_profile_state,node_profile_service,node_goals toneRose
class node_meal_store,node_redux_store,node_notifications,node_notification_manager,node_supabase_client toneIndigo
```

## Components

### Entry and account

- [Sign in or register](https://github.com/amirphiladam2/calorieeapp/blob/main/app/(auth)/LoginScreen.tsx): `app/(auth)/LoginScreen.tsx`
- [Onboarding](https://github.com/amirphiladam2/calorieeapp/blob/main/app/Onboarding.tsx): `app/Onboarding.tsx`
- [Auth session](https://github.com/amirphiladam2/calorieeapp/blob/main/hooks/useAuth.ts): `hooks/useAuth.ts`

### Meal tracking

- [Add or edit meal](https://github.com/amirphiladam2/calorieeapp/blob/main/app/(screens)/add-meal.tsx): `app/(screens)/add-meal.tsx`
- [Meal history](https://github.com/amirphiladam2/calorieeapp/blob/main/app/(tabs)/meals.tsx): `app/(tabs)/meals.tsx`
- [Meal data types](https://github.com/amirphiladam2/calorieeapp/blob/main/data/todayMeals.ts): `data/todayMeals.ts`
- [Meal operations](https://github.com/amirphiladam2/calorieeapp/blob/main/store/mealsThunks.ts): `store/mealsThunks.ts`

### Nutrition and recipes

- [Daily overview](https://github.com/amirphiladam2/calorieeapp/blob/main/app/(tabs)/home.tsx): `app/(tabs)/home.tsx`
- [Macro monitoring](https://github.com/amirphiladam2/calorieeapp/blob/main/app/(tabs)/macros.tsx): `app/(tabs)/macros.tsx`
- [Macro target utilities](https://github.com/amirphiladam2/calorieeapp/blob/main/utils/macroTargets.ts): `utils/macroTargets.ts`
- [Recipe generation](https://github.com/amirphiladam2/calorieeapp/blob/main/services/recipeGenerator.ts): `services/recipeGenerator.ts`
- [Recipe discovery](https://github.com/amirphiladam2/calorieeapp/blob/main/components/HomeScreen/RecipeGeneratorCard.tsx): `components/HomeScreen/RecipeGeneratorCard.tsx`
- [Recipe details](https://github.com/amirphiladam2/calorieeapp/blob/main/app/recipe.tsx): `app/recipe.tsx`
- [Recipe meal prefill](https://github.com/amirphiladam2/calorieeapp/blob/main/utils/recipeMealPrefill.ts): `utils/recipeMealPrefill.ts`

### Profile and goals

- [Settings](https://github.com/amirphiladam2/calorieeapp/blob/main/app/(tabs)/settings.tsx): `app/(tabs)/settings.tsx`
- [Profile management](https://github.com/amirphiladam2/calorieeapp/blob/main/app/(screens)/ProfileScreen.tsx): `app/(screens)/ProfileScreen.tsx`
- [Profile loading](https://github.com/amirphiladam2/calorieeapp/blob/main/hooks/useProfile.ts): `hooks/useProfile.ts`
- [Profile operations](https://github.com/amirphiladam2/calorieeapp/blob/main/services/profileService.ts): `services/profileService.ts`
- [Goal settings](https://github.com/amirphiladam2/calorieeapp/blob/main/app/(screens)/GoalsTargets.tsx): `app/(screens)/GoalsTargets.tsx`

### Services and state

- [Meal state](https://github.com/amirphiladam2/calorieeapp/blob/main/store/mealsSlice.ts): `store/mealsSlice.ts`
- [Redux store](https://github.com/amirphiladam2/calorieeapp/blob/main/store/index.ts): `store/index.ts`
- [Notifications](https://github.com/amirphiladam2/calorieeapp/blob/main/services/notifications.ts): `services/notifications.ts`
- [Notification bootstrap](https://github.com/amirphiladam2/calorieeapp/blob/main/components/AppNotificationManager.tsx): `components/AppNotificationManager.tsx`
- [Supabase client](https://github.com/amirphiladam2/calorieeapp/blob/main/lib/supabase.ts): `lib/supabase.ts`

### Other components

- **App user**
- **Supabase backend**

## Connections

- App user → Sign in or register: signs in
- Sign in or register → Supabase client: authenticates with (evidence: `app/(auth)/LoginScreen.tsx`)
- Auth session → Supabase client: reads auth session (evidence: `hooks/useAuth.ts`)
- App user → Add or edit meal: logs meals
- Add or edit meal → Meal operations: dispatches meal changes (evidence: `app/(screens)/add-meal.tsx`)
- Meal operations → Supabase client: reads and writes meals (evidence: `store/mealsThunks.ts`)
- Meal operations → Meal state: updates state (evidence: `store/mealsThunks.ts`)
- Redux store → Meal state: registers reducer (evidence: `store/index.ts`)
- App user → Macro monitoring: reviews intake
- App user → Goal settings: sets goals
- App user → Profile management: manages profile
- Profile management → Profile loading: loads profile (evidence: `app/(screens)/ProfileScreen.tsx`)
- Profile management → Profile operations: uses profile operations (evidence: `app/(screens)/ProfileScreen.tsx`)
- Profile loading → Supabase client: reads profile (evidence: `hooks/useProfile.ts`)
- Profile operations → Supabase client: updates profile data (evidence: `services/profileService.ts`)
- Settings → Profile management: renders profile (evidence: `app/(tabs)/settings.tsx`)
- Settings → Profile operations: saves preferences (evidence: `app/(tabs)/settings.tsx`)
- Settings → Notifications: configures reminders (evidence: `app/(tabs)/settings.tsx`)
- Notification bootstrap → Notifications: schedules and registers (evidence: `components/AppNotificationManager.tsx`)
- Notification bootstrap → Profile operations: saves push token (evidence: `components/AppNotificationManager.tsx`)
- Recipe discovery → Recipe generation: requests recipes (evidence: `components/HomeScreen/RecipeGeneratorCard.tsx`)
- Recipe discovery → Recipe details: uses recipe book (evidence: `components/HomeScreen/RecipeGeneratorCard.tsx`)
- Recipe discovery → Recipe meal prefill: builds meal prefill (evidence: `components/HomeScreen/RecipeGeneratorCard.tsx`)
- Recipe details → Recipe meal prefill: builds meal prefill (evidence: `app/recipe.tsx`)
- Recipe generation → Supabase client: uses backend (evidence: `services/recipeGenerator.ts`)
- Supabase client → Supabase backend: connects to (evidence: `lib/supabase.ts`)
