ReplayVod is a project currently in development. It allows automatic downloading of Twitch replays from live streams and organizes missed streams from the week. You can schedule automatic downloads from a channel based on certain criteria. Additionally, it offers the ability to watch videos directly from the site and manage them.
- Node.js v21+
- npm
- Docker (for deployment)
- TWITCH_CLIENT_ID / TWITCH_SECRET
This is a monorepo that uses npm Workspaces.
-
Clone the Repository
git clone https://github.com/befabri/replayvod.git cd replayvod
-
Install Dependencies
npm install
-
Environment Variables You need to create a .env file in both the backend and frontend directories of the apps folder. We provide an .env.example file in each directory to illustrate the expected environment variables.
-
Run the Development Server
To start the development server for both the Fastify backend and the React frontend, run:
npm run dev
To secure your sessions, you'll need a secret-key
file. Follow the steps below to generate and place this key in the appropriate directory:
-
Generate the Secret Key:
-
For most platforms:
npx @fastify/secure-session > secret-key
-
If running in Windows Powershell:
npx @fastify/secure-session | Out-File -Encoding default -NoNewline -FilePath secret-key
If you haven't previously used this module with npx, you might be prompted to install it. Note that with the output redirect, this can cause the command to wait indefinitely for input.
Alternatively, if you don't want to use
npx
, you can generate thesecret-key
by first installing the@fastify/secure-session
library with your preferred package manager, and then:./node_modules/@fastify/secure-session/genkey.js > secret-key
-
-
Place the Secret Key in the 'secret' Folder:
After generating the
secret-key
, move it to thesecret
directory in your project:mv secret-key secret/secret-key
If you're on Windows, you can use:
move secret-key secret\secret-key
Make sure the secret
directory exists in your project, or create it before moving the secret-key
.
To integrate the backend with Twitch functionalities, you'll need to register your application with Twitch and obtain your personal TWITCH_CLIENT_ID
and TWITCH_SECRET
.
Follow the steps below to set up the Twitch integration:
-
Register Your Application on Twitch
-
Visit the Twitch Developers Console.
-
Click on the "Applications" tab.
-
Select "Register Your Application".
-
Fill in the required details. For the
OAuth Redirect URLs
, you'll need to specify the callback URL your application uses.http://localhost:8080/api/auth/twitch/callback
(Adjust the above URL if you're setting up a production environment or if your local setup uses a different port or path.)
-
Once registered, you'll be provided with a
Client ID
and aClient Secret
.
-
-
Update Environment Variables in backend .env
With your
Client ID
andClient Secret
from Twitch, update the.env
file (or create one based on the.env.example
provided):TWITCH_CLIENT_ID=your_client_id_from_twitch TWITCH_SECRET=your_client_secret_from_twitch CALLBACK_URL=your_callback_url
This project is licensed under the GNU General Public License v3.0. - see the LICENSE file for details.