|
2 | 2 |
|
3 | 3 |  |
4 | 4 |
|
| 5 | +Beatnik Controller is a web-based remote control for your [Snapcast](https://github.com/badaix/snapcast) multi-room audio server. It allows you to easily manage and control audio streams from any device with a web browser. The application can also be compiled for Android and iOS. |
5 | 6 |
|
| 7 | +## Features |
6 | 8 |
|
7 | | -Beatnik Controller is a project built with Angular that demonstrates integration with the Snapcast media streaming server. This repository provides a sample implementation to manage and control audio streams. |
8 | | - |
9 | | -**NOTE: This project is work in progess and not ment to be installed yet.** |
10 | | - |
11 | | -## Table of Contents |
12 | | -- [Prerequisites](#prerequisites) |
13 | | -- [Installation](#installation) |
14 | | -- [Usage](#usage) |
15 | | -- [Contributing](#contributing) |
16 | | -- [License](#license) |
17 | | - |
| 9 | +- Control volume for all connected clients. |
| 10 | +- Manage client groups. |
| 11 | +- View what's currently playing on each stream. |
| 12 | +- Simple and intuitive user interface. |
18 | 13 |
|
19 | 14 | ## Prerequisites |
20 | | -- **Node.js:** For better Node.js version management, we recommend using nvm. First, install nvm by following the instructions on [nvm-sh/nvm](https://github.com/nvm-sh/nvm). Then, install the latest Node.js version with: |
21 | | - ```bash |
22 | | - nvm install node |
23 | | - ``` |
24 | | -- **Angular CLI:** Install Angular CLI globally using: |
25 | | - ```bash |
26 | | - npm install -g @angular/cli |
27 | | - ``` |
28 | | -- **Snapcast Server:** Install and configure the Snapcast media streaming server. |
29 | | -Find the tutorial here: https://github.com/byrdsandbytes/beatnik-pi |
30 | | - |
31 | | -## Full Workflow |
32 | | - |
33 | | -This section outlines the complete workflow for developing, building, and running the Beatnik Controller application. |
34 | | - |
35 | | -### 1. Local Development |
36 | | - |
37 | | -This is the standard workflow for making changes to the application on your local machine. |
38 | | - |
39 | | -1. **Clone the Repository:** |
40 | | - ```bash |
41 | | - git clone https://github.com/byrdsandbytes/beatnik-controller.git |
42 | | - cd beatnik-controller |
43 | | - ``` |
44 | | - |
45 | | -2. **Install Dependencies:** |
46 | | - ```bash |
47 | | - npm install |
48 | | - ``` |
49 | | - |
50 | | -3. **Run the Development Server:** |
51 | | - ```bash |
52 | | - ng serve |
53 | | - ``` |
54 | | - This will start a local development server. Open your browser and navigate to `http://localhost:4200`. The app will automatically reload if you change any of the source files. |
55 | 15 |
|
56 | | -4. **Code Scaffolding:** |
57 | | - Use the `npm run generate:*` scripts in `package.json` to easily create new pages, components, or services. For example, to create a new service: |
58 | | - ```bash |
59 | | - npm run generate:service --name=my-new-service |
60 | | - ``` |
| 16 | +To run Beatnik Controller, you will need: |
61 | 17 |
|
62 | | -### 2. Continuous Integration (CI) with GitHub Actions |
| 18 | +- A running Snapcast server on your network. This application is compatible with the standard [Snapcast server](https://github.com/badaix/snapcast). For a detailed installation guide for a Raspberry Pi based setup, we recommend [beatnik-pi](https://github.com/byrdsandbytes/beatnik-pi). |
| 19 | +- [Docker](https://www.docker.com/get-started) and [Docker Compose](https://docs.docker.com/compose/install/). |
63 | 20 |
|
64 | | -This project uses GitHub Actions to automate building and checking the code. |
| 21 | +## Installation & Usage |
65 | 22 |
|
66 | | -- **CI Workflow (`.github/workflows/ci.yml`):** On every push or pull request to the `master` branch, this workflow automatically: |
67 | | - 1. Checks out the code. |
68 | | - 2. Installs all necessary dependencies using `npm ci`. |
69 | | - 3. Builds the Angular application for production. This step also implicitly runs the linter to ensure code quality. |
| 23 | +Getting started with Beatnik Controller is simple with Docker. |
70 | 24 |
|
71 | | -- **CodeQL Analysis (`.github/workflows/codeql.yml`):** This workflow runs on the same triggers and performs a deep security scan of the codebase to find potential vulnerabilities. |
| 25 | +### 1. Get the Code |
72 | 26 |
|
73 | | -This automated process ensures that code merged into the `master` branch is always in a buildable and secure state. |
| 27 | +Clone this repository to your local machine: |
74 | 28 |
|
75 | | -### 3. Running with Docker |
| 29 | +```bash |
| 30 | +git clone https://github.com/byrdsandbytes/beatnik-controller.git |
| 31 | +cd beatnik-controller |
| 32 | +``` |
76 | 33 |
|
77 | | -You can easily run the application in a containerized environment using Docker and Docker Compose. |
| 34 | +### 2. Configure the Snapcast Server (Optional) |
78 | 35 |
|
79 | | -## Prequisites |
| 36 | +By default, the application will try to connect to a Snapcast server at `beatnik-server.local`. If your server is at a different address, you can configure it in two ways: |
80 | 37 |
|
81 | | -**Install Docker & docker compose** |
| 38 | +- **During Setup (Optional):** Edit `src/environments/environment.prod.ts` and change `snapcastServerUrl` to your server's hostname or IP address. |
| 39 | +- **In-App Settings:** Once the application is running, you can go to the settings page and change the Snapcast server address directly in the user interface. |
82 | 40 |
|
83 | | -Perform update and upgrade |
84 | | -``` |
85 | | -sudo apt update && sudo apt upgrade -y |
86 | | -`````` |
87 | | -Install Docker via Script |
88 | | -``` |
89 | | -curl -fsSL test.docker.com -o get-docker.sh && sh get-docker.sh |
90 | | -``` |
| 41 | +### 3. Run with Docker |
91 | 42 |
|
92 | | -Add current user to the Docker Group |
93 | | -``` |
94 | | -sudo usermod -aG docker ${USER} |
95 | | -``` |
| 43 | +Once configured, you can build and run the application using Docker Compose: |
96 | 44 |
|
97 | | -Check if it's running: |
98 | | -``` |
99 | | -groups ${USER} |
| 45 | +```bash |
| 46 | +docker compose up -d |
100 | 47 | ``` |
101 | 48 |
|
102 | | -Check docker user |
103 | | -Reboot the Raspberry Pi to let the changes take effect |
104 | | -``` |
105 | | -sudo reboot |
106 | | -``` |
| 49 | +This will build the Docker image and start the application in the background. |
107 | 50 |
|
108 | | -## Installation |
| 51 | +### 4. Access the Application |
109 | 52 |
|
110 | | -1. **Build and Run the Docker Container:** |
111 | | - From the root of the project, run the following command: |
112 | | - ```bash |
113 | | - docker compose up -d |
114 | | - ``` |
115 | | - This command reads the `docker-compose.yml` file, builds the Docker image as defined in the `Dockerfile`, and starts the container. |
| 53 | +Open your web browser and navigate to `http://localhost:8181` or `http://your-hostname.local:8181`. You should now see the Beatnik Controller interface. |
116 | 54 |
|
117 | | -2. **Access the Application:** |
118 | | - Once the container is running, open your browser and navigate to `http://localhost:8181`. |
| 55 | +## Contributing |
119 | 56 |
|
120 | | -The `Dockerfile` is optimized for production and uses a multi-stage build. It first builds the Angular application and then serves the static output files from a lightweight Nginx web server, resulting in a small and efficient final image. |
| 57 | +If you are a developer and want to contribute to the project, build mobile apps, or run the application in a development environment, please see our [CONTRIBUTING.md](CONTRIBUTING.md) file for more information. |
121 | 58 |
|
122 | | -## Usage |
| 59 | +## License |
123 | 60 |
|
124 | | -- **Configuration:** Configure your Snapcast settings in the project's environment files. |
| 61 | +This project is licensed under the AGPL v3 License - see the [LICENSE](LICENSE) file for details. |
125 | 62 |
|
0 commit comments