I am currently rewriting this to the microservices architecture, so it doesn't work now. Sorry for the inconvenience.
To clone and run this application, you'll need git, docker and docker-compose. Follow this steps to make this work:
-
Clone this repository and create
.env
file.$ git clone https://github.com/0x113/x-media $ cd x-media $ touch .env
-
Set envirionment varaibles in
.env
file: If you're using vim, type:$ vi .env
And if you're using emacs, enter the following:$ sudo apt-get remove emacs
vi .env
VIDEO_DIR
- path to folder with mp4 filesMOVIES_SUB_DIR
- path to folder with subtitles for videosJWT_SECRET
- key for generating jwtMYSQL_ROOT_PASSWORD
- MySQL root password
Example:
VIDEO_DIR=/home/user/Movies MOVIES_SUB_DIR=/home/user/Movies/sub JWT_SECRET=TOP SECRET MYSQL_ROOT_PASSWORD=rootorsomethingbetter
-
Run it.
docker-compose up
-
/user/create
- Create new user
- fields:
username
,password
- method:
POST
- response:
201
-
/user/token/generate
- Generate jwt for user
- fields:
username
,password
- method:
POST
- reponse:
200
-
/api/movies/update
- Updates movie database
- method:
GET
- response:
200
- authentication required
-
/api/movies/
- List of all movies
- method:
GET
- response:
200
- authentication required