# yp9435/team_tails architecture

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

- Interactive diagram: https://gitdiagram.com/yp9435/team_tails
- Repository: https://github.com/yp9435/team_tails

## Overview

##### Project type and purpose
- This is a Single-Page Application (SPA) built with React, TypeScript, and Vite.
- It visualizes an employee hierarchy on an interactive chart (ReactFlowChart) and supports filtering via a sidebar.
- A mock server (Mirage) and an API client layer live under src/services, enabling real or simulated data fetches.

##### File structure
- src/components – presentational and container React components
– Layout (MainLayout, Sidebar, Navbar)
– Chart (EmployeeNode, ReactFlowChart)
– Sidebar UI (EmployeeTile, SearchFilter, TeamFilter)
- src/pages – top-level routes (Index, NotFound)
- src/hooks – custom hooks (data fetching, drag-and-drop, search)
- src/services – service layer (api.ts for real HTTP, mirage.ts for mock server)
- src/utils – pure functions (hierarchy building)
- src/types – TypeScript interfaces (employee.ts)
- Config files – vite.config.ts, tailwind.config.ts, eslint.config.js, tsconfig*.json

##### README for additional insights
- Core purpose: minimal React+TS+Vite template with HMR, ESLint recommendations
- Plugins, linting strategies, and production-grade ESLint setups are suggested

