Skip to content

Commit 27b2b92

Browse files
authored
Merge pull request #11 from rudyberends/feature/release-and-docs
Feature/release and docs
2 parents fe8feda + 9c35740 commit 27b2b92

10 files changed

Lines changed: 8762 additions & 1577 deletions

File tree

.github/workflows/commitlint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Commit message lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
commitlint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Lint commits in PR
17+
uses: wagoid/commitlint-github-action@v4
18+
with:
19+
configFile: commitlint.config.js

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- beta
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Use Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build
26+
run: npm run build
27+
28+
- name: Run tests
29+
run: npm test
30+
31+
- name: Run semantic-release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: npx semantic-release

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit "$1"

.releaserc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"branches": [
3+
"main",
4+
{
5+
"name": "beta",
6+
"prerelease": true,
7+
"channel": "beta"
8+
}
9+
],
10+
"plugins": [
11+
["@semantic-release/commit-analyzer", { "preset": "conventionalcommits" }],
12+
["@semantic-release/release-notes-generator", { "preset": "conventionalcommits" }],
13+
"@semantic-release/changelog",
14+
["@semantic-release/npm", { "npmPublish": false }],
15+
["@semantic-release/github"],
16+
["@semantic-release/git", {
17+
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
18+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
19+
}]
20+
]
21+
}

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Contributing
2+
3+
Thanks for contributing to lox-audioserver! Below are short guidelines to keep contributions consistent with automated releases and commit linting.
4+
5+
## Commit messages
6+
We use Conventional Commits. Some examples:
7+
8+
- `feat: add blablabla`
9+
- `fix(parser): prevent crash on missing metadata`
10+
- `chore: update dependencies`
11+
- `docs: update README`
12+
- `refactor!: change API contract` (the `!` marks a breaking change)
13+
14+
## Branch strategy
15+
- `beta`: for unstable or testing releases. Open PRs to `beta` to test features in a pre-release.
16+
- `main`: stable releases. Only merge into `main` when code is tested and approved.
17+
18+
## Releases
19+
- `semantic-release` runs automatically for pushes to `beta` and `main`.
20+
- `beta` produces prereleases like `2.2.0-beta.1`.
21+
- `main` produces normal semver releases like `2.2.0`.
22+
23+
## Pull Request flow
24+
1. Create a feature branch from `beta` or `main` (preferably `beta` for new features).
25+
2. Open a PR and ask for reviews.
26+
3. Ensure all CI checks are green (lint, tests, commitlint).
27+
4. Merge to `beta` for test deployments. When stable, open a PR from `beta` to `main` or cherry-pick the relevant commits.

README.md

Lines changed: 74 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -5,94 +5,101 @@ player backends (required) and, optionally, media providers while keeping the Mi
55
happy. It exposes the same HTTP/WebSocket surface as the original firmware so existing apps,
66
Touch/Miniservers, and integrations can keep talking to it without modification.
77

8-
The project currently ships with working Bang & Olufsen BeoLink and Music Assistant support, but the modular design makes it straightforward to plug in other systems.
9-
108
## Features
119

12-
- 🎧 **Zone backends**: Music Assistant, Beolink, and a stub Sonos implementation that
13-
demonstrates how to integrate additional clients.
14-
- 📻 **Media providers (optional)**: Music Assistant provider with full library/radio/playlist
15-
support. If no provider is configured, the built-in dummy provider returns empty lists so
16-
clients remain responsive.
17-
- 🧩 **Extensible core**: Clean separation between request routing, providers, and zone
18-
backends to make future integrations easy.
10+
- Zone backends
11+
- 🎧 Music Assistant backend — Controls Music Assistant players; supports multiple players per server. (Set `maPlayerId` per zone in the admin UI.)
12+
- 🔊 BeoLink backend — Integrates with Bang & Olufsen BeoLink devices. Typically one device per zone via its IP.
13+
- 📦 Sonos / Example backend — Stub/sample implementation to demonstrate how to integrate additional clients; extend this for real Sonos support.
14+
15+
- Media providers (optional)
16+
- 📻 Music Assistant provider — Full library, radio and playlist browsing and playback via Music Assistant.
17+
- 🧪 BeoLink provider — Only radio support.
18+
- ⚙️ Dummy provider — Returns empty lists for library/radio/playlist requests so clients remain responsive when no provider is configured (Default provider).
19+
20+
- Extensible core
21+
- 🧩 Clean separation between HTTP/WebSocket routing, media providers, and zone backends to make adding new integrations straightforward.
22+
23+
You can configure backends and providers via the admin UI; see the `Configuration Overview` below for pointer to `data/config.json` and per-backend notes.
1924

