# midday-ai/languine architecture

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

- Interactive diagram: https://gitdiagram.com/midday-ai/languine
- Repository: https://github.com/midday-ai/languine

## Overview

##### Main Components

a) Core Components:
- CLI Package (Central Component)
- Action Package (GitHub Actions Integration)
- React Email Package (Email Template Support)
- Web Application (Documentation/Interface)

b) Integration Components:
- Multiple Framework Support Systems
- Translation Processing Pipeline
- File System Handlers
- Configuration Management

**┌─ User Interface Layer ─────────────────┐**
- Web Interface (apps/web)            │
- CLI Interface (packages/cli)        │
- Processing Layer ────────────────────┤
- Parsers                            │
- Translators                        │
- Configuration Management           │
- Integration Layer ──────────────────┤
- Framework Adapters                 │
- File System Handlers               │
- GitHub Action Integration          │
- ┘

##### Key Relationships to Highlight

a) Input/Output Flow:
- How source files flow through parsers
- Translation processing pipeline
- Demonstrate output generation paths

b) Framework Integration:
- Connections to supported frameworks (Next.js, Expo, i18next, etc.)
- Configuration flow for each framework

##### Specific Implementation Details

a) Parser System:
- JavaScript/TypeScript parser
- JSON parser
- Markdown parser
- Various platform-specific parsers (Android, iOS)

b) Translator System:
- Different translator implementations
- File format support (JSON, YAML, PO, etc.)
- Translation workflow

c) Configuration Management:
- Config file handling
- Environment management
- Framework-specific settings

##### Additional Elements

Specialized sections for:
- Testing infrastructure
- Example implementations
- Documentation system
- GitHub Action workflow

##### Data Flow Indicators

- Command flow from CLI to processors
- File transformation paths
- Configuration application routes
- Integration points with external systems

##### Implementation Notes

- Nested components
- Clear relationship indicators
- Proper layering

Recommended tools:
- PlantUML

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI["User Interface Layer"]
        WEB["Web Interface"]:::ui
        CLI["CLI Interface"]:::ui
    end

    subgraph Processing["Processing Layer"]
        direction TB
        PARSER["Parser System"]:::processing
        TRANS["Translator System"]:::processing
        CONFIG["Configuration Management"]:::processing
    end

    subgraph Integration["Integration Layer"]
        direction TB
        FRAME["Framework Adapters"]:::integration
        FSH["File System Handlers"]:::integration
        GHA["GitHub Action Integration"]:::integration
        EMAIL["React Email Package"]:::integration
    end

    subgraph Frameworks["Framework Support"]
        direction TB
        NEXT["Next.js"]:::framework
        EXPO["Expo"]:::framework
        I18N["i18next"]:::framework
        AND["Android"]:::framework
        IOS["iOS"]:::framework
    end

    subgraph Testing["Testing Infrastructure"]
        direction TB
        TESTS["Test Suite"]:::testing
        RESOURCES["Test Resources"]:::testing
        SNAPSHOTS["Test Snapshots"]:::testing
    end

    WEB --> PARSER
    CLI --> PARSER
    PARSER --> TRANS
    TRANS --> FSH
    CONFIG --> PARSER
    CONFIG --> TRANS
    FSH --> FRAME
    FRAME --> NEXT
    FRAME --> EXPO
    FRAME --> I18N
    FRAME --> AND
    FRAME --> IOS
    GHA --> FSH
    EMAIL --> FSH
    TESTS --> RESOURCES
    TESTS --> SNAPSHOTS

    classDef ui fill:#9370DB
    classDef processing fill:#32CD32
    classDef integration fill:#FFA500
    classDef framework fill:#A9A9A9
    classDef testing fill:#4682B4

    click WEB "https://github.com/midday-ai/languine/blob/main/apps/web/src/app/page.tsx"
    click CLI "https://github.com/midday-ai/languine/tree/main/packages/cli"
    click PARSER "https://github.com/midday-ai/languine/tree/main/packages/cli/src/parsers"
    click TRANS "https://github.com/midday-ai/languine/tree/main/packages/cli/src/translators"
    click CONFIG "https://github.com/midday-ai/languine/blob/main/packages/cli/src/config.ts"
    click GHA "https://github.com/midday-ai/languine/blob/main/packages/action/src/main.ts"
    click EMAIL "https://github.com/midday-ai/languine/blob/main/packages/react-email/src/index.tsx"
    click NEXT "https://github.com/midday-ai/languine/tree/main/examples/next-intl"
    click EXPO "https://github.com/midday-ai/languine/tree/main/examples/expo"
    click I18N "https://github.com/midday-ai/languine/tree/main/examples/i18next"
    click AND "https://github.com/midday-ai/languine/tree/main/examples/android"
    click IOS "https://github.com/midday-ai/languine/tree/main/examples/xcode-strings"
    click TESTS "https://github.com/midday-ai/languine/tree/main/packages/cli/test"
    click RESOURCES "https://github.com/midday-ai/languine/tree/main/packages/cli/test/resources"
    click SNAPSHOTS "https://github.com/midday-ai/languine/tree/main/packages/cli/test/snapshots"
```
