# teddythinh/ui-design-course architecture

> Architecture diagram of the GitHub repository teddythinh/ui-design-course, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/teddythinh/ui-design-course
- Repository: https://github.com/teddythinh/ui-design-course

## Overview

##### Main Components Identification

A. Frontend Layer (Mobile App)
- Divide into these major sections:
- UI Components
- Navigation
- Screens
- Assets/Data
- Internationalization

##### Component Relationships

**┌─ Mobile Application Layer ─────────────────────┐**

- ┌─ Navigation ─────┐    ┌─ Screens ───────┐  │
- MainNavigator  │    │ - Home          │  │
- TabNavigator   │    │ - Booking       │  │
- ┘    │ - Payment       │  │
- History       │  │
- ┌─ Components ────┐    └────────────────┘  │
- AutoComplete  │                        │
- DatePickers   │    ┌─ Assets ───────┐  │
- Lists         │    │ - Cities       │  │
- Cards         │    │ - Banks        │  │
- ┘    │ - E-wallets    │  │
- ┘  │
- ┌─ i18n ──────────┐                       │
- Localization    │                       │
- ┘                       │
- ┘

##### Important Elements

a. Component Categories:
- UI Components (showing reusable components like AutoComplete, DatePicker, etc.)
- Screen Flow (showing the relationship between different screens)
- Navigation Structure (showing how MainNavigator and TabNavigator interact)
- Data Flow (showing how assets are used across components)

b. Key Interactions:
- Data flow between components and screens
- How shared components are used across different screens

##### Specific Implementation Details

Key architectural patterns:
- Component-based architecture (React Native)
- Navigation pattern (Stack/Tab navigation)
- Shared component strategy
- Asset management
- Internationalization support

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Mobile_Application_Layer
        subgraph Navigation
            MainNav["Main Navigator"]:::navigation
            TabNav["Tab Navigator"]:::navigation
        end

        subgraph Components
            AutoComplete["Auto Complete Cities"]:::component
            DatePickers["Date Pickers"]:::component
            Lists["Lists"]:::component
            Cards["Ticket Cards"]:::component
        end

        subgraph Screens
            HomeScreen["Home Screen"]:::screen
            BookingScreens["Booking Screens"]:::screen
            PaymentScreens["Payment Screens"]:::screen
            HistoryScreen["History Screen"]:::screen
        end

        subgraph Assets
            CitiesData["Cities Data"]:::data
            BanksData["Banks Data"]:::data
            EWalletData["E-wallet Data"]:::data
            HistoryData["History Data"]:::data
            TrainStationData["Train Station Data"]:::data
        end

        subgraph i18n
            LangSupport["Language Support"]:::i18n
        end
    end

    %% Relationships
    MainNav --> TabNav
    TabNav --> HomeScreen
    TabNav --> HistoryScreen
    
    HomeScreen --> BookingScreens
    BookingScreens --> PaymentScreens
    
    AutoComplete --> BookingScreens
    DatePickers --> BookingScreens
    Lists --> PaymentScreens
    Cards --> HistoryScreen
    
    CitiesData --> AutoComplete
    BanksData --> Lists
    EWalletData --> Lists
    HistoryData --> HistoryScreen
    TrainStationData --> BookingScreens
    
    LangSupport --> HomeScreen
    LangSupport --> BookingScreens
    LangSupport --> PaymentScreens
    LangSupport --> HistoryScreen

    %% Click Events
    click MainNav "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/navigator/MainNavigator.tsx"
    click TabNav "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/navigator/TabNavigator.tsx"
    click AutoComplete "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/components/AutoCompleteCities.tsx"
    click DatePickers "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/components/DepartureDatePicker.tsx"
    click Lists "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/components/BankList.tsx"
    click Cards "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/components/TicketCard.tsx"
    click HomeScreen "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/screens/HomeScreen.tsx"
    click BookingScreens "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/screens/TrainBookingSearchScreen.tsx"
    click PaymentScreens "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/screens/PaymentMethodScreen.tsx"
    click HistoryScreen "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/screens/HistoryScreen.tsx"
    click CitiesData "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/assets/cities.ts"
    click BanksData "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/assets/banks.ts"
    click EWalletData "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/assets/ewallet.ts"
    click HistoryData "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/assets/history.ts"
    click TrainStationData "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/assets/trainStation.ts"
    click LangSupport "https://github.com/teddythinh/UI-Design-Course/blob/main/my-train-app/i18n/supportedLanguage.ts"

    %% Styling
    classDef navigation fill:#3498db,stroke:#2980b9,color:white
    classDef component fill:#2ecc71,stroke:#27ae60,color:white
    classDef screen fill:#e67e22,stroke:#d35400,color:white
    classDef data fill:#9b59b6,stroke:#8e44ad,color:white
    classDef i18n fill:#f1c40f,stroke:#f39c12,color:black

    %% Legend
    subgraph Legend
        N["Navigation"]:::navigation
        C["Components"]:::component
        S["Screens"]:::screen
        D["Data"]:::data
        I["i18n"]:::i18n
    end
```
