How twirapp/twir works
High-Level Architecture Components
a. Frontend Layer:
• Dashboard application (Vue.js)
• Public page application
• Overlays application
• Landing page (Nuxt.js)
b. Backend Services:
• API Gateway (GraphQL)
• Multiple microservices:
• Bots service
• Events service
• Parser service
• WebSockets service
• Timers service
• EventSub service
• Integrations service
• Tokens service
• YTSR (YouTube Search) service
c. Infrastructure:
• PostgreSQL database
• Redis cache
• MinIO object storage
• NATS message broker
• Temporal workflow engine
┌─────────────────────────────────────────────────────────────┐
• Client Layer │
• ┤
• API Layer │
• ┤
• Service Layer │
• ┤
• Data Layer │
• ┘
Key Relationships to Highlight
a. Client-API Communication:
• GraphQL API gateway for dashboard
• REST endpoints for public access
• WebSocket connections for real-time features
b. Service Communication:
• NATS message broker for inter-service communication
• Temporal for workflow orchestration
• Event-driven architecture patterns
c. Data Flow:
• Database access patterns
• Caching strategy
• File storage interactions
Specific Implementation Details
• Rectangles for services
• Hexagons for message brokers
• Clouds for external services (Twitch, Discord, etc.)
• Blue: Frontend applications
• Green: Backend services
• Yellow: Infrastructure components
• Red: External services
Critical Flows
a. Authentication Flow:
• Twitch OAuth integration
• Token management
• Session handling
b. Real-time Features:
• WebSocket connections
• Event subscription handling
• Chat bot interactions
c. Data Processing:
• Command parsing
• Event handling
• Timer management
Deployment Context
How the system can be deployed:
• Docker container boundaries
• Network segmentation
• Load balancer placement
• Service discovery mechanisms
Remember to include:
• Service names and versions
• Communication protocols
• Data store types
• External service dependencies
• Security boundaries
• Scaling points
• Monitoring interfaces
This will provide a clear understanding of the system's architecture while maintaining enough detail for technical discussions and implementation guidance.