How madhusudan785/snapstream works
Main Components
A. Client-Side (Android App):
• Presentation Layer:
• Activities (MainActivity, VideoList, VideoPlayer)
• XML Layouts
• Adapters for RecyclerView
• Business Logic Layer:
• ViewModel (VideoListViewModel)
• Repository Pattern (VideoListRepository)
• Data Models (VideoData)
• Network Layer:
• Retrofit API Interface (MyApi)
• Upload Handlers (UploadRequestBody, UploadResponse)
B. Server-Side (Spring Boot):
• API Layer:
• REST Controllers (VideoController)
• Exception Handlers
• Service Layer:
• Video Service Interface and Implementation
• FFmpeg Processing Service
• Data Layer:
• Entities (Video, VideoStatus)
• Repositories (VideoRepo)
• MySQL Database
C. External Services:
• FFmpeg for video processing
• File Storage System
• Docker Container
[Client Layer]
• ↑↓
[Network/API Layer]
• ↑↓
[Server Layer]
• ↑↓
[Storage Layer]
Key Relationships to Highlight
a. Data Flow:
• Video Upload Path:
Client → API → Video Service → FFmpeg Processing → Storage
• Video Streaming Path:
Storage → Video Service → API → Client
b. Component Interactions:
• Android ViewModel ↔ Repository ↔ Retrofit API Client
• Spring Controller ↔ Service ↔ Repository ↔ Database
• FFmpeg Integration Points
Implementation Details
a. Client-Side:
• MVVM Architecture pattern
• Retrofit + Gson implementation
• Video player implementation
• Upload progress tracking
b. Server-Side:
• Spring Boot components
• Exception handling flow
• HLS video processing pipeline
• Thumbnail generation process