# mixelluiguicorridoninahuaman/myafys architecture

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

- Interactive diagram: https://gitdiagram.com/mixelluiguicorridoninahuaman/myafys
- Repository: https://github.com/mixelluiguicorridoninahuaman/myafys

## Overview

##### Project Type and Purpose
- This is a cross-platform (iOS, Android, web) mobile application built with Expo and React Native in TypeScript.
- It uses file-based routing (in the **app/** directory) and connects to Firebase as its backend data store.

##### Key Architectural Elements
a. App Shell & Routing
- `app/index.tsx` – Entry point, loads the root navigation.
- `app/App.tsx` – Wraps the navigation container and global providers (theme, Firebase context, etc.).
- `app/Inicio.tsx`, `Fermentacion.tsx`, `Secado.tsx` – Screen-level “container” components handled by Expo’s file-based router.
b. Presentation Layer (UI Components)
- `components/` – Reusable presentational components (BoxData, Collapsible, Header, Footer, ParallaxScrollView, etc.).
c. Hooks & State Management
- `hooks/useFirebaseData.ts` – Custom hook that encapsulates Firebase SDK calls (reads/writes).
d. Data/Service Layer
- `firebaseConfig.js` – Exports initialized Firebase app and exports Firestore/Realtime references.
- Hooks import from `firebaseConfig.js` to perform CRUD.
e. Shared Resources
- `assets/` – Fonts and images consumed by components.
f. Build & Tooling
- `babel.config.js`, `tsconfig.json` – Transpiler and TS settings.
- `app.json` – Expo configuration (app name, platforms, splash screen).
- `scripts/reset-project.js` – Utility to scaffold a fresh codebase.

– Presentation Layer (Screens & UI Components)
– Hooks / Business Logic Layer
– Data/Service Layer (Firebase)
– Shared Resources (Constants, Assets)
– Tooling & Configuration (Babel, TS, Expo)
– Screens → import → UI Components
– Screens → invoke → Custom Hooks (e.g., `useFirebaseData`)
– Hooks → call → Firebase SDK (Firestore/RTDB)
– UI Components → read → Constants & Assets for styling/content
3. Architectural patterns:
– Container vs. Presentational components
– File-based routing for screen registration
– Hooks encapsulate external-service interaction
– Presentation: React Native, Expo Router
– Business Logic: React Hooks, TypeScript
– Data Layer: Firebase SDK (Auth, Firestore/RTDB)
5. Tailoring Tips for Mobile Apps
– Emphasize that the Expo App Shell initializes native modules (via `app.json`).
– Show platform targets (iOS, Android, web) branching off the Expo layer.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% App Shell & Routing
    subgraph "App Shell & Routing"
        AppIndex["app/index.tsx"]:::routing
        AppRoot["app/App.tsx"]:::routing
        Inicio["Screen: Inicio.tsx"]:::routing
        Fermentacion["Screen: Fermentacion.tsx"]:::routing
        Secado["Screen: Secado.tsx"]:::routing
    end

    %% Presentation Layer - UI Components
    subgraph "Presentation Layer (UI Components)"
        BoxData["BoxData.tsx"]:::ui
        BoxList["BoxList.tsx"]:::ui
        Collapsible["Collapsible.tsx"]:::ui
        Header["Header.tsx"]:::ui
        Footer["Footer.tsx"]:::ui
        Parallax["ParallaxScrollView.tsx"]:::ui
        ThemedText["ThemedText.tsx"]:::ui
        ThemedView["ThemedView.tsx"]:::ui
        TabBarIcon["TabBarIcon.tsx"]:::ui
    end

    %% Hooks & Business Logic Layer
    subgraph "Hooks & Business Logic Layer"
        UseFirebase["useFirebaseData.ts"]:::logic
        UseColorScheme["useColorScheme.ts"]:::logic
        UseThemeColor["useThemeColor.ts"]:::logic
    end

    %% Data/Service Layer
    subgraph "Data/Service Layer (Firebase)"
        FirebaseConfig["firebaseConfig.js"]:::data
    end

    %% Shared Resources
    subgraph "Shared Resources"
        Colors["constants/Colors.ts"]:::shared
        Fonts["assets/fonts/"]:::shared
        Images["assets/images/"]:::shared
    end

    %% Tooling & Configuration
    subgraph "Tooling & Configuration"
        BabelConfig["babel.config.js"]:::config
        TSConfig["tsconfig.json"]:::config
        AppJson["app.json"]:::config
        ResetScript["scripts/reset-project.js"]:::config
    end

    %% Relationships
    AppIndex -->|"wraps"| AppRoot
    AppRoot -->|"routes to"| Inicio
    AppRoot -->|"routes to"| Fermentacion
    AppRoot -->|"routes to"| Secado

    Inicio -->|"imports"| BoxData
    Inicio -->|"imports"| Collapsible
    Inicio -->|"imports"| Header
    Inicio -->|"imports"| Footer
    Inicio -->|"imports"| ThemedView

    Fermentacion -->|"imports"| Parallax
    Fermentacion -->|"imports"| BoxList
    Secado -->|"imports"| BoxList
    Secado -->|"imports"| ThemedText

    Inicio -->|"uses hook"| UseFirebase
    Fermentacion -->|"uses hook"| UseFirebase
    Secado -->|"uses hook"| UseFirebase

    UseFirebase -->|"calls"| FirebaseConfig
    UseColorScheme -->|"uses constants"| Colors
    UseThemeColor -->|"uses constants"| Colors

    BoxData -->|"reads styles"| Colors
    BoxData -->|"reads assets"| Images
    BoxList -->|"reads assets"| Images
    Parallax -->|"reads assets"| Fonts

    AppJson -->|"configures"| AppIndex

    %% Click Events
    click AppIndex "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/app/index.tsx"
    click AppRoot "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/app/App.tsx"
    click Inicio "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/app/Inicio.tsx"
    click Fermentacion "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/app/Fermentacion.tsx"
    click Secado "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/app/Secado.tsx"
    click BoxData "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/components/BoxData.tsx"
    click BoxList "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/components/BoxList.tsx"
    click Collapsible "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/components/Collapsible.tsx"
    click Header "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/components/Header.tsx"
    click Footer "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/components/Footer.tsx"
    click Parallax "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/components/ParallaxScrollView.tsx"
    click ThemedText "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/components/ThemedText.tsx"
    click ThemedView "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/components/ThemedView.tsx"
    click TabBarIcon "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/components/navigation/TabBarIcon.tsx"
    click UseFirebase "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/hooks/useFirebaseData.ts"
    click UseColorScheme "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/hooks/useColorScheme.ts"
    click UseThemeColor "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/hooks/useThemeColor.ts"
    click FirebaseConfig "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/firebaseConfig.js"
    click Colors "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/constants/Colors.ts"
    click Fonts "https://github.com/mixelluiguicorridoninahuaman/myafys/tree/main/assets/fonts/"
    click Images "https://github.com/mixelluiguicorridoninahuaman/myafys/tree/main/assets/images/"
    click BabelConfig "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/babel.config.js"
    click TSConfig "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/tsconfig.json"
    click AppJson "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/app.json"
    click ResetScript "https://github.com/mixelluiguicorridoninahuaman/myafys/blob/main/scripts/reset-project.js"

    %% Styles
    classDef routing fill:#D6EAF8,stroke:#1B4F72,color:#154360
    classDef ui fill:#AED6F1,stroke:#1A5276,color:#1B2631
    classDef logic fill:#ABEBC6,stroke:#186A3B,color:#1E5128
    classDef data fill:#A3E4D7,stroke:#117A65,color:#0E6251
    classDef shared fill:#F9E79F,stroke:#9A7D0A,color:#7E5109
    classDef config fill:#D5D8DC,stroke:#566573,color:#1C2833
```
