diff --git a/.vscode/launch.json b/.vscode/launch.json index 097853b..8db4fae 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,20 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "Dev: Debug Backend", + "request": "launch", + "runtimeArgs": [ + "run-script", + "debug" + ], + "runtimeExecutable": "npm", + "skipFiles": [ + "/**" + ], + "type": "node", + "cwd": "${workspaceFolder}/backend" + }, { "type": "node", "request": "attach", diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..bab2643 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,38 @@ +

Development

+ +- [First time...](#first-time) + - [Setup](#setup) + - [Startup](#startup) +- [Debugging the backend (VSC)](#debugging-the-backend-vsc) +- [Deploy changes](#deploy-changes) + - [Frontend](#frontend) + - [Backend](#backend) + +# First time... + +## Setup +Checkout the repository and navigate to the `youtubedl-material` directory. +```bash +vim ./backend/appdata/default.json # Edit settings for your local environment +npm -g install pm2 # Install pm2 +npm install # Install dependencies for the frontend +cd ./backend +npm install # Install dependencies for the backend +cd .. +npm run build # Build the frontend +``` +This step have to be done only once. + +## Startup +Navigate to the `youtubedl-material/backend` directory and run `npm start`. + +# Debugging the backend (VSC) +Open the `youtubedl-material` directory in Visual Studio Code and run the launch configuration `Dev: Debug Backend`. + +# Deploy changes + +## Frontend +Navigate to the `youtubedl-material` directory and run `npm run build`. Restart the backend. + +## Backend +Simply restart the backend. \ No newline at end of file diff --git a/README.md b/README.md index 6dc0c46..df6e398 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,9 @@ If you'd like to install YoutubeDL-Material, go to the Installation section. If To deploy, simply clone the repository, and go into the `youtubedl-material` directory. Type `npm install` and all the dependencies will install. Then type `cd backend` and again type `npm install` to install the dependencies for the backend. -Once you do that, you're almost up and running. All you need to do is edit the configuration in `youtubedl-material/appdata`, go back into the `youtubedl-material` directory, and type `npm build`. This will build the app, and put the output files in the `youtubedl-material/backend/public` folder. +Once you do that, you're almost up and running. All you need to do is edit the configuration in `youtubedl-material/appdata`, go back into the `youtubedl-material` directory, and type `npm run build`. This will build the app, and put the output files in the `youtubedl-material/backend/public` folder. + +Lastly, type `npm -g install pm2` to install pm2 globally. The frontend is now complete. The backend is much easier. Just go into the `backend` folder, and type `npm start`.