Rates API
Open Source

Open Source

Understand the Rates API repository structure, runtime architecture, and contribution paths.

Rates API is an open source Cloudflare Workers project. The repository contains the public API Worker, the Fumadocs documentation app, scraper scripts, tests, and GitHub Actions automation.

Architecture at a Glance

AreaPurpose
API WorkerServes /api/v1/*, /openapi, and /openapi/json
Docs WorkerServes the Fumadocs site at ratesapi.nz
Cloudflare D1Stores latest datasets and historical snapshots
Scraper scriptsCollect rates from public institution pages
GitHub ActionsRuns checks, dry-run deploys, scraping, deploys, and uptime monitoring

Technology Stack

LayerTooling
RuntimeBun and Cloudflare Workers
API routingElysia
SchemasElysia t and TypeBox-compatible runtime validation
API docsElysia OpenAPI plugin with Scalar
Docs siteNext.js, Fumadocs UI, and Fumadocs MDX
Data storageCloudflare D1
ScrapingCheerio
Code qualityBiome, TypeScript, Fallow, and Bun tests

Repository Structure

PathContents
apps/api/src/API Worker application code
apps/api/src/routes/Elysia route groups
apps/api/src/models/Runtime schemas and exported TypeScript types
apps/api/src/lib/Shared API helpers
apps/api/bin/Scraper, D1, and uptime scripts
apps/docs/app/Next.js App Router routes for the docs site
apps/docs/content/docs/Filesystem MDX documentation
test/API and docs content tests
.github/workflows/CI, deploy, scraping, monitoring, and Fallow workflows

Contribution Paths

  • API changes: update route handlers, schemas, contract tests, and endpoint docs together.
  • Scraper changes: update scraper normalization, validation, and D1 write behavior together.
  • Docs changes: edit MDX files under apps/docs/content/docs and run the docs source generation.
  • Deployment changes: update Worker config and the dry-run deploy CI path together.

Start with Local Development, then read Deployment if you need to operate your own instance.

On this page