# iamdeveloper112/fyxlife-test-task architecture

> Architecture diagram of the GitHub repository iamdeveloper112/fyxlife-test-task, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/iamdeveloper112/fyxlife-test-task
- Repository: https://github.com/iamdeveloper112/fyxlife-test-task

## Overview

##### Project type and purpose
- This is a standalone mobile health & wellness tracking app (Fyxlife) built with Expo Router and React Native.
- There is no external backend yet—state lives locally via AsyncStorage.
- Core goal: track user onboarding, goals, progress, and risk metrics on-device.

##### File structure
- Top-level “app/” directory holds all file-based routes (tabs, onboarding, not-found pages).
- “screens/” mirrors “app/” for isolated screen logic and styles.
- “components/” contains reusable UI widgets (cards, modals, selectors).
- “contexts/” holds React Context providers for global state (GoalsContext, UserContext).
- “utils/” defines theming, scaling helpers.
- “assets/” contains images.
- Config files: babel.config.js, tsconfig.json, eslint.config.js, package.json.

##### README for additional insights
- Navigation: Expo Router (file-based).
- State: React Context + AsyncStorage (local persistence).
- Future v1: add backend, data sync, React Query, domain services.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        subgraph "Navigation Layer"
            NL["Expo Router\n(app/_layout.tsx…)"]:::ui
        end
        subgraph "Onboarding Screens"
            OW["Welcome"]:::ui
            OUI["User Info"]:::ui
            OC["Confirmation"]:::ui
        end
        subgraph "Tab Screens"
            HT["Home"]:::ui
            PT["Progress"]:::ui
            RT["Risk Meter"]:::ui
        end
        subgraph "UI Components"
            AC["Activity Card"]:::ui
            AGM["Add Goal Modal"]:::ui
            GC["Goal Card"]:::ui
            PB["Primary Button"]:::ui
            OS["Option Selector"]:::ui
        end
    end

    %% Logic Layer
    subgraph "Logic Layer"
        UC["UserContext"]:::logic
        GCX["GoalsContext"]:::logic
    end

    %% Data Layer
    subgraph "Data Layer"
        AS["AsyncStorage"]:::data
    end

    %% Utility Layer
    subgraph "Utility"
        T["theme.ts"]:::util
        S["scaling.ts"]:::util
        C["constant.ts"]:::util
    end

    %% Connections: Navigation to Screens
    NL -->|routes to| OW
    NL -->|routes to| OUI
    NL -->|routes to| OC
    NL -->|routes to| HT
    NL -->|routes to| PT
    NL -->|routes to| RT

    %% Screens to UI Components
    OW -->|uses| AC
    OW -->|uses| PB
    OW -->|uses| OS
    OUI -->|uses| PB
    OUI -->|uses| OS
    OC -->|uses| PB

    HT -->|uses| GC
    HT -->|uses| AC
    PT -->|uses| AC
    RT -->|uses| AC

    %% Screens to Contexts
    OW -->|reads/writes| UC
    OUI -->|reads/writes| UC
    OC -->|reads/writes| UC
    HT -->|reads/writes| GCX
    PT -->|reads/writes| GCX
    RT -->|reads/writes| GCX

    %% Components to Contexts
    AC -->|updates/goals| GCX
    AGM -->|updates/goals| GCX
    GC -->|reads/goals| GCX
    PB -->|reads/user| UC
    OS -->|reads/user| UC

    %% Contexts to Data Store
    UC -->|persists| AS
    GCX -->|persists| AS

    %% Utilities consumed by Screens & Components
    T --> OW
    T --> OUI
    T --> OC
    T --> HT
    T --> PT
    T --> RT
    T --> AC
    T --> AGM
    T --> GC
    T --> PB
    T --> OS

    S --> OW
    S --> OUI
    S --> OC
    S --> HT
    S --> PT
    S --> RT
    S --> AC
    S --> AGM
    S --> GC
    S --> PB
    S --> OS

    C --> OW
    C --> OUI
    C --> OC
    C --> HT
    C --> PT
    C --> RT
    C --> AC
    C --> AGM
    C --> GC
    C --> PB
    C --> OS

    %% Click Events
    click NL "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/app/_layout.tsx"
    click OW "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/app/onboarding/welcome.tsx"
    click OUI "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/app/onboarding/user-info.tsx"
    click OC "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/app/onboarding/confirmation.tsx"
    click HT "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/app/(tabs)/index.tsx"
    click PT "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/app/(tabs)/progress.tsx"
    click RT "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/app/(tabs)/risk-meter.tsx"
    click AC "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/components/activity-Card/activity-Card.tsx"
    click AGM "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/components/add-goal-modal/add-goal-modal.tsx"
    click GC "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/components/goal-Card/goal-Card.tsx"
    click PB "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/components/primary-button/PrimaryButton.tsx"
    click OS "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/components/option-Selector/OptionSelector.tsx"
    click UC "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/contexts/UserContext.tsx"
    click GCX "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/contexts/GoalsContext.tsx"
    click T "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/utils/theme.ts"
    click S "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/utils/scaling.ts"
    click C "https://github.com/iamdeveloper112/fyxlife-test-task/blob/main/utils/constant.ts"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef logic fill:#FFA500,stroke:#333,stroke-width:1px
    classDef data fill:#90EE90,stroke:#333,stroke-width:1px
    classDef util fill:#D3D3D3,stroke:#333,stroke-width:1px
```
