Getting Started
Prerequisites
- nginx
- nginx-secure-token-module
- nginx-vod-module
- FFmpeg
- MariaDB or MySQL
- MeiliSearch
- PHP 8+
- Soketi
- Supervisor
- Swoole
TIP
- Laravel Sail is included, providing a Docker compatible development environment.
Installation
This section will help you setup a basic MediaDB API from ground up.
- Step 1: Configure environment
Setup a basic environment using the given examples.
- Step 2: Clone the repository
cd /var/www/html
git clone git@github.com:francoism90/mediadb.git api
1
2
2
- Step 3: Initialize Laravel
cd api
cp .env.example .env
vi .env
composer install
php artisan key:generate
php artisan horizon:install
php artisan telescope:install
php artisan migrate --seed
php artisan storage:link
php artisan scout:create-indexes
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
TIP
- Replace
.env.example
with.env.sail.example
to configure Laravel Sail. - Replace
vi
with your favorite editor. - Check all configuration files and change them when necessary, especially
.env
,config/api.php
andconfig/filesystems.php
.
- Step 4: Configure Laravel & nginx
Update .env
:
DASH_URL=https://mediadb.test
DASH_KEY=d5460ef7a5c2bece2d1b24e0d9959e5ea9beb9dd449080147bdba001e9106793
DASH_IV=722d4f9191c53d5e934e13719d02cced
1
2
3
2
3
Update /etc/nginx/sites/mediadb-vod.conf
:
vod_base_url "https://mediadb.test";
vod_segments_base_url "https://mediadb.test";
vod_secret_key "randomstring-$vod_filepath";
secure_token_encrypt_uri_key d5460ef7a5c2bece2d1b24e0d9959e5ea9beb9dd449080147bdba001e9106793;
secure_token_encrypt_uri_iv 722d4f9191c53d5e934e13719d02cced;
1
2
3
4
5
6
2
3
4
5
6
TIP
- One may use
dd if=/dev/urandom bs=1 count=32 2> /dev/null | xxd -p -c32
to generate theDASH_KEY
/DASH_IV
values.
MediaDB will now listen at https://localhost:3000 and https://mediadb.test/api.
By now, you should have a basic but functional MediaDB API. Next, learn about the basics of configuration and usage of MediaDB.