2025
## Requirements
2126

22-
- Node.js **20** or newer (the repo uses `@tsconfig/node20`).
23-
- npm (ships with Node) for dependency management.
24-
- Easiest deployment: use the published Docker image.
27+
- Docker (recommended) — easiest way to run the server without building from source.
28+
- docker-compose (optional) — the repository includes a `docker-compose.yml` for one-command startup.
29+
- Make sure host ports `7091` and `7095` are available (or adjust host mappings when running the container).
2530

2631
## Quick Start
2732

28-
Clone the repository of use a zipped release from the releases.
33+
The easiest options are `docker-compose` or `docker run`.
2934

30-
1. **Install dependencies**
35+
### Recommended: docker-compose (one command)
3136

32-
```bash
33-
npm install
34-
```
37+
If you have Docker and docker-compose installed you can use the included `docker-compose.yml`:
3538

36-
2. **Build**
39+
```bash
40+
docker compose up -d
41+
```
3742

38-
```bash
39-
npm run build
40-
```
43+
This starts a container named `lox-audioserver` and exposes the required ports (`7091`, `7095`).
4144

42-
3. **Run**
45+
### Quick Docker run
4346

44-
```bash
45-
npm start
46-
```
47+
If you prefer `docker run`:
4748

48-
The server exposes two endpoints by default:
49+
```bash
50+
docker run -d \
51+
--name lox-audioserver \
52+
-p 7091:7091 \
53+
-p 7095:7095 \
54+
-v $(pwd)/data:/app/data \
55+
ghcr.io/rudyberends/rudyberends/lox-audioserver:latest
56+
```
4957

50-
- `7091``AppHttp` (used by Loxone apps / WebSocket clients and the admin UI).
51-
- `7095``msHttp` (used by the Miniserver itself).
58+
This starts a container named `lox-audioserver` and exposes the required ports (`7091`, `7095`).
5259

53-
During development you can use the watcher to run TypeScript directly:
60+
### Run standalone by cloning (no Docker)
5461

55-
```bash
56-
npm run watch
57-
```
62+
If you prefer to run the server directly on the host without Docker, follow these steps. This is a minimal "standalone" run and requires Node.js and npm.
5863

59-
5. **Run via Docker (from GitHub Container Registry)**
64+
Prerequisites
6065

61-
Every release publishes a multi-arch image to GHCR. Replace `VERSION` with a published tag
62-
(or use `latest`).
66+
- Node.js 20 or newer
67+
- npm (comes with Node)
68+
- Ports `7091` and `7095` available on the host
6369

64-
```bash
65-
docker run \
66-
-p 7091:7091 \
67-
-p 7095:7095 \
68-
-v $(pwd)/data:/app/data \
69-
ghcr.io/rudyberends/rudyberends/lox-audioserver:VERSION
70+
Step-by-step
7071

71-
The workflow `.github/workflows/create-release-and-build.yml` bumps the version, builds,
72-
and pushes the image automatically whenever changes land on `main`.
72+
1. Clone the repository and change directory:
7373

74-
## Configuring
74+
```bash
75+
git clone https://github.com/rudyberends/lox-audioserver.git
76+
cd lox-audioserver
77+
```
7578

76-
Open the admin UI at `http://<lox-audioserver-ip>:7091/admin` and follow the guided steps. It walks you through adding the Audio Server in Loxone Config, rebooting the Miniserver, pairing, and assigning zones/providers once the MiniServer reconnects.
79+
2. Create a persistent data folder (used for config, logs, and cache):
7780

