# marcelscruz/public-apis architecture

> Architecture diagram of the GitHub repository marcelscruz/public-apis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/marcelscruz/public-apis
- Repository: https://github.com/marcelscruz/public-apis

## Overview

#### Purpose and Entry Points
This is a curated public-API catalog, published primarily as a human-readable Markdown directory and machine-consumable JSON database. The catalog content is organized by category, with each API carrying name, description, authentication, CORS, and URL metadata.

- `README.md` — primary published catalog and contributor-facing content surface.
- `API.md` — API-oriented consumer documentation.
- `db/resources.json` — structured API-resource dataset.
- `db/categories.json` — structured category dataset.

#### Source-of-Truth Boundary
The repository is data-first rather than an application service: catalog entries are maintained in Markdown, then converted into normalized JSON artifacts. The substantial README category tables are the editorial input/presentation format; `db/` is the derived data boundary for consumers.

- `README.md`
- `db/resources.json`
- `db/categories.json`

#### Database Update Pipeline
The Node.js update entry point parses catalog tables, separates category content, groups row fields, and emits refreshed JSON datasets. `scripts/db/update-db.js` is the orchestration boundary; utility modules isolate parsing, grouping, formatting, and file output stages.

- `scripts/db/update-db.js`
- `utils/db/separate-tables.js`
- `utils/db/group-row-content.js`

#### Normalization and Output Stages
Processing is decomposed into resource-specific and category-specific formatting before final JSON serialization and writes. This separation lets schema/presentation cleanup evolve independently from the update orchestrator.

- `utils/db/format-resources.js`
- `utils/db/format-categories.js`
- `utils/db/format-json.js`
- `utils/db/write-to-file.js`

#### Automation and Runtime
The project runs on Node.js/npm, as indicated by its package manifests and JavaScript scripts. GitHub Actions automates database refreshes, likely executing the update pipeline and committing or publishing resulting `db/` changes; no application server, hosted database, or runtime API implementation is represented in the tree.

- `package.json`
- `package-lock.json`
- `.github/workflows/update-db.yml`

#### External-Service Model
The repository does not integrate with one operational backend. Its data describes many third-party public APIs, whose links and access characteristics are catalog metadata rather than dependencies called by this codebase. GitHub is the material infrastructure provider for collaboration and scheduled automation.

- `README.md`
- `.github/ISSUE_TEMPLATE.md`
- `.github/PULL_REQUEST_TEMPLATE.md`

