# razorpay/i18nify architecture

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

- Interactive diagram: https://gitdiagram.com/razorpay/i18nify
- Repository: https://github.com/razorpay/i18nify

## Overview

##### Project type and purpose
- This is a monorepo hosting an open-source internationalization library (“i18nify”).
- It contains:
- A data package (`i18nify-data`) with country, currency, phone, subdivision JSON.
- Language-specific client libraries: Go (`packages/i18nify-go`), JavaScript (`packages/i18nify-js`), and React (`packages/i18nify-react`).
- A demo/static playground (`packages/i18nify-playground`).
- CI/CD orchestration (GitHub Actions, Husky hooks, Dangerfile, linting).
- Purpose: centralize and publish consistent i18n data and APIs for different runtimes.

##### File structure
- Top-level:
- `.github/workflows/…`, `dangerfile.js`, `scripts/…` → CI/CD and release automation.
- `i18nify-data/` → canonical datasets (JSON + schemas + contribution guidelines).
- `packages/` → language-specific SDKs and playground.
- Each SDK:
- `i18nify-go/` → Go modules, code generation reading JSON data.
- `i18nify-js/` → Node library, scripts to generate subsets, rollup bundling, Jest tests.
- `i18nify-react/` → React provider components consuming `i18nify-js`.
- `i18nify-playground/` → React/Vite app showcasing package usage.

##### README for additional insights
- Core features: countries, currencies, phones, subdivisions.
- Encourages end users to grab the data or install via language-specific package.
- Directs contributors to `i18nify-data` guidelines.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        CI["CI/CD Orchestration"]:::ci
        Workflows["GitHub Actions Workflows"]:::ci
        Husky["Husky Git Hooks"]:::ci
        Danger["Dangerfile Checks"]:::ci
        Validate["Data Validation Script"]:::ci
        Publish["NPM Publish Automation"]:::ci
        Npmrc["Generate .npmrc for GH Registry"]:::ci
    end

    %% Data Layer
    Data["i18nify-data (JSON & Schemas)"]:::data

    %% Language Adapters
    subgraph "Language SDKs"
        GoSDK["Go SDK"]:::adapter
        JSSDK["JS SDK"]:::adapter
        ReactSDK["React SDK (React Wrapper)"]:::adapter
    end

    %% Demo App
    Playground["Playground Demo App"]:::demo

    %% External Registries
    NPM["npm Registry"]:::ext
    GoProxy["Go Module Proxy"]:::ext

    %% Relationships
    CI --> Workflows
    CI --> Husky
    CI --> Danger
    CI --> Validate
    CI --> Publish
    CI --> Npmrc

    CI --> Data
    CI --> GoSDK
    CI --> JSSDK
    CI --> ReactSDK
    CI --> Playground

    Data --> GoSDK
    Data --> JSSDK

    JSSDK --> ReactSDK
    JSSDK --> Playground
    ReactSDK --> Playground

    GoSDK --> GoProxy
    JSSDK --> NPM

    %% Click Events
    click Data "https://github.com/razorpay/i18nify/tree/master/i18nify-data/"
    click GoSDK "https://github.com/razorpay/i18nify/tree/master/packages/i18nify-go/"
    click JSSDK "https://github.com/razorpay/i18nify/tree/master/packages/i18nify-js/"
    click ReactSDK "https://github.com/razorpay/i18nify/tree/master/packages/i18nify-react/"
    click Playground "https://github.com/razorpay/i18nify/tree/master/packages/i18nify-playground/"
    click Workflows "https://github.com/razorpay/i18nify/tree/master/.github/workflows/"
    click Husky "https://github.com/razorpay/i18nify/tree/master/.husky/"
    click Danger "https://github.com/razorpay/i18nify/blob/master/dangerfile.js"
    click Validate "https://github.com/razorpay/i18nify/blob/master/scripts/dataValidate.ts"
    click Publish "https://github.com/razorpay/i18nify/blob/master/scripts/publishToNpm.js"
    click Npmrc "https://github.com/razorpay/i18nify/blob/master/scripts/generateGitHubRegistryNpmrc.js"

    %% Styles
    classDef data fill:#cce5ff,stroke:#004085,color:#004085;
    classDef adapter fill:#d4edda,stroke:#155724,color:#155724;
    classDef demo fill:#fff3cd,stroke:#856404,color:#856404;
    classDef ci fill:#f8d7da,stroke:#721c24,color:#721c24;
    classDef ext fill:#e2e3e5,stroke:#6c757d,color:#6c757d;
```
