# ferminrp/google-sheets-argento architecture

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

- Interactive diagram: https://gitdiagram.com/ferminrp/google-sheets-argento
- Repository: https://github.com/ferminrp/google-sheets-argento

## Overview

##### Project type and purpose
- This is an open-source Google Apps Script library (“Google Sheets Argento”) that exposes a set of custom spreadsheet functions for fetching and processing Argentine (and some international) financial data.
- Users install the generated `all-in-one.js` file in their Google Sheet; this file contains all domain-specific functions (dólar, bonos, inflación, cripto, etc.).

##### File structure
- Top level
- all-in-one.js – bundled output combining all functions
- build.js / package.json / jest.config.js – Node.js build/test scripts
- data/ – sample JSON data used by tests or utilities
- doc/ – Markdown documentation per function
- src/ – individual source modules, one per data domain (dolar.js, acciones.js, criptoya.js, …)
- tests/ – unit tests for the combined file
- README.md – project description, usage, list of functions, external API credits

##### README for additional insights
- Lists each function and its data source API
- Explains build (`npm run build`) and test (`npm run test`) workflows
- Credits external services (ArgentinaDatos, CriptoYa, BCRA, etc.)

##### Detail
- Domain module as a separate element
- One-to-many relationship between the bundled file and the individual `src/*.js` sources
- Build and test as parallel but distinct processes
- That there is no persistent database—each call fetches live data

