# sonic-sabers/jet-set-go architecture

> Architecture diagram of the GitHub repository sonic-sabers/jet-set-go, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sonic-sabers/jet-set-go
- Repository: https://github.com/sonic-sabers/jet-set-go

## Overview

##### Main Components
- Mobile UI Layer (React Native):
- Screens and Components: Represent each of the main UI components described (Splash Screen, Home Screen, Flight Filter Screen, Modal Filter, Flight Details, Flight Seating, Cost Breakup).
- Assets: Include the Screen-ui folder that holds images and other UI resources.
- Navigation & State Management (if in use): Although not explicitly mentioned, you might add a module for managing navigation (using libraries like React Navigation) and any state management (Redux or Context API) if present.

- JavaScript Core & Bundler:
- Metro Bundler: Illustrate it as the process that bundles and serves the JavaScript code to the mobile environments.
- Main Files: Mention key entry points such as App.tsx, index.js, and babel.config.js.

- Native Platforms:
- Android:
- Android Project Structure: Highlight the “android” folder, Gradle build files (build.gradle, gradle.properties, settings.gradle), and the generated build outputs. This shows how the JavaScript bundle and native code (e.g., MainActivity.java, MainApplication.java) integrate.
- iOS:
- iOS Project Structure: Show the “ios” folder including the Xcode project, AppDelegate, main.m, and resource files like Info.plist and launch storyboards.

- Development & Tooling:
- Testing: Reference the __tests__ folder that contains test files for components.
- Code Quality: Include configuration files such as .eslintrc.js and .prettierrc.js.
- Environment & Build Scripts: Note files such as .env, app.json, and others that support environment configuration and building.

##### Relationships and Data Flow
- That the Mobile UI layer (React components) communicates with the Metro Bundler for code updates and hot reloads.
- Connections between the assets (in Screen-ui) and the display components in the UI layer.
- Optionally, if there is any asynchronous data fetching (for live flight information) or local storage handling, indicate these interactions as separate services or modules.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Emphasize the separation between the presentation layer (React components) and native build layers (Android/iOS).
- Cross-Platform Code Reuse: Note that the majority of the application logic is developed in JavaScript using React Native, while each platform contains a native “shell” to host the JavaScript bundle.
- Build and Deployment Pipeline: Optionally, include a small segment that shows the build commands (npm run android / ios) feeding the metro bundler and then into the respective native build tools (Gradle for Android and Xcode for iOS).

##### Relevant Technologies, Frameworks, and Libraries
- React Native – for the core UI and app logic.
- Metro Bundler – for JavaScript bundling.
- Gradle and Xcode – for building native binaries on Android and iOS respectively.
- Node.js and npm/Yarn – for dependency and script management.
- Optional Testing Frameworks – Jest (indicated by jest.config.js) and React Native testing libraries.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Development & Tooling
    subgraph "Development & Tooling"
        DEV1[".env"]:::dev
        DEV2[".eslintrc.js"]:::dev
        DEV3[".prettierrc.js"]:::dev
        DEV4["app.json"]:::dev
        DEV5["jest.config.js"]:::dev
    end

    %% React Native UI Layer
    subgraph "React Native UI Layer"
        UI8["App.js (UI)"]:::ui
        UI1["Splash Screen"]:::ui
        UI2["Home Screen"]:::ui
        UI3["Flight Filter Screen"]:::ui
        UI4["Flight Details"]:::ui
        UI5["Flight Seating"]:::ui
        UI6["Cost Breakup"]:::ui
        UI7["Screen-ui Assets"]:::asset
        UI9["__tests__"]:::dev
    end

    %% JavaScript Core & Bundler
    subgraph "JavaScript Core & Bundler"
        JB1["Metro Bundler"]:::bundler
        JB2["index.js"]:::bundler
        JB3["babel.config.js"]:::bundler
        JB4["metro.config.js"]:::bundler
    end

    %% Android Platform
    subgraph "Android Platform"
        AN1["android Folder"]:::native
    end

    %% iOS Platform
    subgraph "iOS Platform"
        IOS1["ios Folder"]:::native
    end

    %% Connections and Data Flow
    UI8 -->|"updates"| JB1
    UI1 -->|"user interaction"| UI8
    UI2 -->|"user interaction"| UI8
    UI3 -->|"user interaction"| UI8
    UI4 -->|"user interaction"| UI8
    UI5 -->|"user interaction"| UI8
    UI6 -->|"user interaction"| UI8
    UI7 ---|"assets used by"| UI8
    UI9 ---|"tests validate"| UI8

    DEV1 ---|"config"| JB1
    DEV2 ---|"linting"| JB1
    DEV3 ---|"formatting"| JB1
    DEV4 ---|"app config"| JB1
    DEV5 ---|"testing config"| JB1

    JB1 -->|"integrates"| AN1
    JB1 -->|"integrates"| IOS1

    %% Click Events for Component Mapping
    click UI8 "https://github.com/sonic-sabers/jet-set-go/blob/main/App.js"
    click UI7 "https://github.com/sonic-sabers/jet-set-go/tree/main/Screen-ui"
    click UI9 "https://github.com/sonic-sabers/jet-set-go/tree/main/__tests__"
    click JB2 "https://github.com/sonic-sabers/jet-set-go/blob/main/index.js"
    click JB3 "https://github.com/sonic-sabers/jet-set-go/blob/main/babel.config.js"
    click JB4 "https://github.com/sonic-sabers/jet-set-go/blob/main/metro.config.js"
    click AN1 "https://github.com/sonic-sabers/jet-set-go/tree/main/android"
    click IOS1 "https://github.com/sonic-sabers/jet-set-go/tree/main/ios"
    click DEV1 "https://github.com/sonic-sabers/jet-set-go/blob/main/.env"
    click DEV2 "https://github.com/sonic-sabers/jet-set-go/blob/main/.eslintrc.js"
    click DEV3 "https://github.com/sonic-sabers/jet-set-go/blob/main/.prettierrc.js"
    click DEV4 "https://github.com/sonic-sabers/jet-set-go/blob/main/app.json"
    click DEV5 "https://github.com/sonic-sabers/jet-set-go/blob/main/jest.config.js"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef asset fill:#87CEFA,stroke:#000,stroke-width:2px;
    classDef bundler fill:#FFFF99,stroke:#000,stroke-width:2px;
    classDef native fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef dev fill:#FFA07A,stroke:#000,stroke-width:2px;
```
