VidStream is a simplified video-sharing platform built with a modular and scalable microservices architecture. Inspired by popular social media apps, it handles video uploads, processing, and streaming, designed for efficient service deployment and enhanced scalability.
The platform is designed to:
- Enable video sharing and engagement with users.
- Identify trending hashtags based on interactions.
- Manage user subscriptions and recommend content dynamically.
The microservices are independently scalable and deployable, ensuring flexibility and ease of maintenance.
VidStream utilizes a microservices architecture with the following key components:
- Purpose: Manages video operations like posting, listing, and engagement.
- Tech Stack:
- Framework: Micronaut
- Database: Cassandra
- Messaging Queue: Kafka
- Responsibilities: Handles video data, tracks user engagement, and publishes interaction events.
- Purpose: Identifies top-liked hashtags over a specified time window.
- Tech Stack:
- Framework: Micronaut
- Database: PostgreSQL
- Data Streaming: Kafka Streams
- Responsibilities: Aggregates likes per tag and dynamically updates trending hashtags.
- Purpose: Manages user subscriptions to hashtags and recommends content.
- Tech Stack:
- Framework: Micronaut
- Database: Neo4j
- Messaging Queue: Kafka
- Responsibilities: Handles subscriptions and recommends videos based on interactions.
- Messaging Queue: Kafka facilitates communication between microservices using event-driven architecture.
- Cassandra: Stores video data and user interactions.
- PostgreSQL: Supports trending hashtag aggregation.
- Neo4j: Manages relationships for user subscriptions.
- Java 17
- Docker & Docker Compose
- Gradle
Navigate to each microservice directory and run:
./gradlew build
./gradlew jibDockerBuild
This creates a Docker image for each service using Google Jib.
Use Docker Compose for orchestration:
docker-compose up
This starts all microservices, databases, and Kafka instances.
Interact with the microservices using a Command-line Interface (CLI):
- Post a Video:
cli post -t=<title> -u=<userId> -T=<tags>
- Like a Video:
cli like-video -u=<userId> -v=<videoId>
- Show Trending Hashtags:
cli current-top -l=<limit>
Run cli --help
for the full list of commands.
- Unit and Integration Testing: High test coverage with JaCoCo.
- System Testing: Ensures proper inter-service communication and data integrity.
- Vulnerability Scanning: Docker images are scanned using Trivy and Docker Scout.