How brucellino/cdevents works
Main Components
a) Client Layer:
• Web Browsers/API Clients
• Swagger UI Interface (running on port 8787 in development)
b) Cloudflare Infrastructure:
• Cloudflare Workers Runtime
• Edge Network Distribution
c) Application Components:
• Main Router (from src/index.ts)
• Endpoint Handlers Layer
• Event Handling System
• OpenAPI Schema Generator
Key Architectural Elements
a) Entry Point:
• Main router (src/index.ts) as the central orchestrator
• It to Hono framework for routing
• It to Chanfana for OpenAPI integration
b) Endpoint Structure (src/endpoints/):
• Endpoints into logical sections:
• Task Management (taskCreate, taskDelete, taskFetch, taskList)
• Event Handling (handleEvent)
• CDEvents (under dev/cdevents)
c) Event System:
• Event types hierarchy (src/event-types/)
• It to the core context and pipeline run components
Specific relationships
Client Request → Cloudflare Edge → Workers Runtime → Main Router → Endpoint Handlers
↓
OpenAPI Validation (Chanfana) ←→ Schema Generation
↓
Event Processing → Event Types → Core Context
Important Details to Highlight
• OpenAPI/Swagger integration at the top level
• Serverless nature of the architecture
• Automatic OpenAPI schema generation
• Separation between endpoint handlers and event types
Technical Stack Indicators
A tech stack section showing:
• TypeScript as the primary language
• Hono for routing
• Chanfana for OpenAPI support
• Cloudflare Workers as the runtime environment
Development Flow
A small section showing the development workflow:
Local Development (wrangler dev) → Deployment (wrangler deploy) → Cloudflare Workers