Skip to content

Commit

Permalink
docs: Add quick start guide
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxMD committed Jul 17, 2024
1 parent b02c96a commit 8b0c720
Show file tree
Hide file tree
Showing 12 changed files with 223 additions and 24 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ A javascript app to scrobble music you listened to, to [Maloja](https://github.c
* Easy configuration through ENVs or JSON
* Install using [Docker images for x86/ARM](https://foxxmd.github.io/multi-scrobbler/docs/installation#docker#docker), [flatpak](https://foxxmd.github.io/multi-scrobbler/docs/installation#docker#flatpak), or [locally with NodeJS](https://foxxmd.github.io/multi-scrobbler/docs/installation#docker#nodejs)

[**Read The Docs to get started**](https://foxxmd.github.io/multi-scrobbler/docs/installation)
[**Quick Start Guide**](https://foxxmd.github.io/multi-scrobbler/docs/quickstart)

<img src="/assets/status-ui.png" width="800">

Expand Down Expand Up @@ -77,6 +77,10 @@ Client configurations consist of:
* A friendly name.
* Any data needed to communicate or authenticate with the Client.

## Quick Start

[See the **Quick Start Guide**](https://foxxmd.github.io/multi-scrobbler/docs/quickstart)

## Installation

[See the **Installation** documentation](https://foxxmd.github.io/multi-scrobbler/docs/installation)
Expand Down
2 changes: 1 addition & 1 deletion docsite/docs/configuration/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "Configuration",
"position": 2,
"position": 3,
"link": {
"type": "generated-index",
"description": "Configuring Multi-Scrobbler and examples"
Expand Down
3 changes: 2 additions & 1 deletion docsite/docs/configuration/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ Can use this source for any application that implements the [Subsonic API](http:

### [Jellyfin](https://jellyfin.org/)

#### Webhook Setup

Must be using Jellyfin 10.7 or greater

* In the Jellyfin desktop web UI Navigate to -> Administration -> Dashboard -> Plugins -> Catalog
Expand Down Expand Up @@ -1310,7 +1312,6 @@ or replace `localhost:9078` with your own base URL
| `LASTFM_SECRET` | Yes | | Shared secret from your API Account |
| `LASTFM_REDIRECT_URI` | No | `http://localhost:9078/lastfm/callback` | Url to use for authentication. Must include `lastfm/callback` somewhere in it |
| `LASTFM_SESSION` | No | | Session id. Will be generated by authentication flow if not provided. |
LastfmClientConfig
</TabItem>
<TabItem value="file" label="File">

Expand Down
2 changes: 1 addition & 1 deletion docsite/docs/development/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "Development",
"position": 3,
"position": 4,
"link": {
"type": "generated-index",
"description": "Developing for Multi-Scrobbler and tutorials"
Expand Down
2 changes: 1 addition & 1 deletion docsite/docs/installation/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "Installation",
"position": 1,
"position": 2,
"link": {
"type": "generated-index",
"description": "Way to install Multi-Scrobbler"
Expand Down
38 changes: 22 additions & 16 deletions docsite/docs/installation/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ To get the UID and GID for the current user run these commands from a terminal:

### Docker Usage Example

:::tip

See the [**Quick Start Guide**](../quickstart.mdx) for another guided docker-compose example

:::

The example scenario:

* [Spotify **Source**](../configuration/configuration.mdx#spotify)
Expand Down Expand Up @@ -315,22 +321,22 @@ The example scenario:
```yaml title="docker-compose.yml"
services:
multi-scrobbler:
image: foxxmd/multi-scrobbler
container_name: multi-scrobbler
environment:
- TZ=Etc/GMT # Specify timezone from TZ Database name found here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- SPOTIFY_CLIENT_ID=yourId
- SPOTIFY_CLIENT_SECRET=yourSecret
- BASE_URL="http://192.168.0.100:9078"
- MALOJA_URL=http://domain.tld:42010
- MALOJA_API_KEY=1234
- PUID=1000
- PGID=1000
volumes:
- /home/myUser/ms:/config
ports:
- "9078:9078"
restart: unless-stopped
image: foxxmd/multi-scrobbler
container_name: multi-scrobbler
environment:
- TZ=Etc/GMT # Specify timezone from TZ Database name found here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- SPOTIFY_CLIENT_ID=yourId
- SPOTIFY_CLIENT_SECRET=yourSecret
- BASE_URL="http://192.168.0.100:9078"
- MALOJA_URL=http://domain.tld:42010
- MALOJA_API_KEY=1234
- PUID=1000
- PGID=1000
volumes:
- /home/myUser/ms:/config
ports:
- "9078:9078"
restart: unless-stopped
```
</TabItem>
</Tabs>
Expand Down
4 changes: 2 additions & 2 deletions docsite/docs/installation/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This setup will create a [user service](https://wiki.archlinux.org/title/systemd

Create a new service file for multi-scrobbler under your HOME config:

```console
```bash
mkdir -p ~/.config/systemd/user
touch ~/.config/systemd/user/multi-scrobbler.service
```
Expand Down Expand Up @@ -56,7 +56,7 @@ Restart=no

Save the file then run:

```console
```bash
systemctl daemon-reload
systemctl --user enable multi-scrobbler.service
systemctl --user start multi-scrobbler.service
Expand Down
165 changes: 165 additions & 0 deletions docsite/docs/quickstart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
---
title: 'Quickstart'
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

This guide will get you up and running with multi-scrobbler using [Docker](https://www.docker.com/) and [`docker compose`](https://docs.docker.com/compose/). At the end of the guide you will have:

* the dashboard served on port `9078` of a host machine which has an IP of `192.168.0.100`
* data saved to the same directory as the `docker-compose.yml` file
* multi-scrobbler monitoring [Spotify](./configuration/configuration.mdx#spotify) and/or [Jellyfin](./configuration/configuration.mdx#jellyfin) for listening activity
* multi-scrobbler scrobbling to [Lastfm](./configuration/configuration.mdx#lastfm) and/or [Maloja](./configuration/configuration.mdx#maloja)

:::note

If the multi-scrobbler container is on the same machine you will be viewing the dashboard from (IE `localhost`) you can remove and ignore `BASE_URL` usage below. Additionally, replace usage of `192.168.0.100` with `localhost`.

:::

## Create Docker Compose File

Create a new folder for multi-scrobbler related data and then create `docker-compose.yml` with this content:

```yaml title="~/msData/docker-compose.yml"
services:
multi-scrobbler:
image: foxxmd/multi-scrobbler
container_name: multi-scrobbler
environment:
- TZ=Etc/GMT # Specify timezone from TZ Database name found here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- BASE_URL="http://192.168.0.100:9078"
# all Environmental Variables in below examples go here!

volumes:
- "$PWD/config:/config"
ports:
- "9078:9078"
restart: unless-stopped
```
## Setup Sources
**Sources** are the services multi-scrobbler monitors to look for listening activity.
<Tabs>
<TabItem value="jellyfin" label="Jellyfin">
Follow the Jellyfin configuration [instructions for setting up a **webhook**.](./configuration/configuration.mdx#jellyfin)
After webhook is setup add **at least one** of these values to the `environment` section in the [`docker-compose.yml` you created.](#create-docker-compose-file)

```yaml title="~/msData/docker-compose.yml"
- JELLYFIN_USER=myUserName # comma-separated list of users to monitor
- JELLYFIN_SERVER=myServerName # comma-separated list of servers that should be monitored
```
</TabItem>
<TabItem value="spotify" label="Spotify">
To access your Spotify activity you must [register a Spotify application](https://developer.spotify.com/dashboard) to get a
**Client ID/Secret**.

When creating the application add this to **Redirect URIs**

```
http://192.168.0.100:9078/callback
```

After the application is created add these values to the `environment` section in the [`docker-compose.yml` you created.](#create-docker-compose-file)

```yaml title="~/msData/docker-compose.yml"
- SPOTIFY_CLIENT_ID=yourClientId
- SPOTIFY_CLIENT_SECRET=yourClientSecret
```
Later, after [starting multi-scrobbler](#start-multi-scrobbler), visit the dashboard at `http://192.168.0.100:9078` and click **(Re)authenticate** on the Spotify card to authorize multi-scrobbler to use your account. Monitoring will begin automatically after authorization is complete.
</TabItem>
</Tabs>

## Setup Clients

**Clients** are services that store scrobbles. Multi-scrobbler will scrobble all listening activity from the **Sources** you configured to all **Clients** you configure here.

<Tabs>
<TabItem value="maloja" label="Maloja">
Setup a [Maloja server](https://github.com/krateng/maloja?tab=readme-ov-file#how-to-install) if you have not already done this.

<details>

<summary>Maloja Setup Intructions</summary>

Using Maloja's example `docker-compose.yml`:

```yaml reference title="~/malojaData/docker-compose.yml"
https://github.com/krateng/maloja/blob/master/example-compose.yml
```

Uncomment `environment` and add `MALOJA_FORCE_PASSWORD=CHANGE_ME` to set an admin password

Start the container:

```shell title="~/malojaData"
docker compose up -d
```
</details>

* Navigate to the Admin Panel (Cog in upper-right corner) -> API Keys (or at http://192.168.0.100:42010/admin_apikeys)
* Create a **New Key** and then copy the generated key value

Finally, add these values to the `environment` section in the [`docker-compose.yml` you created for multi-scrobbler earlier.](#create-docker-compose-file)

```yaml title="~/msData/docker-compose.yml"
- MALOJA_URL="http://192.168.0.100:42010"
- MALOJA_API_KEY=myApiKey
```
</TabItem>
<TabItem value="lastfm" label="Last.fm">
[Register for an API account at Last.fm.](https://www.last.fm/api/account/create)

Use the following for **Callback URL**:

```
http://192.168.0.100:9078/lastfm/callback
```

After account creation use the displayed information and add these values to the `environment` section in the [`docker-compose.yml` you created for multi-scrobbler earlier.](#create-docker-compose-file)

```yaml title="~/msData/docker-compose.yml"
- LASTFM_API_KEY=myApiKey
- LASTFM_SECRET=myApiSecret
```
</TabItem>
</Tabs>
## Start Multi-Scrobbler
:::tip
If you are running your multi-scrobbler container on a Linux host see [these instructions for setting proper file permissions.](./installation/installation.mdx#linux-host)
:::
From the same directory as the [`docker-compose.yml` you created earlier](#create-docker-compose-file) start the container:

```shell title="~/msData"
docker compose up -d
```

You're done! Multi-scrobbler is now running. It will monitor the sources you configured and scrobble to clients you set up.

Visit `http://192.168.0.100:9078` to see the dashboard where

* configured Sources/Clients
* show current status and authentication options
* display statistics about discovered/scrobbled tracks and Now Playing status
* a real-time log shows multi-scrobbler's activity

## Next Steps

* See more advanced docker options as well as other install methods in the [**Installation**](./installation/installation.mdx#docker) docs
* Review the [**Configuration**](./configuration/configuration.mdx) docs
* Learn about how to configure multi-scrobbler using files for more complicated Source/Client scenarios
* See all available Sources/Clients alongside configuration examples
* Learn how to set up [notification webhooks](./configuration/configuration.mdx#webhook-configurations)
* Check out the [kitchensink example](./configuration/kitchensink.md)
* Consult the [**FAQ**](./FAQ.md) for solutions to common problems
9 changes: 8 additions & 1 deletion docsite/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const config: Config = {
// ```
},
],
'docusaurus-theme-github-codeblock'
],
plugins: [
],
Expand Down Expand Up @@ -155,13 +156,19 @@ const config: Config = {
prism: {
theme: themes.themes.github,
darkTheme: themes.themes.dracula,
additionalLanguages: ['json','json5','typescript']
additionalLanguages: ['json','json5','typescript', 'docker', 'bash', 'ini']
},
colorMode: {
defaultMode: 'dark',
disableSwitch: false,
respectPrefersColorScheme: false,
},
codeblock: {
showGithubLink: true,
githubLinkLabel: 'View on GitHub',
showRunmeLink: false,
runmeLinkLabel: 'Checkout via Runme'
}
} satisfies Preset.ThemeConfig,
};

Expand Down
9 changes: 9 additions & 0 deletions docsite/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docsite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"docusaurus-json-schema-plugin": "^1.12.1",
"docusaurus-theme-github-codeblock": "^2.0.2",
"micromark-extension-directive": "^3.0.1",
"prism-react-renderer": "^2.3.0",
"raw-loader": "^4.0.2",
Expand Down
6 changes: 6 additions & 0 deletions docsite/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ A javascript app to scrobble music you listened to, to [Maloja](https://github.c
* Easy configuration through ENVs or JSON
* Install using [Docker images for x86/ARM](docs/installation#docker), [flatpak](docs/installation#flatpak), or [locally with NodeJS](docs/installation#nodejs)

[**Quick Start Guide**](docs/quickstart)

<img src={require('/img/status-ui.png').default} width="800"/>

**Why should I use this over a browser extension and/or mobile app scrobbler?**
Expand Down Expand Up @@ -76,6 +78,10 @@ Client configurations consist of:
* A friendly name.
* Any data needed to communicate or authenticate with the Client.

## Quick Start

[See the **Quick Start Guide**](docs/quickstart.mdx)

## Installation

[See the **Installation** documentation](docs/installation)
Expand Down

0 comments on commit 8b0c720

Please sign in to comment.