Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Contributing to Beatnik Controller

First off, thank you for considering contributing to Beatnik Controller! Any help is welcome and appreciated.

## Development Workflow

If you want to contribute with code, here is how to get the project running locally.

1. **Fork and Clone the Repository:**
```bash
git clone https://github.com/YOUR_USERNAME/beatnik-controller.git
cd beatnik-controller
```

2. **Install Dependencies:**
```bash
npm install
```

3. **Run the Development Server:**
```bash
ng serve
```
This will start a local development server at `http://localhost:4200`. The app will automatically reload if you change any of the source files.

## Building Mobile Apps (Android/iOS)

This application is built with Ionic and Capacitor, which means you can also compile it as a native app for Android and iOS.

To build the mobile apps, you will need to have the necessary development environments set up for Android (Android Studio) and iOS (Xcode).

1. **Add the desired platform:**
```bash
npx capacitor add android
npx capacitor add ios
```

2. **Build the web assets:**
```bash
npm run build
```

3. **Sync the web assets with the native project:**
```bash
npx capacitor sync
```

4. **Open the native project in its IDE:**
```bash
npx capacitor open android
npx capacitor open ios
```

From there, you can build and run the app on a device or emulator using the standard development tools for that platform.
127 changes: 32 additions & 95 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,124 +2,61 @@

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

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.

## Features

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.

**NOTE: This project is work in progess and not ment to be installed yet.**

## Table of Contents
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

- Control volume for all connected clients.
- Manage client groups.
- View what's currently playing on each stream.
- Simple and intuitive user interface.

## Prerequisites
- **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:
```bash
nvm install node
```
- **Angular CLI:** Install Angular CLI globally using:
```bash
npm install -g @angular/cli
```
- **Snapcast Server:** Install and configure the Snapcast media streaming server.
Find the tutorial here: https://github.com/byrdsandbytes/beatnik-pi

## Full Workflow

This section outlines the complete workflow for developing, building, and running the Beatnik Controller application.

### 1. Local Development

This is the standard workflow for making changes to the application on your local machine.

1. **Clone the Repository:**
```bash
git clone https://github.com/byrdsandbytes/beatnik-controller.git
cd beatnik-controller
```

2. **Install Dependencies:**
```bash
npm install
```

3. **Run the Development Server:**
```bash
ng serve
```
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.

4. **Code Scaffolding:**
Use the `npm run generate:*` scripts in `package.json` to easily create new pages, components, or services. For example, to create a new service:
```bash
npm run generate:service --name=my-new-service
```
To run Beatnik Controller, you will need:

### 2. Continuous Integration (CI) with GitHub Actions
- 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).
- [Docker](https://www.docker.com/get-started) and [Docker Compose](https://docs.docker.com/compose/install/).

This project uses GitHub Actions to automate building and checking the code.
## Installation & Usage

- **CI Workflow (`.github/workflows/ci.yml`):** On every push or pull request to the `master` branch, this workflow automatically:
1. Checks out the code.
2. Installs all necessary dependencies using `npm ci`.
3. Builds the Angular application for production. This step also implicitly runs the linter to ensure code quality.
Getting started with Beatnik Controller is simple with Docker.

- **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.
### 1. Get the Code

This automated process ensures that code merged into the `master` branch is always in a buildable and secure state.
Clone this repository to your local machine:

### 3. Running with Docker
```bash
git clone https://github.com/byrdsandbytes/beatnik-controller.git
cd beatnik-controller
```

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

## Prequisites
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:

**Install Docker & docker compose**
- **During Setup (Optional):** Edit `src/environments/environment.prod.ts` and change `snapcastServerUrl` to your server's hostname or IP address.
- **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.

Perform update and upgrade
```
sudo apt update && sudo apt upgrade -y
``````
Install Docker via Script
```
curl -fsSL test.docker.com -o get-docker.sh && sh get-docker.sh
```
### 3. Run with Docker

Add current user to the Docker Group
```
sudo usermod -aG docker ${USER}
```
Once configured, you can build and run the application using Docker Compose:

Check if it's running:
```
groups ${USER}
```bash
docker compose up -d
```

Check docker user
Reboot the Raspberry Pi to let the changes take effect
```
sudo reboot
```
This will build the Docker image and start the application in the background.

## Installation
### 4. Access the Application

1. **Build and Run the Docker Container:**
From the root of the project, run the following command:
```bash
docker compose up -d
```
This command reads the `docker-compose.yml` file, builds the Docker image as defined in the `Dockerfile`, and starts the container.
Open your web browser and navigate to `http://localhost:8181` or `http://your-hostname.local:8181`. You should now see the Beatnik Controller interface.

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

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

## Usage
## License

- **Configuration:** Configure your Snapcast settings in the project's environment files.
This project is licensed under the AGPL v3 License - see the [LICENSE](LICENSE) file for details.

28 changes: 28 additions & 0 deletions docs/images/DOCKER_INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Install Docker & docker compose

Perform update and upgrade

```
sudo apt update && sudo apt upgrade -y
``````
Install Docker via Script
```
curl -fsSL test.docker.com -o get-docker.sh && sh get-docker.sh
```
Add current user to the Docker Group
```
sudo usermod -aG docker ${USER}
```
Once configured, you can build and run the application using Docker Compose:

Check if it's running:
```
groups ${USER}
```

Reboot the Raspberry Pi to let the changes take effect
```
sudo reboot
```