GithubHelp home page GithubHelp logo

cameronbroe / playlist Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 3.25 MB

An API and front-end ot serve a playlist curated by me

Home Page: https://playlist.cameronbroe.com

License: MIT License

Dockerfile 2.13% Go 48.57% HTML 12.24% CSS 11.57% TypeScript 25.50%

playlist's Introduction

playlist.cameronbroe.com

This repository contains the Go API and React application for consuming my mega-playlist. The motivation behind this application is to act as a place for me to dump tracks I like and easily get cross-service links to share with friends who use different streaming services than I do. It uses iTunes Search to decorate an object consisting of the song title, artist, and album with the Apple Music URL. It then uses Odesli's API to translate those Apple Music URLs into Spotify and YouTube URLs. I have Shortcuts on my devices that allow me to easily submit whatever I am currently listening to the API.

Running the API

The API is built using Go with Go Modules and uses a pure Go port of SQLite for its backing database. This allows the application to be built into purely static binaries that can easily just run wherever a Go toolchain can be installed. I am using a Raspberry Pi 4 to work on this project. There is also a Dockerfile for those who prefer to use Docker.

Go toolchain

Build the API binary:

go build -o build/playlist-api cmd/server.go

And run the API:

build/playlist-api

The database will be created in the current working directory with the name database.sqlite.

There is also support for requiring clients to provide a static API key when submitting. Just pass in the static key through the environment:

API_SECRET=hunter2 build/playlist-api

You can also configure a different location for the database file on the filesystem:

DATABASE_PATH=/path/to/database.sqlite build/playlist-api

Docker

Build the image using the Dockerfile:

docker build -t playlist-api .

And run it with the port forwarded:

docker run --rm -p 8080:8080 playlist-api

Or if you want data to persist, then use a volume mount and specify a custom database path:

docker run --rm -p 8080:8080 -v $(pwd)/dbdata:/dbdata -e DATABASE_PATH=/dbdata/database.sqlite playlist-api

Front-end

The front-end is a basic React app that was bootstrapped with create-react-app. Follow the README.md in the frontend/ folder.

License

This repo is MIT licensed, check the LICENSE file for more information.

playlist's People

Contributors

cameronbroe avatar dependabot[bot] avatar

Watchers

 avatar  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.