2024-02-28 07:34:42 -05:00
# Web Interface
2022-03-20 05:12:16 -04:00
2024-03-11 20:36:30 -04:00
The web interface is a mobile-friendly music player and browser for OwnTone.
2022-03-20 05:12:16 -04:00
2024-03-11 20:36:30 -04:00
You can reach it at [http://owntone.local:3689 ](http://owntone.local:3689 )
or depending on the OwnTone installation at `http://<server-address>:<port>` .
2022-03-20 07:00:31 -04:00
2024-03-11 20:36:30 -04:00
This interface becomes useful when you need to control playback, trigger
manual library rescans, pair with remotes, select speakers, grant access to
Spotify, and for many other operations.
2022-03-20 07:00:31 -04:00
2022-03-20 05:12:16 -04:00
## Screenshots
2024-03-11 20:36:30 -04:00
Below you have a selection of screenshots that shows different part of the
interface.
2022-03-20 07:00:31 -04:00
![Now playing ](../assets/images/screenshot-now-playing.png ){: class="zoom" }
![Queue ](../assets/images/screenshot-queue.png ){: class="zoom" }
![Music browse ](../assets/images/screenshot-music-browse.png ){: class="zoom" }
![Music artists ](../assets/images/screenshot-music-artists.png ){: class="zoom" }
![Music artist ](../assets/images/screenshot-music-artist.png ){: class="zoom" }
![Music albums ](../assets/images/screenshot-music-albums.png ){: class="zoom" }
![Music albums options ](../assets/images/screenshot-music-albums-options.png ){: class="zoom" }
![Music album ](../assets/images/screenshot-music-album.png ){: class="zoom" }
2024-02-28 07:34:42 -05:00
![Spotify ](../assets/images/screenshot-music-spotify.png ){: class="zoom" }
2022-03-20 07:00:31 -04:00
![Audiobooks authors ](../assets/images/screenshot-audiobooks-authors.png ){: class="zoom" }
![Audiobooks ](../assets/images/screenshot-audiobooks-books.png ){: class="zoom" }
![Podcasts ](../assets/images/screenshot-podcasts.png ){: class="zoom" }
![Podcast ](../assets/images/screenshot-podcast.png ){: class="zoom" }
![Files ](../assets/images/screenshot-files.png ){: class="zoom" }
![Search ](../assets/images/screenshot-search.png ){: class="zoom" }
![Menu ](../assets/images/screenshot-menu.png ){: class="zoom" }
![Outputs ](../assets/images/screenshot-outputs.png ){: class="zoom" }
2022-03-20 05:12:16 -04:00
## Usage
2024-03-11 20:36:30 -04:00
The web interface is usually reachable at [http://owntone.local:3689 ](http://owntone.local:3689 ).
But depending on the setup of OwnTone you might need to adjust the server name
and port of the server accordingly `http://<server-name>:<port>` .
## Building and Serving
2022-03-20 05:12:16 -04:00
2024-03-11 20:36:30 -04:00
The web interface is built with [Vite ](https://vitejs.dev/ ) and [Bulma ](http://bulma.io ).
2022-03-20 05:12:16 -04:00
2024-03-11 20:36:30 -04:00
Its source code is located in the `web-src` folder and therefore all `npm`
commands must be run under this folder.
2022-03-20 05:12:16 -04:00
2024-03-11 20:36:30 -04:00
To switch to this folder, run the command hereafter.
```shell
2022-03-20 05:12:16 -04:00
cd web-src
```
2024-03-11 20:36:30 -04:00
### Dependencies Installation
First of all, the dependencies to libraries must be installed with the command
below.
2022-03-20 05:12:16 -04:00
2024-03-11 20:36:30 -04:00
```shell
2022-03-20 05:12:16 -04:00
npm install
2024-03-11 20:36:30 -04:00
```
2022-03-20 05:12:16 -04:00
2024-03-11 20:36:30 -04:00
Once the libraries installed, you can either [build ](#source-code-building ),
[format ](#source-code-formatting ), and [lint ](#source-code-linting ) the source
code, or [serve ](#serving ) the web interface locally.
### Source Code Building
2022-03-20 05:12:16 -04:00
2024-03-11 20:36:30 -04:00
The following command builds the web interface for production with minification
and stores it under the folder `../htdocs` .
2022-03-20 05:12:16 -04:00
2024-03-11 20:36:30 -04:00
```shell
2022-03-20 05:12:16 -04:00
npm run build
2024-03-11 20:36:30 -04:00
```
### Source Code Formatting
The source code follows certain formatting conventions for maintainability and
readability. To ensure that the source code follows these conventions,
[Prettier ](https://prettier.io/ ) is used.
2022-03-20 05:12:16 -04:00
2024-03-11 20:36:30 -04:00
The command below applies formatting conventions to the source code based on a
preset configuration. Note that a additional configuration is made in the file
`.prettierrc.json` .
```shell
2022-03-20 05:12:16 -04:00
npm run format
2024-03-11 20:36:30 -04:00
```
### Source Code Linting
2022-03-20 05:12:16 -04:00
2024-03-11 20:36:30 -04:00
In order to flag programming errors, bugs, stylistic errors and suspicious
constructs in the source code, [ESLint ](https://eslint.org ) is used.
Note that ESLint has been configured following this [guide ](https://vueschool.io/articles/vuejs-tutorials/eslint-and-prettier-with-vite-and-vue-js-3/ ).
The following command lints the source code and fixes all automatically fixable
errors.
```shell
2022-03-20 05:12:16 -04:00
npm run lint
```
2024-03-11 20:36:30 -04:00
### Serving
In order to serve locally the web interface, the following command can be run.
```shell
npm run serve
```
2022-03-20 05:12:16 -04:00
After running `npm run serve` the web interface is reachable at [localhost:3000 ](http://localhost:3000 ).
2024-03-11 20:36:30 -04:00
By default the above command expects the OwnTone server to be running at
[localhost:3689 ](http://localhost:3689 ) and proxies API calls to this location.
If the server is running at a different location you have to set the
environment variable `VITE_OWNTONE_URL` , like in the example below.
```shell
export VITE_OWNTONE_URL=http://owntone.local:3689
npm run serve
```