Skip to content

zefer/mothership

Folders and files

NameName
Last commit message
Last commit date

Latest commit

32aa26f · Jun 24, 2024
Jun 24, 2024
May 4, 2020
May 4, 2020
May 4, 2020
May 4, 2020
Dec 12, 2015
Dec 13, 2015
Feb 5, 2022
Jul 14, 2017
May 4, 2020
May 4, 2020
May 4, 2020
Mar 27, 2015
Mar 27, 2015

Repository files navigation

Mothership

Build Status

Mothership is a music player interface for 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 server to point it to.

screenshots

Build

To build the Mothership binary, install the 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, 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:

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, 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
  • Node.js & npm
  • go get github.com/jteeuwen/go-bindata/...
  • (cd frontend && npm install)

Extras

License

This project uses the MIT License. See LICENSE.