# calvin-ll/is-even-ai architecture

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

- Interactive diagram: https://gitdiagram.com/calvin-ll/is-even-ai
- Repository: https://github.com/calvin-ll/is-even-ai

## Overview

##### Project type and purpose
- This is an open-source, TypeScript-based npm library (“is-even-ai”) that exposes numeric comparison functions (isEven, isOdd, areEqual, etc.) backed by an AI engine (OpenAI’s GPT-3.5-turbo).
- It’s intended for developers who want to integrate AI-powered numeric checks without dealing directly with the OpenAI SDK.

##### File structure
- Top-level files and folders:
- src/
– IsEvenAiCore.ts   → core abstract class or interface defining method signatures
– IsEvenAiOpenAi.ts → concrete adapter implementing the core using OpenAI
– convenience.ts    → top-level helper functions wrapping a default OpenAI adapter
– index.ts         → module exports
- tests/             → unit tests for each module
- package.json, tsconfig.json, vite.config.mts → build and packaging configuration
- .github/workflows → CI pipelines for testing and releasing
- The presence of “Core” + “OpenAi” modules indicates an Adapter pattern: core interfaces vs platform implementations.
- CI/CD manifests show automated test and release stages.

##### README for additional insights
- Describes public API methods (isEven, isOdd, areEqual, etc.).
- Shows default usage via convenience functions and advanced usage via instantiating IsEvenAiOpenAi with custom options.
- Emphasizes extensibility (“Feel free to make a PR to add more AI platforms”).

## Diagram (Mermaid)

```mermaid
flowchart TB
    Consumer["Consumer Application"]:::consumer
    subgraph "Library (src)"
        entry["Public Entry Point (index.ts)"]:::internal
        conv["Convenience API (convenience.ts)"]:::internal
        core["IsEvenAiCore Interface"]:::internal
        adapter["IsEvenAiOpenAi Adapter"]:::internal
    end
    subgraph "Unit Tests (tests)"
        coreTest["Core Interface Tests"]:::test
        adapterTest["OpenAI Adapter Tests"]:::test
        convTest["Convenience API Tests"]:::test
    end
    OpenAI["OpenAI Service"]:::external
    subgraph "CI/CD Pipeline"
        testWorkflow["Run Tests (test.yaml)"]:::ci
        releaseWorkflow["Publish to npm (release.yaml)"]:::ci
    end
    config1["tsconfig.json"]:::config
    config2["vite.config.mts"]:::config
    pkg["package.json"]:::config

    Consumer --> entry
    entry --> conv
    conv --> core
    core --> adapter
    adapter --> OpenAI
    OpenAI --> adapter
    adapter --> core
    core --> conv
    conv --> Consumer

    coreTest --> core
    adapterTest --> adapter
    convTest --> conv

    coreTest --> testWorkflow
    adapterTest --> testWorkflow
    convTest --> testWorkflow
    testWorkflow --> releaseWorkflow

    config1 --- entry
    config2 --- entry
    pkg --- entry

    click entry "https://github.com/calvin-ll/is-even-ai/blob/main/src/index.ts"
    click conv "https://github.com/calvin-ll/is-even-ai/blob/main/src/convenience.ts"
    click core "https://github.com/calvin-ll/is-even-ai/blob/main/src/IsEvenAiCore.ts"
    click adapter "https://github.com/calvin-ll/is-even-ai/blob/main/src/IsEvenAiOpenAi.ts"
    click coreTest "https://github.com/calvin-ll/is-even-ai/blob/main/tests/IsEvenAiCore.test.ts"
    click adapterTest "https://github.com/calvin-ll/is-even-ai/blob/main/tests/IsEvenAiOpenAi.test.ts"
    click convTest "https://github.com/calvin-ll/is-even-ai/blob/main/tests/convenience.test.ts"
    click testWorkflow "https://github.com/calvin-ll/is-even-ai/blob/main/.github/workflows/test.yaml"
    click releaseWorkflow "https://github.com/calvin-ll/is-even-ai/blob/main/.github/workflows/release.yaml"
    click config1 "https://github.com/calvin-ll/is-even-ai/blob/main/tsconfig.json"
    click config2 "https://github.com/calvin-ll/is-even-ai/blob/main/vite.config.mts"
    click pkg "https://github.com/calvin-ll/is-even-ai/blob/main/package.json"

    classDef internal fill:#D0E8FF,stroke:#0366d6,color:#0366d6
    classDef external fill:#DFFFE0,stroke:#28A745,color:#28A745
    classDef ci fill:#FFF4E5,stroke:#D97706,color:#D97706
    classDef config fill:#F0F0F0,stroke:#6A737D,color:#6A737D
    classDef test fill:#F5E1FD,stroke:#8A3FFC,color:#8A3FFC
    classDef consumer fill:#E2E8F0,stroke:#1E40AF,color:#1E40AF
```
