/sheethub

Community Marketplace for Musicians

Primary LanguageRuby

sheethub

Join the chat at https://gitter.im/Leventhan/sheethub

SheetHub

SheetHub lets you easily publish, share, and sell sheet music.

Your files are securely hosted on SheetHub so you don't need to worry about building a website or storing files anywhere. SheetHub handles payments, sales, emails, and distribution. You'll also get your very own personal portfolio and subdomain! You are paid directly and instantly the moment you make a sale.

SheetHub handles all the technical complexities behind hosting and selling your sheet music online, so you can focus on pursuing your music.

I've been looking for a decent community/marketplace for sheet music and have been disappointed so far, so I decided to try my hand at building one. Thus, SheetHub was born.

SheetHub is open source since 7 June 2015. It's been a one-man show up to this point, so mind some unnecessary complexity! Contributions are most welcome!

System Requirements

You'll need the following installed on your machine:

  • elasticsearch
  • libpng
  • libjpeg
  • imagemagick

For each of the above, do:

brew install <requirement>

You also need the following running:

  • elasticsearch
  • postgres

Additionally, you need to populate development environment secrets.yml attributes before you can run the project on development. This means you'll have to register a number of external services, such as AWS S3 and PayPal Sandbox when running locally as well as redis and memcached when running on a staging server.

For Facebook and Google Authentication to work, you'll need to create apps/setup oauth for both services.

asset_hash_secret, sheet_hash_secret can be any long hash string, the longer and harder to quess, the more secure. For secret_key_base, use the following command to generate a secret to use:

rake secret

I recommend using secrets generated this way for all secret attributes.

Learn more here.

Message me if you need help!

Getting Started

Fork the project, and do a git clone from your fork.

bundle install
rake db:migrate
rails s

Application Overview

SheetHub is built on Rails 4.2 and uses Ruby 2.2.0.

The latest entity-relationship diagram for all the model objects can be viewed here. You can update the erd.pdf file based on the current schema using the following command:

bundle exec erd

Current features include:

API

SheetHub provides a read-only JSON API for all public sheets. You can view the endpoints via this Postman collection. Note that you need an API Key to access the API. On development, create an new ApiKey object and use the token generated. The SheetHub API uses HTTP Token authentication. On production, message me and I'll give you an API Key.

Both on development and production, use Postman to play around with the endpoints. The collection above comes with all the following available endpoints:

  • POST /v1/sheets/search
  • GET v1/sheets
  • GET v1/sheets/:id
  • GET v1/users
  • GET v1/users/:id

Postman is a powerful API testing suite which has become a must-have tool for many developers.

The SheetHub API provides pagination support.

/sheets?page=<page_number>

The API is namespaced to an api subdomain like so:

http://api.sheethub.co/v1/sheets

You can use the API to build applications that interact with SheetHub's user-curated database of sheet music and musicians. Admittedly, the available data you can currently pull from the API is still sparse.

Subdomain Configuration

Since SheetHub uses subdomains extensively for user profile pages (such as edwinsungmusic.sheethub.co), you won't be able to use localhost for local development. Instead, you must use lvh.me. Read this for more details.

Disclaimer

This is a hobby project. I'm not doing this to get rich and retire early. Having said that, I'd appreciate it if you don't outright clone SheetHub and host it elsewhere for commercial purposes. Contributions and Pull Requests are most welcome.

Contributing

Please also read CONTRIBUTING.md for more details on how to become a great contributor.

Here are some ideas you can work on:

  • Audio Player on sheet pages
  • Organize composition competitions
  • Crowdfunding
  • Allow Arrangement licensing of original pieces on SheetHub. Users can submit arrangements of original pieces on SheetHub and sell it, sharing payments back with the original author
  • jobs.sheethub.co
  • Use background jobs with Active Job + Sidekiq
  • Missing unit tests
  • Performance optimizations
  • Fix typos
  • Your idea here!

Initiate idea discussions by creating a Github issue!

We use Github Flow, a lightweight, branch-based workflow. Create feature branches and your pull requests will be reviewed!