graph LR
Worker_Entry_Point["Worker Entry Point"]
API_Endpoints_Routing["API Endpoints & Routing"]
Storage_Abstraction_Layer["Storage Abstraction Layer"]
Cache_Business_Logic["Cache Business Logic"]
Scheduled_Cache_Cleanup["Scheduled Cache Cleanup"]
Configuration_Management["Configuration Management"]
Utilities_Helpers["Utilities & Helpers"]
Worker_Entry_Point -- "initializes" --> API_Endpoints_Routing
Worker_Entry_Point -- "triggers" --> Scheduled_Cache_Cleanup
API_Endpoints_Routing -- "utilizes" --> Cache_Business_Logic
API_Endpoints_Routing -- "interacts with" --> Storage_Abstraction_Layer
Cache_Business_Logic -- "accesses" --> Storage_Abstraction_Layer
Scheduled_Cache_Cleanup -- "accesses" --> Storage_Abstraction_Layer
Cache_Business_Logic -- "uses" --> Configuration_Management
Scheduled_Cache_Cleanup -- "retrieves configuration from" --> Configuration_Management
Configuration_Management -- "provides settings to" --> Worker_Entry_Point
Configuration_Management -- "provides settings to" --> Cache_Business_Logic
API_Endpoints_Routing -- "uses" --> Utilities_Helpers
Cache_Business_Logic -- "uses" --> Utilities_Helpers
click Storage_Abstraction_Layer href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/turborepo-remote-cache-cloudflare/Storage_Abstraction_Layer.md" "Details"
click Cache_Business_Logic href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/turborepo-remote-cache-cloudflare/Cache_Business_Logic.md" "Details"
click Scheduled_Cache_Cleanup href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/turborepo-remote-cache-cloudflare/Scheduled_Cache_Cleanup.md" "Details"
Abstract Components Overview
The primary entry point for the Cloudflare Worker. It initializes the application, registers routes, and sets up handlers for incoming HTTP requests and scheduled events (like cron triggers).
Related Classes/Methods:
src/index.ts(1:1)
Manages the routing of incoming HTTP requests to appropriate handlers and implements the API logic for cache interactions (e.g., GET, PUT, POST for artifacts). It also handles request parsing and response formatting.
Related Classes/Methods:
src/routes/(1:1)src/api/(1:1)
Storage Abstraction Layer [Expand]
Provides a unified interface for interacting with Cloudflare R2 (object storage) and Cloudflare KV (key-value store). It abstracts the underlying storage mechanisms, allowing for flexible data persistence.
Related Classes/Methods:
src/storage/r2.ts(1:1)src/storage/kv.ts(1:1)src/storage/index.ts(1:1)
Cache Business Logic [Expand]
Encapsulates the core logic for managing cache artifacts, including validation, signature verification, applying cache expiration policies, and handling cache hits/misses.
Related Classes/Methods:
src/logic/cacheManager.ts(1:1)src/logic/artifactValidator.ts(1:1)
Scheduled Cache Cleanup [Expand]
A dedicated component triggered by cron events, responsible for periodically identifying and deleting expired or stale cache artifacts from the storage layer.
Related Classes/Methods:
src/scheduledTasks/cleanup.ts(1:1)src/cron/cleanup.ts(1:1)
Centralizes the management of application settings, environment variables (e.g., TURBO_TOKEN), and worker configurations (wrangler.jsonc). It provides a consistent way to access configuration values across the application.
Related Classes/Methods:
wrangler.jsonc(1:1).env files(1:1)src/config/index.ts(1:1)
A collection of reusable functions and modules for common tasks that are not specific to any single business domain, such as request parsing, response formatting, error handling, and logging.
Related Classes/Methods:
src/utils/(1:1)src/helpers/(1:1)