Giter Club home page Giter Club logo

robin's Introduction

Robin

Spotify controls in Elm

Spotify controls playing Kate Bush

An example deployment can be found at jovial-carson-5f0011.netlify.com.

Robin was written as an exercise to learn more about Elm and integrating with external services. It uses the Spotify API to control the user's currently active Spotify player, be that on their laptop, phone, Chromecast etc. This is done with the Elm HTTP library and the standard JSON decoders. Users can sign in with a Google account to claim a "channel" that they control and any other user can listen to.

The channels are backed by Firebase's Cloud Firestore acting as both persistence and a simple broadcasting message service. This was a opportunity to use Elm ports to communicate with the Firebase JS running outside the Elm runtime. Without the guarantees of the Elm type system this bit of code became the most brittle. It follows the "Outside Info" pattern described by Murphy Randle in his 2017 elm-conf talk.

Setup

To run this project you require Spotify and Firebase API keys, they should be setup in env vars as follows:

ELM_APP_SPOTIFY_CLIENT_ID=
ELM_APP_SITE_URI=http://localhost:3000
ELM_APP_FIREBASE_API_KEY=
ELM_APP_FIREBASE_AUTH_DOMAIN=
ELM_APP_FIREBASE_PROJECT_ID=

Once the environment is set and Elm is installed you can install dependencies with:

elm-app install

And start the app with:

elm-app start

robin's People

Contributors

northerner avatar

Stargazers

 avatar Kofi Gumbs avatar Roman Frołow avatar Farzad Yousefzadeh avatar  avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.