# lekhanhdat/travel architecture

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

- Interactive diagram: https://gitdiagram.com/lekhanhdat/travel
- Repository: https://github.com/lekhanhdat/travel

## Overview

##### Project type and purpose
- This is a cross-platform React Native mobile application (“Travel”) that runs on Android and iOS.
- It provides users with travel-related features: camera capture, interactive maps, location details (audio, images, video), a news feed, and user authentication/profile management.

##### File structure
- Top-level folders and files:
- App.tsx + index.js – entry point for the JS bundle, register root component.
- babel.config.js, metro.config.js – JS bundler configuration.
- src/ – core application code, subdivided into:
– assets/ – images, SVGs, fonts
– common/ – shared styles, constants, types
– component/ – reusable UI components (buttons, headers, list items)
– container/screens/ – “smart” containers for each app screen (Camera, Home, Maps, NewFeed, Login, Profile)
– services/ – axios HTTP client wrapper and modules for AI API calls and location API calls
– utils/ – helper functions (storage, polyline decode, distance calc)
– res/ – resource aggregator (i18n strings, images)
- Configuration and lint/build scripts: .eslintrc.js, jest.config.js, Gemfile (Ruby tooling for iOS), build.gradle, Podfile, etc.

##### README
- Confirms this is a vanilla React Native app, bootstrapped with @react-native-community/cli.

##### Elements
- Native layers (gray)
- JS layers: Presentation (blue), Logic (green), Data (orange)
- External services (purple)
- Notes on key interfaces (e.g., React Native Bridge, AsyncStorage, Axios).

## Diagram (Mermaid)

```mermaid
graph TB

    classDef external fill:#DDA0DD,stroke:#000,stroke-width:1px
    classDef resource fill:#FFC0CB,stroke:#000,stroke-width:1px
    classDef data fill:#FFA07A,stroke:#000,stroke-width:1px
    classDef logic fill:#98FB98,stroke:#000,stroke-width:1px
    classDef pres fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef native fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef bundler fill:#FFE4B5,stroke:#000,stroke-width:1px

    subgraph "External Services"
        AI["AI API Endpoint"]:::external
        Geo["Location API Endpoint"]:::external
    end

    subgraph "Assets & Media"
        AssetJS["src/assets/"]:::resource
        RawAudio["android/app/src/main/res/raw/"]:::resource
        XCAssets["ios/Travel/Images.xcassets/"]:::resource
    end

    subgraph "Shared Resources & Constants"
        Common["src/common/"]:::data
        Res["src/res/"]:::data
    end

    subgraph "Data & Logic Layer"
        subgraph "Data Layer"
            LocalStorage["AsyncStorage\n(src/utils/LocalStorageCommon.tsx)"]:::data
            click LocalStorage "https://github.com/lekhanhdat/travel/blob/main/src/utils/LocalStorageCommon.tsx"
        end
        subgraph "Logic Layer"
            Services["API Services\n(src/services/)"]:::logic
            Utils["Utilities\n(src/utils/)"]:::logic
            click Services "https://github.com/lekhanhdat/travel/blob/main/src/services/axios.ts"
            click Utils "https://github.com/lekhanhdat/travel/blob/main/src/utils/Utils.tsx"
        end
    end

    subgraph "Presentation Layer"
        Components["UI Components\n(src/component/)"]:::pres
        Screens["Screen Containers\n(src/container/screens/)"]:::pres
        click Components "https://github.com/lekhanhdat/travel/tree/main/src/component/"
        click Screens "https://github.com/lekhanhdat/travel/tree/main/src/container/screens/"
    end

    Bundler["Metro Bundler\n(index.js, App.tsx, metro.config.js)"]:::bundler
    click Bundler "https://github.com/lekhanhdat/travel/blob/main/index.js"

    subgraph "Native Shell"
        Android["Android Shell"]:::native
        iOS["iOS Shell"]:::native
        click Android "https://github.com/lekhanhdat/travel/blob/main/android/app/src/main/java/com/travel/MainActivity.kt"
        click iOS "https://github.com/lekhanhdat/travel/blob/main/ios/Travel/AppDelegate.mm"
    end

    %% Connections
    Screens -->|"invokes"| Services
    Components -->|"renders"| Screens
    Services -->|"calls"| AI
    Services -->|"calls"| Geo
    AI -->|"response"| Services
    Geo -->|"response"| Services
    Services -->|"stores/reads"| LocalStorage
    LocalStorage -->|"data"| Screens
    Utils -->|"processes data"| Services
    Screens -->|"updates props"| Components
    AssetJS -->|"bundled"| Bundler
    RawAudio -->|"bundled"| Bundler
    XCAssets -->|"bundled"| Bundler
    Common -->|"imported by"| Bundler
    Res -->|"imported by"| Bundler
    Bundler -->|"delivers JS bundle"| Android
    Bundler -->|"delivers JS bundle"| iOS

    class AI,Geo external
    class AssetJS,RawAudio,XCAssets resource
    class Common,Res data
    class LocalStorage data
    class Services,Utils logic
    class Components,Screens pres
    class Android,iOS native
    class Bundler bundler
```
