A reimagining of the Watch2Gether website, but built using a microservices architecture. This project was created with the goal of learning new technologies (for example: RabbitMQ and Angular) while simultaneously rewriting this tool in new technologies.
Table of Contents:
The application has been "dockerized", therefore, it can be run in containers. However, it is necessary to initially configure the environment variables. Each application has its own environment variables, and in the environment variables folder, you can find examples for each application.
To configure the application with Docker, you can use either the normal Docker Compose file or the local Docker Compose file. The normal Docker Compose points to the environment variables present in the /env/[application name]/env
folder (ideal for running the application if you want to change multiple environment variables), while the local Docker Compose points to the environment variables in the /env/[application name]/local
folder (ideal for quickly running the application, just by changing the Discord API Token).
Additionally, I have created a tool called "Environment starter" to assist in creating environment variable files, which can be downloaded from the packages in this repository. To use it is simple: just open the executable ".jar" with the command java -jar [jar name].jar
. With that, just enter the root folder location of this project and the Discord API Token and then click "Generate":
With this, environment variable files will be created inside the /env/[application name]/env
folders, mirrored in the local variable files.
Finally, when starting the Compose, it is necessary to select one of the services "nginx-dependencies" or "nginx-no-dependencies" (it is not possible to select both simultaneously). The "nginx-dependencies" makes Nginx start after all applications have started, while the "nginx-no-dependencies" makes Nginx start without depending on any application.
To configure the application without Docker, you need to run the applications based on the examples of environment variable files.
The current major limitation of the application is that it does not add bot commands to the server as soon as it joins the guild. As I previously mentioned: this application is not meant to be taken seriously, but rather as a mere experiment in technologies and learning.
To work around this issue, you need to send an HTTP request of method "POST" to the endpoint [application address "Messenger"]/messenger/command
(defined in this controller). Here's an example using Thunder Client:
The usage of this application is relatively simple: initially, you need to mark a delimiter message in the Discord channel where you want to "assemble the Watch2Gether":
After that, this message and all subsequent messages will have the content of downloaded videos (for example: YouTube videos, Instagram videos, etc.).
With the delimiter message defined, simply access the Front-end address (via Angular it's localhost:4200, via Docker with default settings it's localhost:80), enter the guild and desired channel:
- Builder - application responsible for assembling the list of videos to watch: Kotlin with Spring in Java 21
- Downloader - application responsible for downloading videos and storing them in the File Storage API: Node.js with Nest and YoutubeDL
- Environment Starter - GUI to quickly generate environment configuration: Java 21 with Swing (yes, Swing in 2024)
- File Storage - application responsible for storing files: Quarkus and Java 21
- Front-end: Angular 17 and TailwindCSS
- Messenger - application containing the Discord Bot: Node.js with Nest and Discord.js
- Nginx - general server.
Feel free to do whatever you want with this code.