# rafaelhgreco/apaeeventos_frontend architecture

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

- Interactive diagram: https://gitdiagram.com/rafaelhgreco/apaeeventos_frontend
- Repository: https://github.com/rafaelhgreco/apaeeventos_frontend

## Overview

##### Project type and purpose
- This is a cross-platform mobile application built with Expo and React Native.
- It targets Android (via the `android/` folder and native Android entry points), iOS (via Expo Go), and the web (via React Native Web).
- File-based routing lives in the `app/` directory; reusable UI elements in `components/`; styling constants and helpers in `constants/` and `hooks/`; static assets in `assets/`.

##### File structure
- Top-level “android/” folder contains the native Android project (Gradle files, `MainActivity.kt`, `MainApplication.kt`, resources).
- `app/` holds your Expo Router pages (`.tsx` files) and layouts.
- `components/` houses generic React components (Collapsible, ParallaxScrollView, ThemedView, etc.).
- `assets/` stores images & fonts used by the UI.
- Configuration: `package.json`, `tsconfig.json`, `eslint.config.js`, plus Node scripts in `scripts/`.

##### Key insights from README
- Created via `create-expo-app`, uses Expo CLI and Metro bundler.
- Encourages file-based routing: each `.tsx` in `app/` maps to a screen or layout.
- Development workflow: `npm install` → `npx expo start` → choose emulator, simulator, or Expo Go.

##### Main components
a. Developer Machine
- Expo CLI & Metro Bundler
- Node.js / npm environment
b. Application Code
- JS/TS layer: `app/` (screens & router), `components/`, `hooks/`, `constants/`
- Static assets: `assets/` (fonts, images)
c. Native Runtimes
- Android: Java/Kotlin entry points (`MainActivity.kt`, `MainApplication.kt`), Gradle build
- iOS: Expo Go runtime (not shown on file tree but implied)
d. Runtime & Deployment
- Metro Bundler → bundles JS → sends to device/emulator
- Expo Go (or dev build) on device runs JS in a native WebView/JSCore
- OTA updates via Expo servers (optional)

##### Relationships & data flow
- Developer Machine invokes Expo CLI → starts Metro Bundler
- Metro watches `app/`, `components/`, `hooks/`, `constants/`, `assets/` → creates JS bundle
- JS bundle is loaded into the native runtime (Android app or Expo Go)
- Native runtime bridges calls between JS and native modules (camera, sensors, storage)
- Navigation: file-based routing module resolves URL ↔ screen component