- the modular structure of the project
- its serverless execution inside Google Sheets
- its reliance on external financial data APIs
- the local build and test lifecycle of the open-source library.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Google Environment"
        GSUI["Google Sheets UI"]:::google
        GSRuntime["Apps Script Runtime"]:::google
    end

    GSUI -->|"invoke custom function"| GSRuntime

    subgraph "Apps Script Deployment"
        Bundle["Function Dispatcher / Bundled Code\n(all-in-one.js)"]:::code
    end

    GSRuntime -->|loads| Bundle

    subgraph "Domain Modules"    
        Dolar["dolar.js"]:::code
        DolarHist["dolar_historico.js"]:::code
        Acciones["acciones.js"]:::code
        Bonos["bonos.js"]:::code
        Caucion["caucion.js"]:::code
        Cedear["cedear.js"]:::code
        CriptoYa["criptoya.js"]:::code
        Crypto["crypto.js"]:::code
        FCI["fci.js"]:::code
        Inflacion["inflacion.js"]:::code
        Letras["letras.js"]:::code
        Obligaciones["obligaciones.js"]:::code
        Opciones["opciones.js"]:::code
        PlazoFijo["plazofijo.js"]:::code
        Rendimientos["rendimientos.js"]:::code
        RiesgoPais["riesgopais.js"]:::code
        USAStocks["usa_stocks.js"]:::code
        UVA["uva.js"]:::code
    end

    Bundle -->|dispatches to| Dolar
    Bundle --> DolarHist
    Bundle --> Acciones
    Bundle --> Bonos
    Bundle --> Caucion
    Bundle --> Cedear
    Bundle --> CriptoYa
    Bundle --> Crypto
    Bundle --> FCI
    Bundle --> Inflacion
    Bundle --> Letras
    Bundle --> Obligaciones
    Bundle --> Opciones
    Bundle --> PlazoFijo
    Bundle --> Rendimientos
    Bundle --> RiesgoPais
    Bundle --> USAStocks
    Bundle --> UVA

    subgraph "External APIs"
        BCRA["BCRA API"]:::api
        ArgentinaDatos["ArgentinaDatos API"]:::api
        CriptoYaAPI["CriptoYa API"]:::api
        JohnGalt["JohnGalt_is_www API"]:::api
    end

    Dolar -->|HTTP Request| ArgentinaDatos
    DolarHist --> ArgentinaDatos
    Acciones --> ArgentinaDatos
    Bonos --> ArgentinaDatos
    Caucion --> ArgentinaDatos
    Cedear --> BCRA
    CriptoYa --> CriptoYaAPI
    Crypto --> CriptoYaAPI
    FCI --> BCRA
    Inflacion --> BCRA
    Letras --> BCRA
    Obligaciones --> ArgentinaDatos
    Opciones --> ArgentinaDatos
    PlazoFijo --> BCRA
    Rendimientos --> BCRA
    RiesgoPais --> BCRA
    USAStocks --> ArgentinaDatos
    UVA --> BCRA

    subgraph "Local Dev Environment"
        subgraph Build
            BuildScript["build.js"]:::dev
            PackageJSON["package.json\npackage-lock.json"]:::dev
            BuildScript -->|bundles src/*.js| Bundle
        end
        subgraph Test
            JestConfig["jest.config.js"]:::dev
            Tests["tests/all-in-one.test.js\ntests/test-wrapper.js"]:::dev
            DataSample["data/cedears.json"]:::dev
            JestConfig --> Tests
            Tests --> DataSample
        end
    end

    classDef google fill:#D0E6FF,stroke:#2B6CB0,color:#2B6CB0;
    classDef code fill:#E6FFEB,stroke:#2F855A,color:#2F855A;
    classDef api fill:#FFF5E6,stroke:#DD6B20,color:#DD6B20;
    classDef dev fill:#F0F0F0,stroke:#718096,color:#4A5568;

    click Bundle "https://github.com/ferminrp/google-sheets-argento/blob/main/all-in-one.js"
    click BuildScript "https://github.com/ferminrp/google-sheets-argento/blob/main/build.js"
    click PackageJSON "https://github.com/ferminrp/google-sheets-argento/blob/main/package.json"
    click JestConfig "https://github.com/ferminrp/google-sheets-argento/blob/main/jest.config.js"
    click Tests "https://github.com/ferminrp/google-sheets-argento/blob/main/tests/all-in-one.test.js"
    click Tests "https://github.com/ferminrp/google-sheets-argento/blob/main/tests/test-wrapper.js"
    click DataSample "https://github.com/ferminrp/google-sheets-argento/blob/main/data/cedears.json"
    click Dolar "https://github.com/ferminrp/google-sheets-argento/blob/main/src/dolar.js"
    click DolarHist "https://github.com/ferminrp/google-sheets-argento/blob/main/src/dolar_historico.js"
    click Acciones "https://github.com/ferminrp/google-sheets-argento/blob/main/src/acciones.js"
    click Bonos "https://github.com/ferminrp/google-sheets-argento/blob/main/src/bonos.js"
    click Caucion "https://github.com/ferminrp/google-sheets-argento/blob/main/src/caucion.js"
    click Cedear "https://github.com/ferminrp/google-sheets-argento/blob/main/src/cedear.js"
    click CriptoYa "https://github.com/ferminrp/google-sheets-argento/blob/main/src/criptoya.js"
    click Crypto "https://github.com/ferminrp/google-sheets-argento/blob/main/src/crypto.js"
    click FCI "https://github.com/ferminrp/google-sheets-argento/blob/main/src/fci.js"
    click Inflacion "https://github.com/ferminrp/google-sheets-argento/blob/main/src/inflacion.js"
    click Letras "https://github.com/ferminrp/google-sheets-argento/blob/main/src/letras.js"
    click Obligaciones "https://github.com/ferminrp/google-sheets-argento/blob/main/src/obligaciones.js"
    click Opciones "https://github.com/ferminrp/google-sheets-argento/blob/main/src/opciones.js"
    click PlazoFijo "https://github.com/ferminrp/google-sheets-argento/blob/main/src/plazofijo.js"
    click Rendimientos "https://github.com/ferminrp/google-sheets-argento/blob/main/src/rendimientos.js"
    click RiesgoPais "https://github.com/ferminrp/google-sheets-argento/blob/main/src/riesgopais.js"
    click USAStocks "https://github.com/ferminrp/google-sheets-argento/blob/main/src/usa_stocks.js"
    click UVA "https://github.com/ferminrp/google-sheets-argento/blob/main/src/uva.js"
```
