# haider-mukhtar/reactnative-animated-chat-bar architecture

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

- Interactive diagram: https://gitdiagram.com/haider-mukhtar/reactnative-animated-chat-bar
- Repository: https://github.com/haider-mukhtar/reactnative-animated-chat-bar

## Overview

##### Project type and purpose
- This is a React Native mobile app created with Expo CLI, focused on a reusable, animated chat input bar component. There is no server-side or database layer; the app runs entirely on the device, leveraging Expo’s SDK, React Native, and react-native-reanimated for smooth animations.

##### File structure
- Top-level files: configuration and metadata (.gitignore, package.json, tsconfig.json, eslint.config.js, app.json)
- Directories:
- app/ - entrypoint for file-based routing (layout.tsx, index.tsx)
- assets/ - static resources (fonts, images)
- No backend, no tests, no server code—purely a client-side UI component library.

##### README for insights
- Tech stack: React Native, Expo, TypeScript, react-native-reanimated
- Usage: install via npm, run with expo start, file-based routing in app/
- No external APIs or services (apart from device-level APIs, e.g., camera, file system)

##### Detail
- Every layer: dev, bundler, JS runtime, animation engine, native modules, UI renderer.
- How file-based routing in app/ triggers navigation.
- User input → component state → animation cycle → native API call.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Development Environment
    subgraph "Development Environment"
        direction TB
        DevWorkstation["Developer Workstation (IDE)"]:::dev
        ExpoCLI["Expo CLI"]:::dev
        MetroBundler["Metro Bundler"]:::dev
        DevWorkstation -->|"write code"| ExpoCLI
        ExpoCLI -->|"start bundler"| MetroBundler
    end

    %% Bundling
    MetroBundler -->|"bundle JS"| Device["Mobile Device"] 

    %% Mobile Device Layers
    subgraph "Mobile Device"
        direction TB

        %% JS Layer
        subgraph "JS Layer" 
            direction TB
            Router["File-based Router"]:::js
            Layout["Layout (app/_layout.tsx)"]:::js
            EntryScreen["Entry Screen (app/index.tsx)"]:::js
            ComponentsGroup["UI Components"]:::js
            ChatInput["Animated Chat Bar (components/animated-chat-bar.tsx)"]:::js
            IconComp["Chat Bar Icon (components/animated-chat-bar-icon.tsx)"]:::js
            Router -->|routes to| EntryScreen
            Router -->|wraps| Layout
            ComponentsGroup --> ChatInput
            ComponentsGroup --> IconComp
        end

        %% State & UI Renderer
        State["React State & Rendering"]:::js
        Router --> State
        ComponentsGroup --> State
        State -->|"update UI"| UIRenderer["UI Renderer"]:::js

        %% Animation Layer
        subgraph "Animation Layer"
            direction TB
            Reanimated["react-native-reanimated Engine"]:::animation
            Worklets["Worklets (off-thread)"]:::animation
            State -->|"invoke worklet"| Reanimated
            Reanimated --> Worklets
            Worklets -->|"render frames"| UIRenderer
        end

        %% Native Modules
        subgraph "Native Layer"
            direction TB
            Camera["Camera Module"]:::native
            ImagePicker["Image Picker"]:::native
            FileSystem["File System"]:::native
            IconComp -->|"native bridge call"| Camera
            IconComp -->|"native bridge call"| ImagePicker
            ComponentsGroup -->|"asset load"| FileSystem
        end

        %% Assets
        Assets["Assets Module"]:::js
        Fonts["Fonts (assets/fonts/)"]:::js
        Images["Images (assets/images/)"]:::js
        Assets --> Fonts
        Assets --> Images
        ComponentsGroup -->|"use assets"| Assets

    end

    %% Configuration Files
    subgraph "Configuration & Metadata"
        direction TB
        AppConfig["app.json"]:::dev
        PackageJSON["package.json"]:::dev
        TSConfig["tsconfig.json"]:::dev
        ESLint["eslint.config.js"]:::dev
        MetroSettings["Metro & Expo CLI Settings"]:::dev
    end

    %% Click Events
    click Layout "https://github.com/haider-mukhtar/reactnative-animated-chat-bar/blob/main/app/_layout.tsx"
    click EntryScreen "https://github.com/haider-mukhtar/reactnative-animated-chat-bar/blob/main/app/index.tsx"
    click ChatInput "https://github.com/haider-mukhtar/reactnative-animated-chat-bar/blob/main/components/animated-chat-bar.tsx"
    click IconComp "https://github.com/haider-mukhtar/reactnative-animated-chat-bar/blob/main/components/animated-chat-bar-icon.tsx"
    click Fonts "https://github.com/haider-mukhtar/reactnative-animated-chat-bar/tree/main/assets/fonts/"
    click Images "https://github.com/haider-mukhtar/reactnative-animated-chat-bar/tree/main/assets/images/"
    click AppConfig "https://github.com/haider-mukhtar/reactnative-animated-chat-bar/blob/main/app.json"
    click PackageJSON "https://github.com/haider-mukhtar/reactnative-animated-chat-bar/blob/main/package.json"
    click TSConfig "https://github.com/haider-mukhtar/reactnative-animated-chat-bar/blob/main/tsconfig.json"
    click ESLint "https://github.com/haider-mukhtar/reactnative-animated-chat-bar/blob/main/eslint.config.js"
    click MetroSettings "https://github.com/haider-mukhtar/reactnative-animated-chat-bar/blob/main/package-lock.json"

    %% Styles
    classDef dev fill:#cccccc,stroke:#333,stroke-width:1px
    classDef js fill:#AEDFF7,stroke:#333,stroke-width:1px
    classDef animation fill:#FFD27F,stroke:#333,stroke-width:1px
    classDef native fill:#A8E6A3,stroke:#333,stroke-width:1px
```
