# helixmorphe/yeezy-dates architecture

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

- Interactive diagram: https://gitdiagram.com/helixmorphe/yeezy-dates
- Repository: https://github.com/helixmorphe/yeezy-dates

## Overview

##### Project type and purpose
- This is an open-source Node.js/TypeScript library called “yeezy-dates.”
- Purpose: Expose a single API (`parseDate(input: string) → Array<{label, date}>`) that parses human-friendly date strings and returns an array of labeled Date suggestions.

##### File structure
- Top-level:
- package.json, tsconfig.json, build/test configs, CI workflows
- src/ — the library’s implementation
- Under src/:
- constants.ts — core constants (e.g. time units, locale formats)
- index.ts — entry point exporting `parseDate`
- repositories/ — loading and managing template definitions
- templates/ — concrete template classes (e.g. relative-day, time patterns) and a factory to instantiate them
- services/ — modular pipeline steps:
– date-parsing-service: turn raw template+input into base Date(s)
– suggestion-generation-service: combine templates + parsed data into candidate suggestions
– suggestion-filter-service: prune/filter/sort suggestions
– template-suggestion-service: coordinate the overall pipeline per template
- tests (spec/test files) — ensure each module’s correctness

##### README for additional insights
- Confirms the single function API, expected output format
- Use cases: scheduling UIs, chatbots, natural-language interfaces
- No external services or databases; fully in-process

##### Detail & essential elements
- Every module/service as its own component
- Template repository/factory path separately from the service pipeline
- Conditional logic (e.g., SuggestionFilterService’s criteria)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Client
    Client["Host Application"]:::external

    %% API Layer
    subgraph "API Layer"
        API["parseDate(input: string)"]:::api
    end

    %% Core Engine
    subgraph "Core Engine"
        Constants["Constants"]:::core
        Types["Types Definitions"]:::core
        Repo[(Template Repository)]:::core
        Factory["Template Factory"]:::core
        BaseTemplate["BaseTemplate Interface"]:::template

        subgraph "Templates"
            RelativeDay["RelativeDayTemplate"]:::template
            RelativeDayTime["RelativeDayWithTimeTemplate"]:::template
            RelativeTime["RelativeTimeTemplate"]:::template
            RelativeWeekday["RelativeWeekdayTemplate"]:::template
            SimplePattern["SimplePatternTemplate"]:::template
        end

        subgraph "Service Pipeline"
            DateParsing["DateParsingService"]:::service
            SuggestionGen["SuggestionGenerationService"]:::service
            SuggestionFilter["SuggestionFilterService"]:::service
            TemplateSuggest["TemplateSuggestionService"]:::service
        end
    end

    %% Output
    Output["Array of {label, date}"]:::output

    %% Data Flows
    Client -->|"calls"| API
    API -->|"loads templates"| Repo
    Repo --> Factory
    Factory --> BaseTemplate
    Factory --> RelativeDay
    Factory --> RelativeDayTime
    Factory --> RelativeTime
    Factory --> RelativeWeekday
    Factory --> SimplePattern

    RelativeDay --> TemplateSuggest
    RelativeDayTime --> TemplateSuggest
    RelativeTime --> TemplateSuggest
    RelativeWeekday --> TemplateSuggest
    SimplePattern --> TemplateSuggest

    TemplateSuggest --> DateParsing
    DateParsing --> SuggestionGen
    SuggestionGen --> SuggestionFilter
    SuggestionFilter --> TemplateSuggest

    TemplateSuggest -->|"collect"| Output
    Output --> Client

    %% Click Events
    click API "https://github.com/helixmorphe/yeezy-dates/blob/main/src/index.ts"
    click Constants "https://github.com/helixmorphe/yeezy-dates/blob/main/src/constants.ts"
    click Types "https://github.com/helixmorphe/yeezy-dates/blob/main/src/types.ts"
    click Repo "https://github.com/helixmorphe/yeezy-dates/blob/main/src/repositories/template-repository.ts"
    click Factory "https://github.com/helixmorphe/yeezy-dates/blob/main/src/templates/template-factory.ts"
    click BaseTemplate "https://github.com/helixmorphe/yeezy-dates/blob/main/src/templates/base-template.ts"
    click RelativeDay "https://github.com/helixmorphe/yeezy-dates/blob/main/src/templates/relative-day-template.ts"
    click RelativeDayTime "https://github.com/helixmorphe/yeezy-dates/blob/main/src/templates/relative-day-with-time-template.ts"
    click RelativeTime "https://github.com/helixmorphe/yeezy-dates/blob/main/src/templates/relative-time-template.ts"
    click RelativeWeekday "https://github.com/helixmorphe/yeezy-dates/blob/main/src/templates/relative-weekday-template.ts"
    click SimplePattern "https://github.com/helixmorphe/yeezy-dates/blob/main/src/templates/simple-pattern.ts"
    click DateParsing "https://github.com/helixmorphe/yeezy-dates/blob/main/src/services/date-parsing-service.ts"
    click SuggestionGen "https://github.com/helixmorphe/yeezy-dates/blob/main/src/services/suggestion-generation-service.ts"
    click SuggestionFilter "https://github.com/helixmorphe/yeezy-dates/blob/main/src/services/suggestion-filter-service.ts"
    click TemplateSuggest "https://github.com/helixmorphe/yeezy-dates/blob/main/src/services/template-suggestion-service.ts"

    %% Styles
    classDef api fill:#cfe2f3,stroke:#333,stroke-width:1px;
    classDef core fill:#d9ead3,stroke:#333,stroke-width:1px;
    classDef template fill:#fce5cd,stroke:#333,stroke-width:1px;
    classDef service fill:#fff2cc,stroke:#333,stroke-width:1px;
    classDef external fill:#d9d2e9,stroke:#333,stroke-width:1px;
    classDef output fill:#e2efda,stroke:#333,stroke-width:1px;
```