Main entry points: [`scripts/db/update-db.js`](https://github.com/marcelscruz/public-apis/blob/main/scripts/db/update-db.js) (Database updater), [`utils/db/write-to-file.js`](https://github.com/marcelscruz/public-apis/blob/main/utils/db/write-to-file.js) (Dataset writer), [`README.md`](https://github.com/marcelscruz/public-apis/blob/main/README.md) (Published API catalog), [`utils/db/format-json.js`](https://github.com/marcelscruz/public-apis/blob/main/utils/db/format-json.js) (JSON serializer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Catalog Content"]
  node_readme["Published API catalog<br/>Markdown catalog<br/>[README.md]"]
  node_api_docs["Consumer API docs<br/>Markdown documentation<br/>[API.md]"]
end

subgraph group_pipeline["JSON Update Pipeline"]
  node_update_db{{"Database updater<br/>Node.js orchestrator<br/>[update-db.js]"}}
  node_separate_tables["Table separator<br/>parser utility<br/>[separate-tables.js]"]
  node_group_rows["Row grouper<br/>parser utility"]
  node_format_resources["Resource formatter<br/>normalization utility"]
  node_format_categories["Category formatter<br/>normalization utility"]
  node_format_json["JSON serializer<br/>formatting utility<br/>[format-json.js]"]
  node_write_file["Dataset writer<br/>file output utility<br/>[write-to-file.js]"]
  node_node_runtime["Node.js/npm runtime<br/>package manifest<br/>[package.json]"]
end

subgraph group_outputs["Derived Data"]
  node_resources_json[("API resources<br/>JSON dataset<br/>[resources.json]")]
  node_categories_json[("Categories<br/>JSON dataset<br/>[categories.json]")]
end

subgraph group_github["GitHub Automation"]
  node_update_workflow["Database refresh workflow<br/>GitHub Actions workflow<br/>[update-db.yml]"]
  node_contribution_templates["Contribution templates<br/>GitHub templates<br/>[ISSUE_TEMPLATE.md]"]
end

node_readme -->|"documents catalog access"| node_api_docs
node_readme -->|"editorial source"| node_update_db
node_node_runtime -->|"runs"| node_update_db
node_update_workflow -->|"executes"| node_update_db
node_separate_tables -->|"separates categories"| node_update_db
node_group_rows -->|"groups table fields"| node_update_db
node_update_db -->|"normalizes resources"| node_format_resources
node_update_db -->|"normalizes categories"| node_format_categories
node_format_resources -->|"resource payload"| node_format_json
node_format_categories -->|"category payload"| node_format_json
node_format_json -->|"serialized JSON"| node_write_file
node_write_file -->|"writes"| node_resources_json
node_write_file -->|"writes"| node_categories_json
node_contribution_templates -.->|"supports contributions"| node_readme

click node_readme "https://github.com/marcelscruz/public-apis/blob/main/README.md"
click node_api_docs "https://github.com/marcelscruz/public-apis/blob/main/API.md"
click node_update_db "https://github.com/marcelscruz/public-apis/blob/main/scripts/db/update-db.js"
click node_separate_tables "https://github.com/marcelscruz/public-apis/blob/main/utils/db/separate-tables.js"
click node_group_rows "https://github.com/marcelscruz/public-apis/blob/main/utils/db/group-row-content.js"
click node_format_resources "https://github.com/marcelscruz/public-apis/blob/main/utils/db/format-resources.js"
click node_format_categories "https://github.com/marcelscruz/public-apis/blob/main/utils/db/format-categories.js"
click node_format_json "https://github.com/marcelscruz/public-apis/blob/main/utils/db/format-json.js"
click node_write_file "https://github.com/marcelscruz/public-apis/blob/main/utils/db/write-to-file.js"
click node_resources_json "https://github.com/marcelscruz/public-apis/blob/main/db/resources.json"
click node_categories_json "https://github.com/marcelscruz/public-apis/blob/main/db/categories.json"
click node_node_runtime "https://github.com/marcelscruz/public-apis/blob/main/package.json"
click node_update_workflow "https://github.com/marcelscruz/public-apis/blob/main/.github/workflows/update-db.yml"
click node_contribution_templates "https://github.com/marcelscruz/public-apis/blob/main/.github/ISSUE_TEMPLATE.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_readme,node_api_docs toneBlue
class node_update_db,node_separate_tables,node_group_rows,node_format_resources,node_format_categories,node_format_json,node_write_file,node_node_runtime toneAmber
class node_resources_json,node_categories_json toneMint
class node_update_workflow,node_contribution_templates toneRose
```

## Components

### Catalog Content

Editorial source and published consumer surfaces.

- [Published API catalog](https://github.com/marcelscruz/public-apis/blob/main/README.md): Markdown catalog · Primary editorial input and human-readable directory. · `README.md`
- [Consumer API docs](https://github.com/marcelscruz/public-apis/blob/main/API.md): Markdown documentation · `API.md`

### JSON Update Pipeline

Node.js conversion stages.

- [Database updater](https://github.com/marcelscruz/public-apis/blob/main/scripts/db/update-db.js): Node.js orchestrator · Parses catalog tables and emits normalized datasets. · `scripts/db/update-db.js`
- [Table separator](https://github.com/marcelscruz/public-apis/blob/main/utils/db/separate-tables.js): parser utility · `utils/db/separate-tables.js`
- [Row grouper](https://github.com/marcelscruz/public-apis/blob/main/utils/db/group-row-content.js): parser utility · `utils/db/group-row-content.js`
- [Resource formatter](https://github.com/marcelscruz/public-apis/blob/main/utils/db/format-resources.js): normalization utility · `utils/db/format-resources.js`
- [Category formatter](https://github.com/marcelscruz/public-apis/blob/main/utils/db/format-categories.js): normalization utility · `utils/db/format-categories.js`
- [JSON serializer](https://github.com/marcelscruz/public-apis/blob/main/utils/db/format-json.js): formatting utility · `utils/db/format-json.js`
- [Dataset writer](https://github.com/marcelscruz/public-apis/blob/main/utils/db/write-to-file.js): file output utility · `utils/db/write-to-file.js`
- [Node.js/npm runtime](https://github.com/marcelscruz/public-apis/blob/main/package.json): package manifest · `package.json`

### Derived Data

Machine-consumable catalog artifacts.

- [API resources](https://github.com/marcelscruz/public-apis/blob/main/db/resources.json): JSON dataset · Normalized API metadata for machine consumers. · `db/resources.json`
- [Categories](https://github.com/marcelscruz/public-apis/blob/main/db/categories.json): JSON dataset · Normalized catalog category metadata. · `db/categories.json`

### GitHub Automation

Collaboration and scheduled refresh infrastructure.

- [Database refresh workflow](https://github.com/marcelscruz/public-apis/blob/main/.github/workflows/update-db.yml): GitHub Actions workflow · Automates execution of the JSON update pipeline. · `.github/workflows/update-db.yml`
- [Contribution templates](https://github.com/marcelscruz/public-apis/blob/main/.github/ISSUE_TEMPLATE.md): GitHub templates · Guides catalog collaboration through issues and pull requests. · `.github/ISSUE_TEMPLATE.md`

## Connections

- Published API catalog → Consumer API docs: documents catalog access
- Published API catalog → Database updater: editorial source
- Node.js/npm runtime → Database updater: runs
- Database refresh workflow → Database updater: executes
- Table separator → Database updater: separates categories
- Row grouper → Database updater: groups table fields
- Database updater → Resource formatter: normalizes resources
- Database updater → Category formatter: normalizes categories
- Resource formatter → JSON serializer: resource payload
- Category formatter → JSON serializer: category payload
- JSON serializer → Dataset writer: serialized JSON
- Dataset writer → API resources: writes
- Dataset writer → Categories: writes
- Contribution templates → Published API catalog: supports contributions
