How maxswa/osrs-json-hiscores works
Main Components
a. External Systems:
• OSRS Official Hiscores API (CSV endpoint)
• OSRS Leaderboards Web Interface
b. Core Library Components:
• API Interface Layer
• Data Transformation Layer
• Type System
• Utility Services
Component Relationships
[External Systems]
┌─────────────────────┐ ┌────────────────────┐
• OSRS Hiscores API │ │ OSRS Leaderboards │
• (CSV Format) │ │ (Web Interface) │
• ┘ └────────────────────┘
• ↑ ↑
[OSRS JSON Hiscores Library]
┌─────────────────────────────────────────────┐
• API Interface Layer │
• ┌─────────────────┐ ┌─────────────────┐ │
• Stats Fetcher │ │ Leaderboard │ │
• (hiscores.ts) │ │ Scraper │ │
• ┘ └─────────────────┘ │
• ↓ ↓ │
• ┌─────────────────────────────────────────┐ │
• Data Transformation Layer │ │
• (CSV to JSON, Data Enrichment) │ │
• ┘ │
• ↓ ↓ │
• ┌─────────────────────────────────────────┐ │
• Type System Layer │ │
• (types.ts) │ │
• ┘ │
• ↓ ↓ │
• ┌─────────────────────────────────────────┐ │
• Utility Services │ │
• (constants.ts, helpers.ts) │ │
• ┘ │
• ┘
• ↓
┌─────────────────────────────────────────────┐
• Client Applications │
• (Server-side Node.js Applications) │
• ┘
Important Details to Note
Annotations explaining:
• CORS limitations (why it must be used server-side)
• Data flow direction (from OSRS API → Library → Client)
• Supported game modes (main, ironman, hardcore, etc.)
• Type safety through TypeScript implementation
Clear separation between external services and internal processing
Keep the abstraction level focused on the architectural components while maintaining enough detail to show the data enrichment process and type safety mechanisms.