# chihkang/markdown-navigator architecture

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

- Interactive diagram: https://gitdiagram.com/chihkang/markdown-navigator
- Repository: https://github.com/chihkang/markdown-navigator

## Overview

##### Main Components and Layers
- User Interface (UI) Layer:
- Components folder (src/components) houses UI building blocks such as ActionComponents, CreateFileForm, FileListItem, MarkdownEmptyView, PaginationSection, and TagSearchList.
- The main entry point “markdown-navigator.tsx” is likely the central UI component that organizes these sub-components.

- Utility Layer:
- The src/utils folder contains helper functions for creating Markdown, file operations, date formatting, grouping logic, and tag operations.
- These provide the business logic and data transformation needed for the UI.

- Types and Interfaces:
- The src/types folder defines types (like markdownTypes) crucial for maintaining type safety across the extension.

- Assets and Metadata:
- Metadata might contain supporting information about the Markdown files or configuration that isn’t directly part of the UI/logic layers.

##### Relationships and Interactions
- The Main UI component (“markdown-navigator.tsx”) is the container that integrates various UI components and coordinates their interaction.
- UI components such as FileListItem and TagSearchList interact with utility modules (e.g., fileOperations and tagOperations) to retrieve, filter, and manage the collection of Markdown files.
- User actions (e.g., file creation, deletion, opening in editor) trigger function calls in the utility layer which then update the UI accordingly.
- Data flow is bidirectional: the UI sends user events to the utilities, and the utilities return data updates (filtered lists, tag extractions, pagination changes).

##### Architectural Patterns & Design Principles
- Clear Separation of Concerns:
- UI components focus solely on presentation and user interactions, while the utilities handle business logic and data manipulation.
- Component-Based Architecture:
- Utilizing small, reusable React components makes the system highly modular.
- DevOps and Code Quality:
- Presence of configuration files (.eslintrc.json, .prettierrc, tsconfig.json) suggests adherence to coding standards and TypeScript best practices.

##### Relevant Technologies, Frameworks, and Libraries
- Raycast API (since it’s an extension for Raycast).
- React and TypeScript (evident from .tsx files and type definitions).
- Utility libraries for file and date handling.
- Build tools and code formatters (package.json, package-lock.json).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Top Level
    user("User (Raycast)"):::external
    main("Markdown Navigator"):::ui

    user --> main

    %% UI Layer Subgraph
    subgraph "UI Layer"
        ac("ActionComponents"):::uicomponent
        cff("CreateFileForm"):::uicomponent
        fli("FileListItem"):::uicomponent
        mev("MarkdownEmptyView"):::uicomponent
        ps("PaginationSection"):::uicomponent
        tsl("TagSearchList"):::uicomponent
    end

    main --> ac
    main --> cff
    main --> fli
    main --> mev
    main --> ps
    main --> tsl

    %% Utility Layer Subgraph
    subgraph "Utility Layer"
        cm("Markdown Creation"):::util
        du("Date Formatting"):::util
        fo("File Operations"):::util
        df("Data Formatters"):::util
        go("Grouping Logic"):::util
        to("Tag Operations"):::util
        tc("Tag Color Utilities"):::util
    end

    %% Additional Modules
    types("Types & Interfaces"):::types
    assets("Assets & Metadata"):::asset

    main -->|"usesTypes"| types
    main -->|"usesAssets"| assets

    %% Interactions Between UI and Utility Layers
    cff -->|"triggers"| cm
    cff -->|"updates"| fo
    fli -->|"fetches"| fo
    tsl -->|"filters"| to
    tsl -->|"applies"| tc

    %% Click Events
    click main "https://github.com/chihkang/markdown-navigator/blob/main/src/markdown-navigator.tsx"
    click ac "https://github.com/chihkang/markdown-navigator/blob/main/src/components/ActionComponents.tsx"
    click cff "https://github.com/chihkang/markdown-navigator/blob/main/src/components/CreateFileForm.tsx"
    click fli "https://github.com/chihkang/markdown-navigator/blob/main/src/components/FileListItem.tsx"
    click mev "https://github.com/chihkang/markdown-navigator/blob/main/src/components/MarkdownEmptyView.tsx"
    click ps "https://github.com/chihkang/markdown-navigator/blob/main/src/components/PaginationSection.tsx"
    click tsl "https://github.com/chihkang/markdown-navigator/blob/main/src/components/TagSearchList.tsx"
    click cm "https://github.com/chihkang/markdown-navigator/blob/main/src/utils/createMarkdown.ts"
    click du "https://github.com/chihkang/markdown-navigator/blob/main/src/utils/dateUtils.ts"
    click fo "https://github.com/chihkang/markdown-navigator/blob/main/src/utils/fileOperations.ts"
    click df "https://github.com/chihkang/markdown-navigator/blob/main/src/utils/formatters.ts"
    click go "https://github.com/chihkang/markdown-navigator/blob/main/src/utils/groupOperations.ts"
    click to "https://github.com/chihkang/markdown-navigator/blob/main/src/utils/tagOperations.ts"
    click tc "https://github.com/chihkang/markdown-navigator/blob/main/src/utils/tagColorUtils.ts"
    click types "https://github.com/chihkang/markdown-navigator/blob/main/src/types/markdownTypes.ts"
    click assets "https://github.com/chihkang/markdown-navigator/tree/main/assets"

    %% Styles
    classDef external fill:#f9d,stroke:#e66200,stroke-width:2px;
    classDef ui fill:#bbf,stroke:#4a90e2,stroke-width:2px;
    classDef uicomponent fill:#aee,stroke:#387,stroke-width:2px;
    classDef util fill:#cfc,stroke:#2d6,stroke-width:2px;
    classDef types fill:#ffd,stroke:#aa0,stroke-width:2px;
    classDef asset fill:#efe,stroke:#393,stroke-width:2px;
```
