# ja2024-gaboja/gaboja-client architecture

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

- Interactive diagram: https://gitdiagram.com/ja2024-gaboja/gaboja-client
- Repository: https://github.com/ja2024-gaboja/gaboja-client

## Overview

##### Project type and purpose
- This is a front-end single-page application built with React, TypeScript, and Vite.
- Its purpose is to let users view a map, create walking routes, display weather banners, and obtain address info via external APIs.

##### File structure
- Top level: package.json, vite.config.ts, index.html, public/ for static assets.
- src/ divides concerns:
- src/pages – page-level components (Home, CreateRoute, Make)
- src/components – reusable UI pieces (MapView, Tooltip, WeatherBanner, layout, nav)
- src/apis – HTTP client instance and API endpoint definitions
- src/hooks – custom React hooks for geolocation, routing layers, timers, address lookup
- src/store – application state management (e.g., global store or context providers)
- src/utils – pure functions (coordinate conversion, date/time helpers, path string builders)
- Build & config: Vite (vite.config.ts), ESLint (eslint.config.js), TypeScript config (tsconfig.*.json)

##### Key insights from README
- Confirms React + TS + Vite setup with HMR and ESLint.
- No backend or server code—external APIs are consumed directly from the client.

## Diagram (Mermaid)

```mermaid
flowchart TB
  %% Entry & Route
  subgraph "Entry & Routing"
    direction TB
    Main["src/main.tsx"]:::entry
    App["src/App.tsx"]:::entry
    Router["src/router.tsx"]:::entry
  end

  %% Build & Config
  subgraph "Build & Configuration"
    direction TB
    Vite["vite.config.ts"]:::build
    ESLint["eslint.config.js"]:::build
    TSConfig["tsconfig.json"]:::build
    Package["package.json"]:::build
    Readme["README.md"]:::build
    GitIgnore[".gitignore"]:::build
  end

  %% Assets
  subgraph "Static Assets & HTML"
    direction TB
    HTML["index.html"]:::asset
    Public["public/"]:::asset
    Fonts["src/assets/fonts/"]:::asset
    Icons["src/assets/icons/*.tsx"]:::asset
    CSS["src/index.css"]:::asset
  end

  %% UI Layer
  subgraph "UI Layer" 
    direction TB
    PagesBarrel["src/pages/index.tsx"]:::ui
    subgraph "Pages"
      direction TB
      Home["src/pages/Home/index.tsx"]:::ui
      CreateRoute["src/pages/CreateRoute/index.tsx"]:::ui
      StartCreate["src/pages/CreateRoute/StartCreateRoute/index.tsx"]:::ui
      MakePage["src/pages/Make/index.tsx"]:::ui
    end
    ComponentsBarrel["src/components/index.ts"]:::ui
    subgraph "Components"
      direction TB
      MapView["src/components/MapView.tsx"]:::ui
      Tooltip["src/components/Tooltip.tsx"]:::ui
      WeatherBanner["src/components/WeatherBanner.tsx"]:::ui
      LayoutComp["src/components/layout/index.tsx"]:::ui
      NavComp["src/components/nav/index.tsx"]:::ui
    end
  end

  %% Logic Layer
  subgraph "Logic Layer"
    direction TB
    HooksBarrel["src/hooks/index.ts"]:::logic
    subgraph "Custom Hooks"
      direction TB
      Hook1["src/hooks/useCoordinatesLayer.ts"]:::logic
      Hook2["src/hooks/useCurrentAddress.ts"]:::logic
      Hook3["src/hooks/useCurrentCoordinate.ts"]:::logic
      Hook4["src/hooks/useCurrentPositionLayer.ts"]:::logic
      Hook5["src/hooks/useGetAddress.ts"]:::logic
      Hook6["src/hooks/useTimer.ts"]:::logic
      Hook7["src/hooks/useWalkingPathLayer.ts"]:::logic
      Hook8["src/hooks/useWalkingPathPoints.ts"]:::logic
    end
    Store["src/store/index.ts"]:::logic
    subgraph "Constants & Types"
      direction TB
      Constants["src/constants/index.ts"]:::logic
      RouterConst["src/constants/router.ts"]:::logic
      Theme["src/constants/styled.ts"]:::logic
      Types["src/types/index.ts"]:::logic
    end
    subgraph "Utilities"
      direction TB
      UtilBarrel["src/utils/index.ts"]:::logic
      Util1["src/utils/convertCoordinatetoAddress.ts"]:::logic
      Util2["src/utils/getCurrentCoordinate.ts"]:::logic
      Util3["src/utils/getCurrentTime.ts"]:::logic
      Util4["src/utils/getPathString.ts"]:::logic
      Util5["src/utils/getTodayString.ts"]:::logic
    end
  end

  %% Data Layer
  subgraph "Data & API Layer"
    direction TB
    APIInstance["src/apis/instance.ts"]:::apiModule
    APIIndex["src/apis/index.ts"]:::apiModule
  end

  %% External Services
  subgraph "External Services"
    direction TB
    MapService[(Map Tile Service)]:::external
    GeoService[(Geocoding API)]:::external
    WeatherService[(Weather Data API)]:::external
  end

  %% Data Flow
  User((User)):::external
  User -->|interacts with| Main
  Main --> App
  App --> Router
  Router --> PagesBarrel
  PagesBarrel --> Home
  PagesBarrel --> CreateRoute
  CreateRoute --> StartCreate
  PagesBarrel --> MakePage
  PagesBarrel --> ComponentsBarrel
  ComponentsBarrel --> MapView
  ComponentsBarrel --> Tooltip
  ComponentsBarrel --> WeatherBanner
  ComponentsBarrel --> LayoutComp
  ComponentsBarrel --> NavComp

  MapView -->|uses hook| Hook1
  MapView -->|uses hook| Hook4
  Home -->|renders| MapView
  Home -->|renders| WeatherBanner
  WeatherBanner -->|uses hook| Hook5
  Hook1 --> Store
  Hook2 --> Store
  Hook3 --> Store
  Hook4 --> Store
  Hook5 --> Store
  Hook6 --> Store
  Hook7 --> Store
  Hook8 --> Store

  Hook1 --> APIIndex
  Hook2 --> APIIndex
  Hook3 --> APIIndex
  Hook4 --> APIIndex
  Hook5 --> APIIndex
  Hook7 --> APIIndex
  Hook8 --> APIIndex

  APIIndex --> APIInstance
  APIInstance -->|GET /tiles| MapService
  APIInstance -->|GET /reverse-geocode| GeoService
  APIInstance -->|GET /weather| WeatherService
  MapService --> APIInstance
  GeoService --> APIInstance
  WeatherService --> APIInstance

  %% Click Events
  click Main "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/main.tsx"
  click App "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/App.tsx"
  click Router "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/router.tsx"
  click Vite "https://github.com/ja2024-gaboja/gaboja-client/blob/main/vite.config.ts"
  click ESLint "https://github.com/ja2024-gaboja/gaboja-client/blob/main/eslint.config.js"
  click HTML "https://github.com/ja2024-gaboja/gaboja-client/blob/main/index.html"
  click Public "https://github.com/ja2024-gaboja/gaboja-client/tree/main/public/"
  click Home "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/pages/Home/index.tsx"
  click CreateRoute "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/pages/CreateRoute/index.tsx"
  click StartCreate "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/pages/CreateRoute/StartCreateRoute/index.tsx"
  click MakePage "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/pages/Make/index.tsx"
  click PagesBarrel "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/pages/index.tsx"
  click MapView "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/components/MapView.tsx"
  click Tooltip "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/components/Tooltip.tsx"
  click WeatherBanner "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/components/WeatherBanner.tsx"
  click LayoutComp "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/components/layout/index.tsx"
  click NavComp "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/components/nav/index.tsx"
  click ComponentsBarrel "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/components/index.ts"
  click APIInstance "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/apis/instance.ts"
  click APIIndex "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/apis/index.ts"
  click Hook1 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/hooks/useCoordinatesLayer.ts"
  click Hook2 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/hooks/useCurrentAddress.ts"
  click Hook3 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/hooks/useCurrentCoordinate.ts"
  click Hook4 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/hooks/useCurrentPositionLayer.ts"
  click Hook5 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/hooks/useGetAddress.ts"
  click Hook6 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/hooks/useTimer.ts"
  click Hook7 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/hooks/useWalkingPathLayer.ts"
  click Hook8 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/hooks/useWalkingPathPoints.ts"
  click HooksBarrel "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/hooks/index.ts"
  click Store "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/store/index.ts"
  click Constants "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/constants/index.ts"
  click RouterConst "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/constants/router.ts"
  click Theme "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/constants/styled.ts"
  click Types "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/types/index.ts"
  click Util1 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/utils/convertCoordinatetoAddress.ts"
  click Util2 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/utils/getCurrentCoordinate.ts"
  click Util3 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/utils/getCurrentTime.ts"
  click Util4 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/utils/getPathString.ts"
  click Util5 "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/utils/getTodayString.ts"
  click UtilBarrel "https://github.com/ja2024-gaboja/gaboja-client/blob/main/src/utils/index.ts"

  %% Styles
  classDef ui fill:#ADD8E6,stroke:#000,color:#000
  classDef logic fill:#90EE90,stroke:#000,color:#000
  classDef apiModule fill:#FFA500,stroke:#000,color:#000
  classDef external fill:#D3D3D3,stroke:#000,color:#000
  classDef build fill:#FFFF00,stroke:#000,color:#000
  classDef asset fill:#FFFACD,stroke:#000,color:#000
  classDef entry fill:#E6E6FA,stroke:#000,color:#000
```
