autotelik / yams_core

Rails Engine for creating music streaming services, band pages or record stores

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yet Another Music Service - Core Engine

Open source Rails Engine. Install in a host Rails app.

For creating music streaming services, band pages or record stores

Installation

In your host Rails app, first add gem 'yams_core' to your Gemfile

gem 'yams_core'

Then mount the engine to a location of your choice in your app's config/routes.rb file.

   mount YamsCore::Engine, at: "/"

Copy over relevant files

bin/rails yams_core:install:migrations

Docker needs the context to be the App so for now seems we have to copy over the engine's Compose file and Copy over Dockerfile to root of App - i.e containers have to be built from . in the App context not the engine Context

#TODO make part of the installer

cp /yams_core/docker/docker-compose.yml /mpApp/docker-compose.yml
cp /yams_core/docker/Dockerfile /mpApp/Dockerfile

Manual

Clone from github

This application requires:

A host Rails app

These are already bundled as services, configured to inter operate, in our docker compose setup.

Elastic search will be available at : http://localhost:9200

Kibana will be available at : http://localhost:5601

To manually install Redis locally see : https://redis.io/topics/quickstart

To start them locally, run from the root of the application:

redis-server

bundle exec sidekiq

Some mp3 processing currently requires ffmpeg

For Ubuntu

sudo apt install ffmpeg

File uploads require imagemagick

For Ubuntu

sudo apt-get install imagemagick

In your cloned project, install the gems

bundle install

Docker

A Dockerfile and docker-compose file are provided to simplify installation.

The complete stack, for development, can be spun up with a single thor command :

bundle exec thor yams:docker:dev:up

Elastic Search container may exit first time, with log containing :

ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

RESOLUTION : Run : sudo sysctl -w vm.max_map_count=262144

You can open a bash sh in the container and jump to seed the DB section.

 docker exec -ti development bash

Elastic search will be available at : http://localhost:9200

Kibana will be available at : http://localhost:5601

Sidekick configuration, including list of queues to start can found here : docker/config/sidekiq.yml

DB Setup

We use .env to manage configuration, including DB access.

Copy .env.example to .env and edit, supplying your DB credentials. Current config is setup to use postgres.

rake db:create
rake db:migrate

Seed the DB

The admin user is created via db:seed task with password specified in .env

In development seed will also create an artist User

email: 'artist@example.com' password: 'artist_change_me'

rake db:seed
  • Login

  • Change admin password !

Loading Sample Audio Data

Example data can be bulked uploaded from Excel spreadsheet containing details of tracks and covers.

There is a starter pack of my music and images available Free, click the Download button, from this link :

Save the contents to /tmp - which is the path hardcoded in the loading spreadsheet : db/seed/aqwan_tracks.xls

The development artist user is assigned by default in the spreadsheet, so edit this to assign tracks to a different user.

Run

thor yams:db:seed_music

This is essentially a wrapper around an Excel import tool for Rails. If you want to load your own, the raw command would be :

thor datashift:import:excel -i  db/seed/aqwan_tracks.xls -m Track -c lib/tasks/config/track_import.yaml 

Development

If hosting your own YAMS, you probably first want to change the front_page and about pages.

These can be found under : app/views/pages

We use mailcatcher but is not present inr Gemfile since it will conflict with your applications gems at some point.

Simply run gem install mailcatcher then mailcatcher to get started.

Documentation and Support

The app and associated applications can be spun up via Docker

Similar Projects

Contributing

If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.

Credits

License

@copyright thomas statter @ autotelik

open source

About

Rails Engine for creating music streaming services, band pages or record stores

License:MIT License


Languages

Language:Ruby 65.4%Language:HTML 32.0%Language:JavaScript 2.4%Language:CSS 0.3%