How saumya-bhatt/karya works
Main Components (High-Level Architecture)
a) Client Layer:
• Multiple client SDKs (Java, Python, JavaScript)
• REST API interface
b) Core Services:
• Server (API Gateway)
• Scheduler
• Executor
c) Data Layer:
• Repository (PostgreSQL/Aurora)
• Locks (Redis/ElastiCache)
• Queue (RabbitMQ/SQS)
Use database symbols for these components
Component Interactions
• Client → Server: Task submission and management
• Server → Scheduler: Task scheduling and management
• Scheduler → Executor: Task execution delegation
• All components ↔ Data Layer: Data persistence and state management
Detailed Component Breakdown
For each major component, create sub-sections showing internal architecture:
a) Server Component:
• API Routers (PlanRouter, UserRouter)
• Service Layer
• Domain Layer
• Data Access Layer
b) Scheduler Component:
• Fetcher Service
• Worker Service
• Task Management
• Metrics Collection
c) Executor Component:
• Task Processor
• Connector Framework
• Hook System
• Action Handlers
Data Flow Patterns
Following flows:
• Task Creation Flow
• Task Execution Flow
• Hook Processing Flow
• Chained Plan Flow
Scaling and Distribution
How components scale horizontally:
• Load balancing layers
• Queue distribution
• Data replication
Integration Points
External integration capabilities:
• Email Connector
• Slack Connector
• REST API Connector
• Kafka Connector
• Custom Connectors
Monitoring and Observability
Monitoring components:
• Metrics Collection
• Logging System
• Error Handling
Use these visual elements:
• Clear labels and annotations
Important Considerations:
Distributed nature
• Multiple instances of components
• Scalability points
• Load balancing
Security boundaries
• Internal vs. external communication
• Authentication/authorization points
Fault tolerance
• Redundancy patterns
• Failure handling mechanisms
Data consistency
• Transaction boundaries
• Data replication flows