# sayoko123f/familymap architecture

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

- Interactive diagram: https://gitdiagram.com/sayoko123f/familymap
- Repository: https://github.com/sayoko123f/familymap

## Overview

##### Project type and purpose
- This is a single‐page application (SPA) built in Vue 3 + TypeScript + Vite.
- Its goal is to display “friendly food” discount listings from the FamilyMart API, allow users to browse by category, favorite shops, and respond to different devices (RWD).

##### File structure
- Top level:
- Configuration files (.gitignore, package.json, tsconfig.json, vite.config.ts, tailwind.config.js, postcss.config.js, prettier.config.js)
- Static/demo assets (demo/, public/)
- Source code (src/)
- src/ contains:
- main.ts (app bootstrap)
- router.ts (vue-router setup)
- store/ (Pinia modules + API wrappers)
- components/ (UI components split under friendly/, etc.)
- App.vue (root component)
- Build & deploy: Vite bundles, Tailwind + PostCSS, deployed to Cloudflare Pages.

##### README for additional insights
- Confirms tech stack: Vue 3, TypeScript, Vite, vue‐router, Pinia, TailwindCSS, axios
- Mentions future map‐based geolocation feature
- Hosted via Cloudflare Pages

- Use clear labels for each node: e.g., “Cloudflare Pages (CDN)”, “Vue Router”, “Pinia Store”, “FamilyMart API”
- Browser → CDN → Browser (static JS bundle)
- Components → Store → API → Store → Components
- Blue for UI/runtime components
- Orange for external services (APIs, Geolocation, Map)
- Green for build & hosting
- Rectangles for internal modules
- Clouds for CDN / hosting

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Tooling
    subgraph "Build & Tooling"
        direction TB
        VITE["Vite Configuration"]:::build
        TSC["TypeScript Compiler"]:::build
        POSTCSS["PostCSS Configuration"]:::build
        TAILWINDCFG["Tailwind Config"]:::build
    end

    %% Static Assets & Hosting
    subgraph "Static Assets & Hosting"
        direction TB
        INDEX["index.html"]:::build
        PUBLIC["public/ Static Assets"]:::build
        CLOUDFLARE("Cloudflare Pages (CDN)"):::external
    end

    %% Runtime Application
    subgraph "Runtime Application"
        direction TB

        ENTRY["SPA Bootstrap (main.ts)"]:::runtime
        ROUTER["Vue Router (router.ts)"]:::runtime
        STORE["Pinia Store (use-store.ts)"]:::runtime

        subgraph "Store Modules"
            direction TB
            AFREAL["Friendly Food API (real)"]:::runtime
            AFFAKE["Friendly Food API (mock)"]:::runtime
            CITY["City Module"]:::runtime
            IDATA["Shared Data Types"]:::runtime
        end

        subgraph "Component Tree"
            direction TB
            APP["Root Component (App.vue)"]:::ui
            HOME["Friendly Home View"]:::ui
            HEADER["Friendly Header"]:::ui
            TOOLBAR["Friendly Toolbar"]:::ui
            AREASEL["Friendly Area Selector"]:::ui
            AREADIS["Friendly Area Display"]:::ui
            COMGRP["Commodity Group Display"]:::ui
            SHOPPREV["Shop Preview Item"]:::ui
            SHOPPANEL["Shop Panel List"]:::ui
            MULTISHOP["Multiple Shop View"]:::ui
            FAVBTN["Favorite Button"]:::ui
            FAVPANEL["Favorite Panel"]:::ui
            OVERLAY["Global Overlay"]:::ui
        end
    end

    %% External Services
    subgraph "External Services"
        direction TB
        FAMILYMART["FamilyMart API"]:::external
        GEOLOC["Browser Geolocation / Mapbox"]:::external
    end

    %% Data & Asset Layer
    subgraph "Assets & Styling"
        direction TB
        ICO["Icon Definitions"]:::runtime
        GLOBALCSS["Global CSS (index.css)"]:::build
    end

    %% Connections
    %% User and CDN
    BROWSER(("User's Browser")):::external -->|requests bundle| CLOUDFLARE
    CLOUDFLARE -->|serves| INDEX
    INDEX --> ENTRY

    %% Bootstrap to App
    ENTRY --> ROUTER
    ENTRY --> STORE
    ROUTER --> APP

    %% Store flow
    APP --> HOME
    HOME --> STOREACTION{"Dispatch Action"}:::runtime
    STOREACTION --> STORE
    STORE --> AFREAL
    STORE --> AFFAKE
    STORE --> CITY
    STORE --> IDATA
    AFREAL -->|HTTP| FAMILYMART
    AFFAKE --> FAMILYMART
    FAMILYMART --> AFREAL
    AFREAL --> STORE
    STORE --> HOME
    HOME --> APP

    %% Components & assets
    APP --> HEADER
    APP --> TOOLBAR
    TOOLBAR --> AREASEL
    TOOLBAR --> AREADIS
    AREADIS --> COMGRP
    COMGRP --> SHOPPREV
    SHOPPREV --> SHOPPANEL
    SHOPPANEL --> MULTISHOP
    SHOPPANEL --> FAVBTN
    FAVBTN --> FAVPANEL
    APP --> OVERLAY
    APP --> ICO
    APP --> GLOBALCSS

    %% Future map
    HOME --> GEOLOC
    GEOLOC -->|map data| FAMILYMART

    %% CI/CD
    VITE --> ENTRY
    TSC --> ENTRY
    POSTCSS --> GLOBALCSS
    TAILWINDCFG --> GLOBALCSS

    %% Hosting
    INDEX --> CLOUDFLARE
    PUBLIC --> CLOUDFLARE

    %% Click Events
    click ENTRY "https://github.com/sayoko123f/familymap/blob/master/src/main.ts"
    click APP "https://github.com/sayoko123f/familymap/blob/master/src/App.vue"
    click ROUTER "https://github.com/sayoko123f/familymap/blob/master/src/router.ts"
    click STORE "https://github.com/sayoko123f/familymap/blob/master/src/store/use-store.ts"
    click AFREAL "https://github.com/sayoko123f/familymap/blob/master/src/store/api-friend.ts"
    click AFFAKE "https://github.com/sayoko123f/familymap/blob/master/src/store/api-friend-fake.ts"
    click CITY "https://github.com/sayoko123f/familymap/blob/master/src/store/city.ts"
    click IDATA "https://github.com/sayoko123f/familymap/blob/master/src/store/i-data.ts"
    click HOME "https://github.com/sayoko123f/familymap/blob/master/src/components/friendly/friendly-home.vue"
    click HEADER "https://github.com/sayoko123f/familymap/blob/master/src/components/friendly/friendly-header.vue"
    click TOOLBAR "https://github.com/sayoko123f/familymap/blob/master/src/components/friendly/friendly-toolbar.vue"
    click AREASEL "https://github.com/sayoko123f/familymap/blob/master/src/components/friendly/friendly-area-select.vue"
    click AREADIS "https://github.com/sayoko123f/familymap/blob/master/src/components/friendly/friendly-area.vue"
    click COMGRP "https://github.com/sayoko123f/familymap/blob/master/src/components/friendly/commodity-group.vue"
    click SHOPPREV "https://github.com/sayoko123f/familymap/blob/master/src/components/friendly/shop-preview.vue"
    click SHOPPANEL "https://github.com/sayoko123f/familymap/blob/master/src/components/friendly/shop-pannel.vue"
    click MULTISHOP "https://github.com/sayoko123f/familymap/blob/master/src/components/friendly/multiple-shop.vue"
    click FAVBTN "https://github.com/sayoko123f/familymap/blob/master/src/components/friendly/favorite-button.vue"
    click FAVPANEL "https://github.com/sayoko123f/familymap/blob/master/src/components/friendly/favorite-pannel.vue"
    click ICO "https://github.com/sayoko123f/familymap/blob/master/src/assets/group-icon.ts"
    click GLOBALCSS "https://github.com/sayoko123f/familymap/blob/master/src/index.css"
    click TAILWINDCFG "https://github.com/sayoko123f/familymap/blob/master/tailwind.config.js"
    click VITE "https://github.com/sayoko123f/familymap/blob/master/vite.config.ts"
    click TSC "https://github.com/sayoko123f/familymap/blob/master/tsconfig.json"
    click POSTCSS "https://github.com/sayoko123f/familymap/blob/master/postcss.config.js"
    click INDEX "https://github.com/sayoko123f/familymap/blob/master/index.html"
    click PUBLIC "https://github.com/sayoko123f/familymap/tree/master/public/"

    %% Styles
    classDef ui fill:#d0e7ff,stroke:#3b82f6,color:#1e3a8a
    classDef runtime fill:#bfdbfe,stroke:#2563eb,color:#1e40af
    classDef build fill:#d1fae5,stroke:#10b981,color:#065f46
    classDef external fill:#fed7aa,stroke:#f97316,color:#9a3412
```
