GithubHelp home page GithubHelp logo

media-streaming-microservice's Introduction

Media Stream Microservice



Table of Contents
  1. Requirements
  2. Getting Started
  3. Usage

Requirements

Build a publicly accessible service designed to stream an audio MP3 file to users upon accessing a specific URL corresponding to the desired audio episode. Certain episodes may be set as private, requiring authentication for streaming, which can be achieved either through header authentication or via a signed URL.


Built With


  • Laravel

Getting Started

Prerequisites

Before running this project, ensure that you have the following installed:

  • PHP (minimum version: 8.1.0)
  • Composer (minimum version: 2.0.0)
  • Node.js (minimum version: 14.0.0)
  • NPM (minimum version: 6.0.0)
  • MySQL (minimum version: 8.0.0)

Installation

Clone the repository to your local machine:

git clone https://github.com/Ahmad-Chebbo/media-streaming-microservice.git

Install the PHP dependencies:

composer install

Copy the .env.example file to a new file called .env:

cp .env.example .env

Generate an application key:

php artisan key:generate

Update the .env file with your database credentials.

Run the migrations:

php artisan migrate

Testing:

To run the tests, run the following command
Note the test will refresh the database records

php artisan test

Run the seed:

php artisan db:seed

Running the application

To start the development server, run the following command:

php artisan serve

Then visit http://localhost:8000 to view the application.

Running the queue

Some functionalities such as logging analytics require running the queue, but don't forget to run the Analytics service and change the ANALYTIC_SERVICE_MICROSERVICE_URL parameter in the .env file to match the analytics service URL.

php artisan queue:work

Docker configuration

The repository contains a DockerFile that can be used in the following commands:

docker build -t streaming-microservice .

followed by the following commands:

docker run -d -p 9000:9000 --name streaming-container streaming-microservice

NOTES

During the development process of this project, I created additional backend functionalities such as:

  • Storing Episode: I created a code that downloadn& store the mp3 file from the given url to the local storage or save an mp3 file in case of having a file instead of an mp3 url in the given request.
  • Streaming Episode: I created a controller method called streamEpisodeFromTheStorage that can be used in case of storing the episode in the local storage (like the previous point).

Although these functionalities are not used in the current version, you are welcome to review the code.

media-streaming-microservice's People

Contributors

ahmad-chebbo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.