Skip to content

Commit 514936c

Browse files
authored
Merge pull request #13 from byrdsandbytes/feature/docker-test
2 parents 08a4fdc + 19a584c commit 514936c

File tree

3 files changed

+114
-95
lines changed

3 files changed

+114
-95
lines changed

CONTRIBUTING.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Contributing to Beatnik Controller
2+
3+
First off, thank you for considering contributing to Beatnik Controller! Any help is welcome and appreciated.
4+
5+
## Development Workflow
6+
7+
If you want to contribute with code, here is how to get the project running locally.
8+
9+
1. **Fork and Clone the Repository:**
10+
```bash
11+
git clone https://github.com/YOUR_USERNAME/beatnik-controller.git
12+
cd beatnik-controller
13+
```
14+
15+
2. **Install Dependencies:**
16+
```bash
17+
npm install
18+
```
19+
20+
3. **Run the Development Server:**
21+
```bash
22+
ng serve
23+
```
24+
This will start a local development server at `http://localhost:4200`. The app will automatically reload if you change any of the source files.
25+
26+
## Building Mobile Apps (Android/iOS)
27+
28+
This application is built with Ionic and Capacitor, which means you can also compile it as a native app for Android and iOS.
29+
30+
To build the mobile apps, you will need to have the necessary development environments set up for Android (Android Studio) and iOS (Xcode).
31+
32+
1. **Add the desired platform:**
33+
```bash
34+
npx capacitor add android
35+
npx capacitor add ios
36+
```
37+
38+
2. **Build the web assets:**
39+
```bash
40+
npm run build
41+
```
42+
43+
3. **Sync the web assets with the native project:**
44+
```bash
45+
npx capacitor sync
46+
```
47+
48+
4. **Open the native project in its IDE:**
49+
```bash
50+
npx capacitor open android
51+
npx capacitor open ios
52+
```
53+
54+
From there, you can build and run the app on a device or emulator using the standard development tools for that platform.

README.md

Lines changed: 32 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -2,124 +2,61 @@
22

33
![Beatnik Dashboard Screen](docs/images/iphone15_screen.webp)
44

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.
56

7+
## Features
68

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.
1813

1914
## 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.
5515

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:
6117

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/).
6320

64-
This project uses GitHub Actions to automate building and checking the code.
21+
## Installation & Usage
6522

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.
7024

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
7226

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:
7428

75-
### 3. Running with Docker
29+
```bash
30+
git clone https://github.com/byrdsandbytes/beatnik-controller.git
31+
cd beatnik-controller
32+
```
7633

77-
You can easily run the application in a containerized environment using Docker and Docker Compose.
34+
### 2. Configure the Snapcast Server (Optional)
7835

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:
8037

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.
8240

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
9142

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:
9644

97-
Check if it's running:
98-
```
99-
groups ${USER}
45+
```bash
46+
docker compose up -d
10047
```
10148

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.
10750

108-
## Installation
51+
### 4. Access the Application
10952

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.
11654

117-
2. **Access the Application:**
118-
Once the container is running, open your browser and navigate to `http://localhost:8181`.
55+
## Contributing
11956

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.
12158

122-
## Usage
59+
## License
12360

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.
12562

docs/images/DOCKER_INSTALLATION.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Install Docker & docker compose
2+
3+
Perform update and upgrade
4+
5+
```
6+
sudo apt update && sudo apt upgrade -y
7+
``````
8+
Install Docker via Script
9+
```
10+
curl -fsSL test.docker.com -o get-docker.sh && sh get-docker.sh
11+
```
12+
Add current user to the Docker Group
13+
```
14+
sudo usermod -aG docker ${USER}
15+
```
16+
Once configured, you can build and run the application using Docker Compose:
17+
18+
Check if it's running:
19+
```
20+
groups ${USER}
21+
```
22+
23+
Reboot the Raspberry Pi to let the changes take effect
24+
```
25+
sudo reboot
26+
```
27+
28+

0 commit comments

Comments
 (0)