StreamSphere is a modern, microservices-based video streaming architecture designed for high scalability and event-driven processing.
- API Gateway (Port 8080): Central entry point using Spring Cloud Gateway. Handles JWT validation and routes requests to downstream services.
- Auth Service (Port 8081): Manages user authentication, JWT issuance, and secure login/registration flows.
- User Service (Port 8082): Handles user profile management and persistence in PostgreSQL.
- Video Service (Port 8083): Core service for video metadata management, upload orchestration (MinIO), and event publishing (Kafka).
- Eureka Server (Port 8761): Service discovery and registry for all microservices.
- PostgreSQL: Primary relational database for user and video metadata.
- Redis: Used for session management and caching (via Auth Service).
- Apache Kafka: Event bus for asynchronous video processing (Transcoding, Notification).
- MinIO: S3-compatible object storage for raw and processed video files.
- Zookeeper: Coordination service for the Kafka cluster.
- Client Request: User uploads video via React UI (
/upload). - Gateway Validation: API Gateway verifies JWT and extracts
X-User-Role. - Authorization: Video Service ensures only
ADMINroles can hit the/uploadendpoint. - Storage: Video Service streams the file directly to MinIO (bucket:
raw-videos). - Persistence: Video metadata is saved to PostgreSQL with status
UPLOADED. - Event Trigger: A
VideoUploadedEventis published to the Kafka topicvideo-events. - Downstream: Processing services (to be implemented) consume from Kafka to transcode the video into multiple resolutions.
- Stateless JWT-based authentication.
- Gateway automatically propagates user context via
X-User-NameandX-User-Roleheaders to downstream services. - Tokens are stored in Redux state and LocalStorage on the frontend.
- Framework: React + TypeScript + Vite.
- State Management: Redux Toolkit & RTK Query for efficient API communication.
- Styling: Tailwind CSS.
- Routing: React Router with Role-based Protected Routes.
- Docker & Docker Compose
- Java 17+ (for local development)
- Node.js 20+
# Start all infrastructure and services
docker compose up -d- Web UI: http://localhost:5173
- API Gateway: http://localhost:8080
- MinIO Console: http://localhost:9001
- Eureka Dashboard: http://localhost:8761