https://github.com/zefer/mothership
A music player interface
https://github.com/zefer/mothership
angular go mpd websockets
Last synced: 11 months ago
JSON representation
A music player interface
- Host: GitHub
- URL: https://github.com/zefer/mothership
- Owner: zefer
- License: mit
- Created: 2014-09-08T09:50:53.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-11-12T08:22:19.000Z (over 1 year ago)
- Last Synced: 2025-04-06T17:11:21.612Z (12 months ago)
- Topics: angular, go, mpd, websockets
- Language: Go
- Homepage:
- Size: 1.26 MB
- Stars: 25
- Watchers: 4
- Forks: 3
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mothership
[](https://circleci.com/gh/zefer/mothership)
Mothership is a music player interface for [MPD][mpd],
optimised for browsing your music collection in its original directory
structure.
Mothership is built with Go, AngularJS & WebSockets providing a snappy,
real-time user experience. All connected clients keep the UI in sync with the
player state.
Mothership is cross-platform & extremely portable, building to a single,
self-contained binary with no external dependencies other than an [MPD][mpd]
server to point it to.

## Build
To build the Mothership binary, install the [development
prerequisites](#development-prerequisites), then:
```
(cd frontend && grunt build)
go-bindata frontend.go -prefix "frontend/dist/" frontend/dist/...
go build
```
Cross-compilation is achieved by modifying the `go build` command. For example:
* Build for a Raspberry Pi 2: `GOOS=linux GOARM=7 GOARCH=arm go build`
* Build for a Raspberry Pi 1: `GOOS=linux GOARM=6 GOARCH=arm go build`
* Build for linux/386: `GOOS=linux GOARCH=386 go build`
* Build for darwin/386: `GOOS=darwin GOARCH=386 go build`
* Build for windows/386: `GOOS=windows GOARCH=386 go build`
## Run
Firstly, [build Mothership](#build), then:
```
mothership -mpdaddr=music:6600 -port :8080
open localhost:8080
```
Modify `-mpdaddr` to point to the host:port (or ip:port) of your running MPD
server.
## Deploy
Deployment is simple, transfer the binary & run it. A complete example is
provided below:
* [Example server configuration](https://github.com/zefer/ansible/tree/master/roles/mothership)
(using Ansible)
* [Example deploy script](bin/deploy)
## Develop
While developing, the assets are not packaged into a binary, this allows us to
make front-end changes without rebuilding the back-end.
Install the [development prerequisites](#development-prerequisites), then:
```
(cd frontend && grunt)
go build && mothership -mpdaddr=music:6600 -port :8080
open localhost:8080
```
`grunt` watches for changes and runs all front-end tests.
`go test ./...` runs all the back-end tests, or run a single package with a
command like `(cd handlers && go test)`.
## Development prerequisites
* [Go][go]
* [Node.js][nodejs] & npm
* `go get github.com/jteeuwen/go-bindata/...`
* `(cd frontend && npm install)`
## Extras
* Add an LCD with [Flashlight][flashlight]
* Build a multi-room audio system with Raspberry Pis, [MPD][mpd] &
[PulseAudio][pulseaudio]:
* [Server](https://github.com/zefer/ansible/blob/master/music_server.yml)
* [Clients](https://github.com/zefer/ansible/blob/master/music_client_pulse.yml)
## License
This project uses the MIT License. See [LICENSE](LICENSE).
[MPD]: http://www.musicpd.org/
[go]: https://golang.org/
[nodejs]: https://nodejs.org/
[pulseaudio]: http://www.freedesktop.org/wiki/Software/PulseAudio/
[flashlight]: https://github.com/zefer/flashlight