How themhv/livetoshi works
Main Components
A. Frontend Layer:
• Next.js Application (Main UI)
• Widget Component (for stream integration)
• Profile Components
• Goal Components
• Form Components
B. API Layer:
• Create Invoice Endpoint
• NOSTR Integration Services
C. External Services:
• NOSTR Network
• TTS Service
• Lightning Network (for Zaps)
┌─────────────────────────────────────────────┐
• Client Layer │
• ┌─────────────┐ ┌─────────────┐ │
• Browser │ │ Widget │ │
• ┘ └─────────────┘ │
• ┘
• ↕
┌─────────────────────────────────────────────┐
• Next.js Layer │
• ┌─────────────┐ ┌─────────────┐ │
• Pages/App │ │ API │ │
• ┘ └─────────────┘ │
• ┌─────────────┐ ┌─────────────┐ │
• Components │ │ Utils │ │
• ┘ └─────────────┘ │
• ┘
• ↕
┌─────────────────────────────────────────────┐
• Service Layer │
• ┌─────────────┐ ┌─────────────┐ │
• NOSTR │ │ Lightning │ │
• Client │ │ Network │ │
• ┘ └─────────────┘ │
• ┘
Important Details
A. Frontend Components:
• Relationship between pages and components
• Widget system
• NostrProvider component's scope
B. API Integration:
• Create_invoice route
• NOSTR event flow
• Zap handling mechanism
C. Service Integration:
• NOSTR client connections
• Lightning Network payment flow
• TTS service integration
Data Flow Indicators
• User interactions → Frontend
• Frontend → API calls
• API → NOSTR Network
• NOSTR Network → Lightning Network
• TTS processing flow
Additional Elements
• Component types
• Data flow directions
• External service integration points
• Authentication/Authorization flows
Remember to include configuration elements like environment variables and their impact on different components of the system.