##### Elements
– UI components (blue rectangles)
– Logic/hooks (green)
– Services/external (orange)
– Utils/types (gray)
- Annotations for third-party libs (e.g., “ReactFlow.js” inside Chart Module)
- A small inset for Vite dev/build process feeding index.html to the browser

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Configuration and Assets
    subgraph "Build & Dev"
        VITE["Vite Dev Server / Build Pipeline"]:::config
    end
    subgraph "Static Assets"
        HTML["index.html"]:::asset
        PUBLIC["public/"]:::asset
        CSS1["src/index.css"]:::asset
        CSS2["src/App.css"]:::asset
        TAILWIND["tailwind.config.ts"]:::asset
    end

    %% Runtime
    BROWSER["Browser / Client"]:::external
    MAIN["src/main.tsx"]:::config

    %% App Root
    subgraph "React App Root"
        APP["App Component (src/App.tsx)"]:::ui
    end

    %% Layout
    subgraph "Layout Layer"
        ML["MainLayout"]:::ui
        SB["Sidebar"]:::ui
        NB["Navbar"]:::ui
    end

    %% Pages
    subgraph "Page Layer"
        INDEX["Index Page"]:::ui
        NOTFOUND["NotFound Page"]:::ui
    end

    %% Modules
    subgraph "Chart Module"
        CHART["ReactFlowChart"]:::ui
        NODE["EmployeeNode"]:::ui
    end
    subgraph "Sidebar Module"
        TILE["EmployeeTile"]:::ui
        SEARCH["SearchFilter"]:::ui
        TEAM["TeamFilter"]:::ui
    end

    %% Logic Hooks
    subgraph "Custom Hooks"
        HE["useEmployees"]:::logic
        US["useSearch"]:::logic
        DD["useDragDrop"]:::logic
    end

    %% Services
    subgraph "Service Layer"
        API["api.ts (Real API)"]:::service
        MIRAGE["mirage.ts (Mock Server)"]:::service
    end

    %% Utils & Types
    subgraph "Utils & Types"
        HIER["hierarchy.ts"]:::util
        EMPTYPE["employee.ts"]:::util
    end

    %% Legend
    subgraph "Legend"
        L1["UI Components"]:::ui
        L2["Logic / Hooks"]:::logic
        L3["Services"]:::service
        L4["Utils / Types"]:::util
        L5["Config / Assets"]:::asset
        L6["External"]:::external
    end

    %% Connections
    VITE -->|"serves"| HTML
    VITE -->|"serves"| PUBLIC
    VITE -->|"bundles"| CSS1
    VITE -->|"bundles"| CSS2
    VITE -->|"uses config"| TAILWIND
    VITE --> MAIN
    MAIN --> BROWSER
    BROWSER --> APP
    APP --> ML
    ML --> NB
    ML --> SB
    ML --> INDEX
    INDEX --> CHART
    INDEX --> SB
    INDEX --> SEARCH
    INDEX --> TEAM
    SB --> TILE
    NOTFOUND -.-> APP
    CHART --> NODE
    CHART --> HE
    SB --> US
    SB --> DD
    HE --> API
    HE --> MIRAGE
    API --> HIER
    MIRAGE --> HIER
    HE --> EMPTYPE
    CHART --> EMPTYPE

    %% Click Events
    click VITE "https://github.com/yp9435/team_tails/blob/main/vite.config.ts"
    click HTML "https://github.com/yp9435/team_tails/blob/main/index.html"
    click PUBLIC "https://github.com/yp9435/team_tails/tree/main/public/"
    click CSS1 "https://github.com/yp9435/team_tails/blob/main/src/index.css"
    click CSS2 "https://github.com/yp9435/team_tails/blob/main/src/App.css"
    click TAILWIND "https://github.com/yp9435/team_tails/blob/main/tailwind.config.ts"
    click MAIN "https://github.com/yp9435/team_tails/blob/main/src/main.tsx"
    click APP "https://github.com/yp9435/team_tails/blob/main/src/App.tsx"
    click ML "https://github.com/yp9435/team_tails/blob/main/src/components/Layout/MainLayout.tsx"
    click SB "https://github.com/yp9435/team_tails/blob/main/src/components/Layout/Sidebar.tsx"
    click NB "https://github.com/yp9435/team_tails/blob/main/src/components/Navbar/Navbar.tsx"
    click INDEX "https://github.com/yp9435/team_tails/blob/main/src/pages/Index.tsx"
    click NOTFOUND "https://github.com/yp9435/team_tails/blob/main/src/pages/NotFound.tsx"
    click CHART "https://github.com/yp9435/team_tails/blob/main/src/components/Chart/ReactFlowChart.tsx"
    click NODE "https://github.com/yp9435/team_tails/blob/main/src/components/Chart/EmployeeNode.tsx"
    click TILE "https://github.com/yp9435/team_tails/blob/main/src/components/Sidebar/EmployeeTile.tsx"
    click SEARCH "https://github.com/yp9435/team_tails/blob/main/src/components/Sidebar/SearchFilter.tsx"
    click TEAM "https://github.com/yp9435/team_tails/blob/main/src/components/Sidebar/TeamFilter.tsx"
    click HE "https://github.com/yp9435/team_tails/blob/main/src/hooks/useEmployees.ts"
    click US "https://github.com/yp9435/team_tails/blob/main/src/hooks/useSearch.ts"
    click DD "https://github.com/yp9435/team_tails/blob/main/src/hooks/useDragDrop.ts"
    click API "https://github.com/yp9435/team_tails/blob/main/src/services/api.ts"
    click MIRAGE "https://github.com/yp9435/team_tails/blob/main/src/services/mirage.ts"
    click HIER "https://github.com/yp9435/team_tails/blob/main/src/utils/hierarchy.ts"
    click EMPTYPE "https://github.com/yp9435/team_tails/blob/main/src/types/employee.ts"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#0366d6,color:#0366d6
    classDef logic fill:#E3FCEF,stroke:#28a745,color:#28a745
    classDef service fill:#FFF5D1,stroke:#dbab09,color:#dbab09
    classDef util fill:#F0F0F0,stroke:#6a737d,color:#6a737d
    classDef asset fill:#EDE7F6,stroke:#5c6bc0,color:#5c6bc0
    classDef config fill:#FFF0F6,stroke:#c5315f,color:#c5315f
    classDef external fill:#F0FFF4,stroke:#22863a,color:#22863a
```
