# opengovsg/careersgovsg-jobs-data architecture

> Architecture diagram of the GitHub repository opengovsg/careersgovsg-jobs-data, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/opengovsg/careersgovsg-jobs-data
- Repository: https://github.com/opengovsg/careersgovsg-jobs-data

## Overview

This repository produces processed Singapore Government job-listing data. The workflow reads fetched OData listings, retrieves optional job details, normalizes listings, and writes JSON and CSV outputs. The README also identifies GitHub Actions as the automated fetch/update mechanism; workflow internals are not sampled, so its connection to the processor is documented rather than source-verified.

Main entry points: [`scripts/fetch-jobs.ts`](https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/scripts/fetch-jobs.ts) (Job data processor), [`.github/workflows/fetch-jobs.yml`](https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/.github/workflows/fetch-jobs.yml) (Scheduled fetch workflow), [`data/job-listings.json`](https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/data/job-listings.json) (JSON listings), [`data/job-listings.csv`](https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/data/job-listings.csv) (CSV listings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Job ingestion"]
  node_workflow["Scheduled fetch workflow<br/>[fetch-jobs.yml]"]
  node_raw["Fetched OData listings"]
end

subgraph group_transform["Listing processing"]
  node_processor["Job data processor<br/>[fetch-jobs.ts]"]
  node_normalized["Normalized job listings<br/>[fetch-jobs.ts]"]
end

subgraph group_outputs["Published data"]
  node_json["JSON listings<br/>[job-listings.json]"]
  node_csv["CSV listings<br/>[job-listings.csv]"]
end

node_careers_api{{"Careers@Gov API"}}
node_details_api{{"Job details endpoint"}}

node_workflow -.->|"fetches listings"| node_careers_api
node_careers_api -.->|"returns OData"| node_raw
node_workflow -.->|"invokes processing"| node_processor
node_raw -->|"reads input"| node_processor
node_processor -->|"fetches details"| node_details_api
node_processor -->|"normalizes listings"| node_normalized
node_processor -->|"writes JSON"| node_json
node_processor -->|"writes CSV"| node_csv

click node_workflow "https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/.github/workflows/fetch-jobs.yml"
click node_processor "https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/scripts/fetch-jobs.ts"
click node_normalized "https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/scripts/fetch-jobs.ts"
click node_json "https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/data/job-listings.json"
click node_csv "https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/data/job-listings.csv"

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_workflow,node_raw toneBlue
class node_processor,node_normalized toneAmber
class node_json,node_csv,node_careers_api toneMint
class node_details_api toneIndigo
```

## Components

### Job ingestion

- [Scheduled fetch workflow](https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/.github/workflows/fetch-jobs.yml): `.github/workflows/fetch-jobs.yml`
- **Fetched OData listings**

### Listing processing

- [Job data processor](https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/scripts/fetch-jobs.ts): `scripts/fetch-jobs.ts`
- [Normalized job listings](https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/scripts/fetch-jobs.ts): `scripts/fetch-jobs.ts`

### Published data

- [JSON listings](https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/data/job-listings.json): `data/job-listings.json`
- [CSV listings](https://github.com/opengovsg/careersgovsg-jobs-data/blob/main/data/job-listings.csv): `data/job-listings.csv`

### Other components

- **Careers@Gov API**
- **Job details endpoint**

## Connections

- Scheduled fetch workflow → Careers@Gov API: fetches listings (evidence: `README.md`)
- Careers@Gov API → Fetched OData listings: returns OData (evidence: `README.md`)
- Scheduled fetch workflow → Job data processor: invokes processing (evidence: `README.md`)
- Fetched OData listings → Job data processor: reads input (evidence: `scripts/fetch-jobs.ts`)
- Job data processor → Job details endpoint: fetches details (evidence: `scripts/fetch-jobs.ts`)
- Job data processor → Normalized job listings: normalizes listings (evidence: `scripts/fetch-jobs.ts`)
- Job data processor → JSON listings: writes JSON (evidence: `scripts/fetch-jobs.ts`)
- Job data processor → CSV listings: writes CSV (evidence: `scripts/fetch-jobs.ts`)
