Skip to content

joenas/first-deadly-sin

Repository files navigation

the First Deadly Sin*

This is a Sinatra web client for a remote or local MPD, with Faye for syncing between clients. Layout and image fetching is a shameless rip-off of So-nice.

In Ubuntu, this integrates nicely with Fogger. On Mac OS X you can try Fluid.

Thanks to the awesome callbacks of ruby-mpd this app now uses a MPD listener to push changes to all clients. For a version that uses Redis and a stores the artists images locally, checkout branch local_store.

Spotify

You need to create a Spotify application to obtain a Client ID and Client Secret. Spotify is used to fetch artist images, since Last FM removed their support for this.

Usage

# Build the client
(cd client && yarn && yarn build)

# Server #
cd server

# Add your Spotify credentials
cp .env.example .env

# Install gems
bundle install

# Start server
foreman start

# or if you already have Faye running (on port 9292)
bundle exec thin start (-p port)

Docker

To run the server in Docker, use the included docker-compose.yml.

You also need to set FAYE_SERVER_URL=http://faye:9292/faye in .env, because of the internal network.

# Choose whatever name you prefer, edit in docker-compose.yml
docker network create firstdeadlysin
docker-compose build
docker-compose up -d

If you want to build the images and start them yourself, for example if you don't want to keep the source code.

docker build -t first-deadly-sin_web -f Dockerfile.server .
docker build -t first-deadly-sin_faye -f Dockerfile.faye .

Then use as such

version: "3.2"
services:
  web:
    image: first-deadly-sin_web
    env_file:
      - ./.env
    ports:
      - "4000:4000"
    environment:
      PORT: 4000

  faye:
    image: first-deadly-sin_faye
    env_file:
      - ./.env
    ports:
      - "9292:9292"

networks:
  default:
    external:
      name: firstdeadlysin

Development

Start the client

# Client
cd client
yarn
yarn start

Start servers, with Foreman

cd server
foreman start -f Procfile

or separately

# Server
cd server
bundle exec thin start -p 4000
rackup faye.ru -E production

Gotchas

  • Error installing thin on macOS Big Sur - link
  • Use 0.0.0.0 for Faye - link

About

(Faye & Sinatra) MPD web-client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published