Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

138 lines (97 sloc) 4.13 kB
Dependencies:
perl 5.12.0 or later
DBIx::Class::Tree::NestedSet from https://github.com/moritz/DBIx-Class-Tree-NestedSet
DBICx::TestDatabase
ISBN::Country from https://github.com/moritz/ISBN-Country
DBD::Pg
Mojolicious
Locales
Crypt::Eksblowfish::Bcrypt
KinoSearch
aliased
Test::Exception
A postgresql database server, and ideally three databases, one each for
development, testing and production.
For example under Debian, you'd install
aptitude install postgresql-8.4 postgresql-client-8.4 postgresql-server-dev-8.4
And then create the databases:
su - postgres
# create a database user:
createuser -S -D -R -P quelology_db
# you will be asked for a password. Enter one and write it down somewhere
# create the actual databases
createdb --encoding UTF-8 --owner quelology_db quelology-dev 'Quelology development database'
createdb --encoding UTF-8 --owner quelology_db quelology-test 'Quelology test database'
createdb --encoding UTF-8 --owner quelology_db quelology-prod 'Quelology production database'
# set them up to support triggers:
createlang -d quelology-dev plpgsql
createlang -d quelology-test plpgsql
createlang -d quelology-prod plpgsql
# stop being user 'postgres':
exit
Create a file called config.json in the quelology source tree root,
with contents like that (and replace <password> with the actual
database password:
{
"web_secret": "<long, random string goes here>",
"dev": {
"dbname": "quelology-dev",
"dbhost": "localhost",
"dbuser": "quelology_db",
"dbpass": "<password>"
},
"test": {
"dbname": "quelology-test",
"dbhost": "localhost",
"dbuser": "quelology_db",
"dbpass": "<password>"
},
"prod": {
"dbname": "quelology-prod",
"dbhost": "localhost",
"dbuser": "quelology_db",
"dbpass": "<password>"
}
}
Set permissions so that no other use can read your passwords:
chmod 600 config.json
Populate the development database with a schema:
psql -h localhost -U quelology_db quelology-dev < schema.sql
With a bit of luck, you should now be able to run
perl web/quelology daemon
And get a response like this:
Mon May 9 09:48:22 2011 info Mojo::Server::Daemon:297 [29749]: Server
listening (http://*:3000)
Server available at http://127.0.0.1:3000.
Now point your web browser to http://127.0.0.1:3000/ and admire a nearly empty
page :-).
Kill the server again by pressing Ctrl+C in the console where you started it.
To avoid having to enter your database passwords whenever you import or export
data (which also happens during automated unit tests), create a file called
.pgpass in your home directory, with contents like this:
localhost:5432:quelology-dev:quelology:<password>
localhost:5432:quelology-test:quelology:<password>
localhost:5432:quelology-prod:quelology:<password>
(without the leading spaces, and again substitute <password> for the actual
database password).
You can import a bunch of data which makes development much more fun:
wget http://moritz.faui2k3.org/tmp/quelology-latest.sql.gz
zcat quelolog-latest.sql.gz | psql -h localhost -U quelology quelolog-dev
Now create the search indexes (currently requires postgres 8.4 or newer):
perl tools/create-ksx-index.pl
And start the web server again:
perl web/quelology daemon
And browse http://127.0.0.1:3000/
Some features of quelology require access to the Amazon advertising API.
This is necessary for the amazon search, and for importing raw publications
from amazon.
To use these features, you must sign up at
https://affiliate-program.amazon.com/ to obtain a "token" and a "secret key".
Add those two strings to the config.json file, with keys "amazon_token"
and "amazon_secret_key".
Some tools in the tools/ directory require additional modules to run.
Most developers don't need those, many concern additional data mining
tasks. Those additional modules are
WebService::Libris
WWW::Wikipedia::Links
Have fun!
Jump to Line
Something went wrong with that request. Please try again.