##### Architectural patterns & tech
- Component-based UI (React Native)
- File-based routing (Expo Router)
- Theming via hooks and constants
- Native bridge pattern for JS ↔ Native interactions
- Metro Bundler for bundling and hot reloading

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Machine
    subgraph "Developer Machine"
        ExpoCLI["Expo CLI"]:::dev
        Metro["Metro Bundler"]:::dev
    end

    %% JS Layer
    subgraph "JS Layer" 
        subgraph "File-based Routing (app/)"
            LayoutRoot["_layout.tsx"]:::js
            NotFound["+not-found.tsx"]:::js
            subgraph "(tabs)"
                TabsLayout["_layout.tsx"]:::js
                TabsIndex["index.tsx"]:::js
                Explore["explore.tsx"]:::js
            end
        end
        subgraph "Shared UI Components (components/)"
            Collapsible["Collapsible.tsx"]:::js
            Parallax["ParallaxScrollView.tsx"]:::js
            ThemedView["ThemedView.tsx"]:::js
            ThemedText["ThemedText.tsx"]:::js
            ExternalLink["ExternalLink.tsx"]:::js
            HapticTab["HapticTab.tsx"]:::js
            HelloWave["HelloWave.tsx"]:::js
            IconSymbol["IconSymbol.tsx"]:::js
            IconSymbolIOS["IconSymbol.ios.tsx"]:::js
            TabBarBG["TabBarBackground.tsx"]:::js
            TabBarBGIOS["TabBarBackground.ios.tsx"]:::js
        end
        subgraph "Theming (constants/ & hooks/)"
            Colors["Colors.ts"]:::js
            UseColorScheme["useColorScheme.ts"]:::js
            UseColorSchemeWeb["useColorScheme.web.ts"]:::js
            UseThemeColor["useThemeColor.ts"]:::js
        end
    end

    %% Static Assets
    Assets["Static Assets (assets/)"]:::assets

    %% Bundle and Bridge
    JSBundle["JS Bundle"]:::bundle
    NativeBridge["Native Bridge"]:::bridge

    %% Native Runtimes
    subgraph "Native Runtimes"
        subgraph "Android Native Runtime"
            MainActivity["MainActivity.kt"]:::native
            MainApplication["MainApplication.kt"]:::native
            BuildGradle["build.gradle"]:::native
            Manifest["AndroidManifest.xml"]:::native
            Res["res/"]:::native
        end
        ExpoGo["iOS (Expo Go)"]:::native
    end

    %% Connections
    ExpoCLI --> Metro
    Metro -->|watches code| LayoutRoot
    Metro --> JSBundle
    JSBundle --> NativeBridge
    NativeBridge --> MainActivity
    NativeBridge --> ExpoGo

    %% Click Events
    click ExpoCLI "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/package.json"
    click Metro "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/scripts/reset-project.js"
    click LayoutRoot "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/app/_layout.tsx"
    click NotFound "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/app/+not-found.tsx"
    click TabsLayout "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/app/(tabs)/_layout.tsx"
    click TabsIndex "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/app/(tabs)/index.tsx"
    click Explore "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/app/(tabs)/explore.tsx"
    click Collapsible "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/components/Collapsible.tsx"
    click Parallax "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/components/ParallaxScrollView.tsx"
    click ThemedView "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/components/ThemedView.tsx"
    click ThemedText "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/components/ThemedText.tsx"
    click ExternalLink "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/components/ExternalLink.tsx"
    click HapticTab "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/components/HapticTab.tsx"
    click HelloWave "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/components/HelloWave.tsx"
    click IconSymbol "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/components/ui/IconSymbol.tsx"
    click IconSymbolIOS "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/components/ui/IconSymbol.ios.tsx"
    click TabBarBG "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/components/ui/TabBarBackground.tsx"
    click TabBarBGIOS "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/components/ui/TabBarBackground.ios.tsx"
    click Colors "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/constants/Colors.ts"
    click UseColorScheme "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/hooks/useColorScheme.ts"
    click UseColorSchemeWeb "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/hooks/useColorScheme.web.ts"
    click UseThemeColor "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/hooks/useThemeColor.ts"
    click Assets "https://github.com/rafaelhgreco/apaeeventos_frontend/tree/main/assets/"
    click MainActivity "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/android/app/src/main/java/com/anonymous/ApaeEventos/MainActivity.kt"
    click MainApplication "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/android/app/src/main/java/com/anonymous/ApaeEventos/MainApplication.kt"
    click BuildGradle "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/android/app/build.gradle"
    click Manifest "https://github.com/rafaelhgreco/apaeeventos_frontend/blob/main/android/app/src/main/AndroidManifest.xml"
    click Res "https://github.com/rafaelhgreco/apaeeventos_frontend/tree/main/android/app/src/main/res/"

    %% Styles
    classDef dev fill:#aaaaaa,stroke:#333,stroke-width:1px
    classDef js fill:#ddeeff,stroke:#333,stroke-width:1px
    classDef assets fill:#ccffcc,stroke:#333,stroke-width:1px
    classDef native fill:#ffdd99,stroke:#333,stroke-width:1px
    classDef bundle fill:#eeeeee,stroke:#333,stroke-width:1px
    classDef bridge fill:#ffffcc,stroke:#333,stroke-width:1px
```
