# h-e-l-e-n/taiwan_bank architecture

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

- Interactive diagram: https://gitdiagram.com/h-e-l-e-n/taiwan_bank
- Repository: https://github.com/h-e-l-e-n/taiwan_bank

## Overview

##### Project type and purpose
- This is a single‐page application (SPA) implemented in Vue 3 and built with Vite.
- Purpose: allow users to look up Taiwan bank and credit‐coop codes, addresses, and phone numbers via text input or dropdown, then view, copy the code, or share a result page link.

##### File structure
- Top level: configuration files for Git, Prettier, ESLint, Vite, VSCode, and Vercel (`.vscode`, `vercel.json`, `vite.config.js`, `eslint.config.js`, etc.).
- `index.html` at root boots the SPA.
- `src/` contains application code:
- `main.js`: app entrypoint mounts Vue.
- `App.vue`: root component.
- `router/index.js`: Vue Router setup.
- `views/` + `views/components/ResultView.vue`: page and subcomponent implementations.
- `assets/`: images (screenshots).
- `public/data/banks_detail.json`: static dataset served at runtime.
- `package.json`/`package-lock.json`: dependencies (Vue3, Bootstrap, etc.).

##### Pulling extra insights from the README
- Features: text & dropdown search, code copying, URL‐share.
- Tech stack: Vue 3, Vite, Bootstrap, RWD, ESLint.
- No backend service—data is purely static JSON.

a. Main components
- User’s Browser (client)
- Static File Server (Vite dev server or production host—Vercel)
- Vue 3 SPA (App.vue + router + components)
- Static Data Store (banks_detail.json in `public/data/`)
- External libraries (Bootstrap CSS, ESLint config—in dev stage)
b. Relationships & interactions
- Browser requests `index.html` + JavaScript/CSS bundles from the Static File Server.
- SPA initializes via `main.js` → mounts `App.vue` → sets up Vue Router.
- On search or dropdown selection, the SPA fetches `banks_detail.json` over HTTP GET from the same server.
- Filter logic runs in the client, renders `ResultView.vue`.
- Copy‐to‐clipboard and URL‐sharing are direct client‐side operations.
c. Architectural patterns / design principles
- SPA pattern with client‐side routing (Vue Router)
- Asset & data separation: public static files vs. compiled application code
- No centralized backend—“JAMstack”‐style architecture (JavaScript, APIs, Markup)
d. Key technologies & frameworks
- Vue 3 + Composition API
- Vite (dev server + build tool)
- Bootstrap (responsive styling)
- JSON data store in `public`

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Environment
    subgraph "Developer Environment"
        direction TB
        VITE_CONFIG["vite.config.js"]:::config
        ESLINT_CONFIG["eslint.config.js"]:::config
        PRETTIER_CONFIG[".prettierrc.json"]:::config
        BUILD_CMD{{"npm run dev/build"}}:::process
    end

    %% Deployment Target
    BUILD_CMD -->|"build & deploy"| VERCEL["Vercel / Static File Server"]:::server

    %% Static File Server serves assets
    VERCEL -->|"serves index.html, JS, CSS, JSON"| BROWSER["User's Browser"]:::client

    %% Browser & SPA
    subgraph "Browser (Client)" 
        direction TB
        subgraph "Vue SPA" 
            direction TB
            ENTRY["src/main.js"]:::app
            ROOT["src/App.vue"]:::app
            ROUTER["src/router/index.js"]:::app
            VIEW_HOME["src/views/index.vue"]:::app
            VIEW_RESULT["src/views/components/ResultView.vue"]:::app
            ASSETS["src/assets/"]:::static
            LIBS["Bootstrap CSS & External Libraries"]:::external
            ENTRY -->|mounts| ROOT
            ROOT -->|uses| ROUTER
            ROUTER -->|renders| VIEW_HOME
            ROUTER -->|renders| VIEW_RESULT
            VIEW_HOME -->|triggers search| VIEW_RESULT
            VIEW_RESULT -->|uses| ASSETS
            ROOT -->|styles| LIBS
        end
    end

    %% Data Store
    VERCEL -->|hosts| DATASTORE["/public/data/banks_detail.json"]:::static

    %% Runtime Data Fetch
    VIEW_RESULT -->|HTTP GET banks_detail.json| DATASTORE

    %% Click Events
    click ENTRY "https://github.com/h-e-l-e-n/taiwan_bank/blob/main/src/main.js"
    click ROOT "https://github.com/h-e-l-e-n/taiwan_bank/blob/main/src/App.vue"
    click ROUTER "https://github.com/h-e-l-e-n/taiwan_bank/blob/main/src/router/index.js"
    click VIEW_HOME "https://github.com/h-e-l-e-n/taiwan_bank/blob/main/src/views/index.vue"
    click VIEW_RESULT "https://github.com/h-e-l-e-n/taiwan_bank/blob/main/src/views/components/ResultView.vue"
    click DATASTORE "https://github.com/h-e-l-e-n/taiwan_bank/blob/main/public/data/banks_detail.json"
    click VITE_CONFIG "https://github.com/h-e-l-e-n/taiwan_bank/blob/main/vite.config.js"
    click ESLINT_CONFIG "https://github.com/h-e-l-e-n/taiwan_bank/blob/main/eslint.config.js"
    click PRETTIER_CONFIG "https://github.com/h-e-l-e-n/taiwan_bank/blob/main/.prettierrc.json"
    click VERCEL "https://github.com/h-e-l-e-n/taiwan_bank/blob/main/vercel.json"
    click ASSETS "https://github.com/h-e-l-e-n/taiwan_bank/tree/main/src/assets/"

    %% Styles
    classDef static fill:#b0f2b6,stroke:#2d7f4f,color:#0b3d1f
    classDef app fill:#d0e7ff,stroke:#2a4f8b,color:#102a44
    classDef external fill:#ffd8a8,stroke:#b37700,color:#4f2a00
    classDef config fill:#ffddb3,stroke:#b38c00,color:#4f2a00
    classDef process fill:#eeeeee,stroke:#aaaaaa,color:#333333
    classDef server fill:#d0f0c0,stroke:#4f8f2d,color:#0b290f
    classDef client fill:#f0f0f0,stroke:#888888,color:#333333
```
