2015-10-25 07:20:56 +01:00
[![Pony.fm Logo ](https://pony.fm/images/ponyfm-logo.svg )](https://pony.fm/)
2015-10-25 06:17:45 +01:00
The community for pony fan music.
For artists, Pony.fm features unlimited uploads and downloads, automatic
transcoding to a number of audio formats, and synchronized tags in all
downloads.
For listeners, Pony.fm offers unlimited streaming and downloading, user-generated
playlists, favourite lists, and a way of discovering new music with pony-based
taxonomies.
Contributing
------------
2015-11-16 13:20:15 +01:00
If you've run across a bug or have a feature request,
[open an issue ](https://github.com/Poniverse/Pony.fm/issues/new )
for it.
For general questions and discussions about the site, stop by at
the [Pony.fm forum ](https://mlpforums.com/forum/62-ponyfm/ ).
2015-10-25 06:17:45 +01:00
For quick fixes, go ahead and submit a pull request!
2015-11-16 13:20:15 +01:00
For larger features, it's best to open an issue before sinking a ton of work
2015-10-25 06:17:45 +01:00
into building them, to coordinate with Pony.fm's maintainers.
2016-05-27 21:12:40 +02:00
Developer documentation is available in the [`documentation` directory ](documentation ).
2015-11-16 13:20:15 +01:00
**Protip:** Looking for a place to jump in and start coding? Try a
[quickwin issue ](https://github.com/Poniverse/Pony.fm/labels/quickwin%21 ) -
these are smaller in scope and easier to tackle if you're unfamiliar with the codebase!
2015-10-25 06:17:45 +01:00
2015-11-16 13:20:15 +01:00
Starting a dev environment
==========================
2015-09-24 19:43:12 +02:00
2016-01-13 07:45:23 +01:00
To begin development, do the following:
2013-07-25 23:33:04 +02:00
2016-01-13 07:45:23 +01:00
1. Install [Vagrant ](https://www.vagrantup.com/downloads.html ) and
[VirtualBox ](https://www.virtualbox.org/wiki/Downloads ) if you don't have them already.
2015-05-02 11:48:57 +02:00
2016-01-13 07:45:23 +01:00
2. Install the `vagrant-hostmanager` plugin: `vagrant plugin install vagrant-hostmanager`
2015-06-14 14:55:29 +02:00
2016-01-13 07:45:23 +01:00
3. Install the `vagrant-bindfs` plugin: `vagrant plugin install vagrant-bindfs`
2013-07-25 23:33:04 +02:00
2016-02-03 03:39:09 +01:00
4. Run `vagrant up` from the folder in which you cloned the repository
2015-04-23 11:17:05 +02:00
2016-02-03 03:39:09 +01:00
5. Run `vagrant ssh` , `cd /vagrant` , and `php artisan poni:setup` .
2015-09-24 19:43:12 +02:00
2016-02-03 03:39:09 +01:00
6. Follow the instructions in the "Asset pipeline" section below to set that up.
2015-09-24 19:43:12 +02:00
2016-12-10 17:51:04 +01:00
Once everything is up and running, you'll be able to access the site at [http://ponyfm-dev.poni/ ](http://ponyfm-dev.poni/ ). You can access the PostgreSQL database by logging into **ponyfm-dev.poni:5432** with the username **homestead** and the password **secret** . Pony.fm's database is named **homestead** .
2015-04-23 11:17:05 +02:00
2015-11-16 13:20:15 +01:00
Asset pipeline
--------------
2015-09-24 19:43:12 +02:00
Pony.fm uses [gulp ](http://gulpjs.com/ ) to mange its asset pipeline.
2021-01-02 07:29:36 +01:00
**In macOS**, you must have XCode Command Line Tools installed. This may be downloaded at [https://developer.apple.com/download/more/?=command%20line%20tools ](https://developer.apple.com/download/more/?=command%20line%20tools )
2015-09-24 19:43:12 +02:00
**Important:** Run `npm` and `gulp` from your host machine and not within the VM. You must first have it installed globally:
npm install -g gulp
2015-04-23 11:17:05 +02:00
2015-09-13 02:38:15 +02:00
And then install all of the required local packages by invoking:
2015-09-24 19:43:12 +02:00
npm install
2015-06-15 15:34:24 +02:00
2016-02-14 18:32:25 +01:00
Finally, to compile and serve the assets in real time, run the following (and leave it running while you develop):
2015-04-23 11:17:05 +02:00
2015-09-24 19:43:12 +02:00
gulp watch
2016-12-26 01:53:16 +01:00
2016-12-26 16:50:13 +01:00
### Developing email templates
2016-12-26 01:53:16 +01:00
Pony.fm's email templates are based on the Sass version of
2016-12-26 16:50:13 +01:00
[ZURB's Foundation for Emails ](http://foundation.zurb.com/emails/docs/index.html )
framework, including their "Inky" markup language. This tooling takes the pain
out of HTML email markup - see their site for the full documentation.
2016-12-26 01:53:16 +01:00
2016-12-26 16:50:13 +01:00
Email templates live in two directories:
- [`resources/emails/src` ](resources/emails/src ), for HTML emails
- [`resources/views/emails/plaintext` ](resources/views/emails/plaintext ), for plaintext emails
**Be aware that plaintext emails are vanilla Blade templates!** Foundation is only used for HTML emails.
HTML emails are marked up as Handlebars templates which compile into Blade templates -
2016-12-26 01:53:16 +01:00
Pony.fm's asset pipeline automatically does this for you. Variables meant for
Blade need to be escaped with a backslash in the `.hbs` files (like so: `\{{ $myVariableName }}` ).
2016-12-26 16:50:13 +01:00
During development, email templates will also be written to `public/build/emails`
to save you from resending emails to see how they look. For example, if you're
working on the "new track notification" template, you'll be able to view it in your browser at
[http://ponyfm-dev.poni/build/emails/notifications/new-track.blade.php.html ](http://ponyfm-dev.poni/build/emails/notifications/new-track.blade.php.html ).
2016-12-26 01:53:16 +01:00
2015-11-16 13:20:15 +01:00
Configuring the servers
-----------------------
2015-09-13 02:38:15 +02:00
2016-12-10 17:51:04 +01:00
Pony.fm uses nginx, php-fpm, redis, and PostgreSQL. You can modify the configuration of these services by locating the appropriate config file in the `vagrant` folder. Once modified, you must reload the configuration by running the appropriate shell script (`reload-config.sh`) or bat files (`reload-config.bat` and `reload-config.vmware.bat` ). These scripts simply tell Vagrant to run `copy-and-restart-config.sh` on the VM.
2015-09-24 19:43:12 +02:00
If you need to change any other configuration file on the VM - copy the entire file over into the vagrant folder, make your changes, and update the `copy-and-restart-config.sh` script to copy the modified config back into the proper folder. All potential configuration requirements should be represented in the `vagrant` folder **and never only on the VM itself** as changes will not be preserved.