BeatStream is a powerful music streaming and management application built using JHipster and Java. It allows users to download tracks and playlists from popular platforms like YouTube, SoundCloud, and Spotify. BeatStream also lets you upload your own songs, create a personalized library of tracks and playlists, and manage your music collection seamlessly. π§
-
π₯ Download Music: Easily download tracks and playlists from YouTube
, SoundCloud
, and Spotify
-
π€ Upload Your Own Songs: Add your personal music tracks to your library.
-
π Library Management: Create and manage a comprehensive library of songs and playlists.
-
π Download Tracking: Keep track of your downloads, including their progress and status.
-
π Task Downloads: Queue multiple downloads and manage them efficiently.
-
π οΈ Powerful Tools: Utilizes yt-dl for downloading, ffmpeg for audio processing, and ChromeDriver for web automation.
BeatStream is built using:
- Java for the backend.
- Spring Boot for building the application.
- JHipster for rapid development and scaffolding.
- Angular (if applicable) for the front end.
- MongoDb (or your preferred database) for data persistence.
- electron For Windows APP
To run BeatStream, you will need:
- β Java Development Kit (JDK) 11 or later
- π₯ yt-dl: A command-line program to download videos from YouTube and other sites.
- π΅ ffmpeg: A tool to handle multimedia files and streams.
- π ChromeDriver: For automating Chrome browser actions.
- Node.js and npm
- π±βπ MongoDB: Ensure that you have MongoDB running, as BeatStream uses it for data storage.
- π οΈ Clone the repository:
git clone https://github.com/adelelawady/beatstream.git cd beatstream ./mvnw
π Access the application: Open your web browser and navigate to http://localhost:8080. π Follow the on-screen instructions to download tracks, upload songs, and manage your library.
For API documentation, visit http://localhost:8080/swagger-ui/.
π€ Contributions are welcome! If you have suggestions for improvements or new features, feel free to fork the repository and submit a pull request.
π This project is licensed under the MIT License - see the LICENSE file for details.
Important Note on Spotify Downloads:
The BeatStream app provides a limited integration with Spotify that allows users to download songs by grabbing the song title from Spotify and searching for it on YouTube.
- Single-Track Limitation: Downloads are currently limited to one song per request for any Spotify track.
- Educational Use Only: This functionality is designed for educational and personal research purposes only. BeatStream aims to serve as a learning tool for those interested in understanding how multimedia streaming technologies work, promoting digital literacy, and encouraging responsible, ethical use of software.
This application was generated using JHipster 8.7.1, you can find documentation and help at https://www.jhipster.tech/documentation-archive/v8.7.1.
Node is required for generation and recommended for development. package.json
is always generated for a better development experience with prettier, commit hooks, scripts and so on.
In the project root, JHipster generates configuration files for tools like git, prettier, eslint, husky, and others that are well known and you can find references in the web.
/src/*
structure follows default Java structure.
-
.yo-rc.json
- Yeoman configuration file JHipster configuration is stored in this file atgenerator-jhipster
key. You may findgenerator-jhipster-*
for specific blueprints configuration. -
.yo-resolve
(optional) - Yeoman conflict resolver Allows to use a specific action when conflicts are found skipping prompts for files that matches a pattern. Each line should match[pattern] [action]
with pattern been a Minimatch pattern and action been one of skip (default if omitted) or force. Lines starting with#
are considered comments and are ignored. -
.jhipster/*.json
- JHipster entity configuration files -
npmw
- wrapper to use locally installed npm. JHipster installs Node and npm locally using the build tool by default. This wrapper makes sure npm is installed locally and uses it avoiding some differences different versions can cause. By using./npmw
instead of the traditionalnpm
you can configure a Node-less environment to develop or test your application. -
/src/main/docker
- Docker configurations for the application and services that the application depends on
OpenAPI-Generator is configured for this application. You can generate API code from the src/main/resources/swagger/api.yml
definition file by running:
./mvnw generate-sources
Then implements the generated delegate classes with @Service
classes.
To edit the api.yml
definition file, you can use a tool such as Swagger-Editor. Start a local instance of the swagger-editor using docker by running: docker compose -f src/main/docker/swagger-editor.yml up -d
. The editor will then be reachable at http://localhost:7742.
Refer to Doing API-First development for more details. The build system will install automatically the recommended version of Node and npm.
We provide a wrapper to launch npm. You will only need to run this command when dependencies change in package.json.
./npmw install
We use npm scripts and Angular CLI with Webpack as our build system.
Run the following commands in two separate terminals to create a blissful development experience where your browser auto-refreshes when files change on your hard drive.
./mvnw
./npmw start
Npm is also used to manage CSS and JavaScript dependencies used in this application. You can upgrade dependencies by
specifying a newer version in package.json. You can also run ./npmw update
and ./npmw install
to manage dependencies.
Add the help
flag on any command to see how you can use it. For example, ./npmw help update
.
The ./npmw run
command will list all the scripts available to run for this project.
JHipster ships with PWA (Progressive Web App) support, and it's turned off by default. One of the main components of a PWA is a service worker.
The service worker initialization code is disabled by default. To enable it, uncomment the following code in src/main/webapp/app/app.config.ts
:
ServiceWorkerModule.register('ngsw-worker.js', { enabled: false });
For example, to add Leaflet library as a runtime dependency of your application, you would run following command:
./npmw install --save --save-exact leaflet
To benefit from TypeScript type definitions from DefinitelyTyped repository in development, you would run following command:
./npmw install --save-dev --save-exact @types/leaflet
Then you would import the JS and CSS files specified in library's installation instructions so that Webpack knows about them: Edit src/main/webapp/app/app.config.ts file:
import 'leaflet/dist/leaflet.js';
Edit src/main/webapp/content/scss/vendor.scss file:
@import 'leaflet/dist/leaflet.css';
Note: There are still a few other things remaining to do for Leaflet that we won't detail here.
For further instructions on how to develop with JHipster, have a look at Using JHipster in development.
You can also use Angular CLI to generate some custom client code.
For example, the following command:
ng generate component my-component
will generate few files:
create src/main/webapp/app/my-component/my-component.component.html
create src/main/webapp/app/my-component/my-component.component.ts
update src/main/webapp/app/app.config.ts
To build the final jar and optimize the beatStream application for production, run:
./mvnw -Pprod clean verify -DskipTests
This will concatenate and minify the client CSS and JavaScript files. It will also modify index.html
so it references these new files.
To ensure everything worked, run:
java -jar target/*.jar
Then navigate to http://localhost:8080 in your browser.
Refer to Using JHipster in production for more details.
To package your application as a war in order to deploy it to an application server, run:
./mvnw -Pprod,war clean verify
JHipster Control Center can help you manage and control your application(s). You can start a local control center server (accessible on http://localhost:7419) with:
docker compose -f src/main/docker/jhipster-control-center.yml up
To launch your application's tests, run:
./mvnw verify
Unit tests are run by Jest. They're located in src/test/javascript/ and can be run with:
./npmw test
Sonar is used to analyse code quality. You can start a local Sonar server (accessible on http://localhost:9001) with:
docker compose -f src/main/docker/sonar.yml up -d
Note: we have turned off forced authentication redirect for UI in src/main/docker/sonar.yml for out of the box experience while trying out SonarQube, for real use cases turn it back on.
You can run a Sonar analysis with using the sonar-scanner or by using the maven plugin.
Then, run a Sonar analysis:
./mvnw -Pprod clean verify sonar:sonar -Dsonar.login=admin -Dsonar.password=admin
If you need to re-run the Sonar phase, please be sure to specify at least the initialize
phase since Sonar properties are loaded from the sonar-project.properties file.
./mvnw initialize sonar:sonar -Dsonar.login=admin -Dsonar.password=admin
Additionally, Instead of passing sonar.password
and sonar.login
as CLI arguments, these parameters can be configured from sonar-project.properties as shown below:
sonar.login=admin
sonar.password=admin
For more information, refer to the Code quality page.
You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the src/main/docker folder to launch required third party services.
For example, to start a database in a docker container, run:
docker compose -f src/main/docker/mongodb.yml up -d
To stop it and remove the container, run:
docker compose -f src/main/docker/mongodb.yml down
You can also fully dockerize your application and all the services that it depends on. To achieve this, first build a docker image of your app by running:
npm run java:docker
Or build a arm64 docker image when using an arm64 processor os like MacOS with M1 processor family running:
npm run java:docker:arm64
Then run:
docker compose -f src/main/docker/app.yml up -d
When running Docker Desktop on MacOS Big Sur or later, consider enabling experimental Use the new Virtualization framework
for better processing performance (disk access performance is worse).
For more information refer to Using Docker and Docker-Compose, this page also contains information on the docker-compose sub-generator (jhipster docker-compose
), which is able to generate docker configurations for one or several JHipster applications.
To configure CI for your project, run the ci-cd sub-generator (jhipster ci-cd
), this will let you generate configuration files for a number of Continuous Integration systems. Consult the Setting up Continuous Integration page for more information.
-
@angular/common: Core common utilities π, includes common directives like NgIf and NgFor, as well as pipes for handling dates, currency, and more.
-
@angular/compiler: Essential for Angular template compilation π οΈ, allowing HTML and Angular directives to render as interactive elements.
-
@angular/core: The heart of Angular's framework π§©, including essential services and modules.
-
@angular/forms: Handles forms and form validation π, managing both reactive and template-driven forms.
-
@angular/localize: Localization support π, enabling the app to support multiple languages.
-
@angular/platform-browser and @angular/platform-browser-dynamic: Provide DOM interactions π±οΈ and template compilation on the browser.
-
@angular/router: Routing and navigation π§, handling URL routing for a single-page application structure.
- @capacitor/android, @capacitor/cli, @capacitor/core, @capacitor/ios: Facilitate mobile functionality for both iOS and Android π±, enabling native functionality access, like file storage, notifications, and more.
-
@fortawesome/angular-fontawesome: Angular component library for FontAwesome icons π¨, allowing easy integration of scalable icons.
-
@fortawesome/fontawesome-svg-core and @fortawesome/free-solid-svg-icons: Core FontAwesome SVG support πΌοΈ, providing a vast collection of icons for UI components.
-
@ngx-translate/core: Core translation module π, enabling dynamic translation handling.
-
@ngx-translate/http-loader: Allows loading translation files via HTTP requests π, making it simple to manage and update language files.
-
@ng-bootstrap/ng-bootstrap: Integrates Bootstrap into Angular ποΈ, enabling styled components like modals, alerts, and accordions.
-
bootstrap and bootswatch: Bootstrap library and themes π¨, providing pre-designed styles and UI components.
-
@popperjs/core and popper.js: Handle positioning of tooltips and pop-ups ποΈ, essential for creating interactive UI elements.
- ngx-file-drop: Allows drag-and-drop file upload functionality π₯, enabling users to upload files by dragging them into a specified area.
- ngx-plyr and plyr: Video and audio player support πΆ, providing customizable and lightweight media player features.
-
dayjs: Lightweight date library ποΈ, ideal for date and time manipulation.
-
jquery: General DOM manipulation library β¨, enhancing the functionality of traditional JavaScript.
-
rxjs: Reactive programming support π, offering observables that handle asynchronous data streams.
-
tslib: Utility library for TypeScript π§, minimizing bundle size and supporting helper functions.
-
zone.js: Execution context manager π, crucial for handling async operations and change detection in Angular.
- ngx-infinite-scroll: Provides infinite scroll functionality π, enabling content to load dynamically as the user scrolls.
-
@stomp/rx-stomp: Manages STOMP messaging over WebSockets π, allowing real-time data communication.
-
sockjs-client: Provides a WebSocket fallback π, maintaining connection stability even when WebSocket isnβt supported.