78-
When the lox-audioserver starts successfully and the Miniserver pairs successfully with the lox-audioserver, the Audio Server icon in
79-
Loxone Config turns green.
81+
```bash
82+
mkdir -p data
83+
```
8084

81-
## Configuration Overview
85+
3. Install dependencies and build:
8286

83-
All settings are stored in `data/config.json`. The
84-
admin UI reads and writes this file for you.
87+
```bash
88+
npm install
89+
npm run build
90+
```
91+
92+
4. Start the server:
93+
94+
```bash
95+
npm start
96+
```
8597

86-
- **Beolink/Sonos backends** expect a one-to-one mapping: each zone points to a dedicated
87-
device IP.
88-
- **MusicAssistant backend** can control many players on the same server. Set `maPlayerId` for
89-
each zone using the “Player ID” from Music Assistant → Player settings.
98+
### Configuring
9099

91-
| Zone backend | Compatible provider(s) | Notes |
92-
| ------------ | ---------------------------------------- | ----- |
93-
| `BackendMusicAssistant` | `MusicAssistantProvider`, `DummyProvider` | Requires `maPlayerId`; multiple zones can share one MA host. |
94-
| `BackendBeolink` | `BeolinkProvider`, `DummyProvider` | One device per zone via its IP. |
95-
| `BackendSonos` / `BackendExample` | `DummyProvider` | Stub/sample implementations; extend to add real provider support. |
100+
Open the admin UI at http://<lox-audioserver-ip>:7091/admin and follow the guided steps. It walks you through adding the Audio Server in Loxone Config, rebooting the Miniserver, pairing, and assigning zones/providers once the MiniServer reconnects.
101+
102+
When the lox-audioserver starts successfully and the Miniserver pairs successfully with the lox-audioserver, the Audio Server icon in Loxone Config turns green.
96103

97104
## Code Structure
98105

@@ -124,19 +131,17 @@ src/
124131
(e.g., Music Assistant provider pairs with `BackendMusicAssistant`). Mixing incompatible
125132
providers/backends is not supported.
126133

127-
## Development Notes
134+
## Contributing
128135

129-
- TypeScript sources live in `src/`; compiled output goes to `dist/` via `npm run build`.
130-
- Logging uses a Winston-based logger (`src/utils/troxorlogger.ts`). Log levels are configured
131-
via the admin UI (stored in `data/config.json`).
132-
- Graceful shutdown signals (`SIGINT`, `SIGTERM`) are handled in `src/server.ts`; staged
133-
clean-up (zone backends, servers) ensures repeatable restarts.
136+
Pull requests are welcome. Full contribution guidelines (commit message conventions, PR flow and release rules) are in `CONTRIBUTING.md`.
134137

135-
## Contributing
138+
- Make a feature branch from `beta` (or `main` when appropriate):
139+
`git checkout -b feature/your-feature-name`
140+
- Follow Conventional Commits for message formatting (commitlint will reject non-conforming messages).
141+
- Push your branch and open a PR targeting `beta` for testing: `gh pr create --base beta --head feature/your-feature-name`.
136142

137-
Pull requests for new providers/backends are welcome. Please run `npm run build` before
138-
submitting to ensure the TypeScript output stays in sync.
143+
Run `npm run build` locally before submitting a PR to keep compiled output in sync.
139144

140145
---
141146

142-
Need help or discovered a bug? Open an issue in the repository.
147+
Need help or found a bug? Open an issue in the repository.

commitlint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional']
3+
};

0 commit comments

Comments
 (0)