Skip to content

MagnusVortex/rainwave

 
 

Repository files navigation

This is the git project for the Rainwave website, http://rainwave.cc.

== Python Setup for Debian/Ubuntu

$ sudo apt-get install python-pip python-psycopg2 python-mutagen python-nose python-imaging python-psutil python-unidecode python-pylibmc python-tornado python-meliae slimit
$ sudo pip install pytz watchdog
$ sudo pip install pyscss=1.2.0

== Python Setup for Windows

1. Download and install Python 2.7 for Windows:
	https://www.python.org/download/
2. Download and install a matching Psycopg2:
	http://www.stickpeople.com/projects/python/win-psycopg/
3. Download and install a matching psutil:
	https://pypi.python.org/pypi?:action=display&name=psutil#downloads
4. Install setuptools:
	https://pypi.python.org/pypi/setuptools#installation-instructions
5. Make sure Python is on your PATH (you can execute python from a terminal)
6. Make sure the Python Scripts directory is also on your PATH
7. On the commandline, execute:
	> easy_install pip
	> pip install tornado mutagen nose pillow pyscss=1.2.0 unidecode pytz watchdog python-memcached

== Getting Started for HTML/CSS/JS Development

$ git clone git@github.com:rmcauley/rainwave.git
$ cp etc/rainwave-dev.conf etc/[your username].conf
$ python rw_api.py

Wait until you see "API server on port 20000 ready to go."  Depending on
your PC, this may take a minute or so.

Then open the beta URL:
   http://localhost:20000/beta/?sid=1

Done!

If you want to emulate being logged in, go to this URL:
   http://localhost:20000/api4/test/login_tuned_in/1

To emulate being anonymous, just close and re-open your browser.

HTML files can be found in /templates.
CSS files are in /static/style4 and compiled using SCSS from _sass.css.
JS files are in /static/js4 and are not minified for beta development.
	- Execution starts from main.js.
	- No libraries or frameworks are used
	- There are some helper functions in element.js and formatting.js
Image files are in /static/images4.

All files are refreshed as you edit them, no need to restart the
server, with the exception of language files.

== Getting Started for Backend Development

$ git clone git@github.com:rmcauley/rainwave.git
$ cp etc/rainwave_reference.conf etc/[your username].conf

Setup PostgreSQL on your system and change your Rainwave config file
to use Postgres instead of SQLite.  The Rainwave Pg role must have the ability
to create tables.  You must also have your own MP3 collection, and change the
song_dirs configuration in your rainwave.conf to point to your collection.
Tags are important!

$ python db_init.py

You may get an error message: "Could not create r4_pref_storage"
This is because you are running Postgres 9.3 or lower.  See the section
later on in the readme regarding the store_prefs option.

Now run:

$ python rw_scanner.py --full

Once done, run the backend (rw_backend.py) and the API (rw_api.py)
at the same time. When you want to trigger a song switch,
use rw_get_next.py.

It shouldn't need saying, but SQLite is not considered supported for
production environments.  The SQLite code in Rainwave takes a lot of
shortcuts and liberties and some corner code cases are just
completely uncovered.  SQLite is only meant for unit testing
and front-end-only web developers.

== Required Modules and Executables in Detail

Required on all systems:
- tornado
- sqlite3
- psycopg2
- mutagen
- nose
- pillow
- psutil
- pyScss=1.2.0
- unidecode
- pytz
- watchdog
- slimit
- meliae (Linux, if enabling memory tracing)
- pylibmc (Linux or cypthon) or python-memcached (Windows or PyPy)

To let Rainwave automatically mp3gain your collection,
you will need to enable it in the configs and also have
the "mp3gain" executable in your path.

== Pylinting

Pylint is run on the project with the following settings:

disable: [
	"W0312", "W0703", "R0904", "R0903", "W0702", "W0602", "W0603",
	"R0915", "W0201", "W5103", "W5101", "W0232", "W0613", "W1401"
]
ignore: [
	"C", "R", "I"
]

== About store_prefs option and Postgres 9.4

The store_prefs option relies on the JSONB field type
introduced in Postgres 9.4.

If you use 9.3 or lower and don't want to use this feature, you are good to go.

If you want to use this feature and:
	- Initialized Rainwave's DB on Pg 9.4 or higher
		- Enable the option
		- You're good to go.
	- Initialized on Pg 9.3 or lower
		- Upgrade to 9.4 first
		- Run migrate/004_pref_storage.py
		- Enable the option
		- You're good to go.

Releases

No releases published

Packages

No packages published

Languages

  • Python 58.9%
  • JavaScript 29.2%
  • CSS 6.5%
  • HTML 3.6%
  • ApacheConf 1.2%
  • Shell 0.6%