This README documents which steps are necessary to get this application called "YAVA: Yet Another Vegan App" up and running.
You only need a few packages, which should normally ship with your preferred distribution.
In this case, full support is only given for ArchLinux and we assume, that the operating system is already up and running.
This will explain the setup of the database, in this case PostgreSQL, the website, here Ruby on Rails and a mobile App, where we will use PhoneGap.
Please install these dependencies first:
- Ruby >= 2.0.0
- Node.js >= 0.10.17
- PostgreSQL >= 9.2.4
Next, we will setup a new user, to secure the system a litte bit:
# useradd ror -d /path/to/yava # passwd ror # su ror
Then we will clone yava:
git clone email@example.com:tohn/yava.git
And add the following two lines to the
export PATH="/path/to/yava/.gem/ruby/2.0.0/bin:$PATH" export RAILS_ENV=production
and load them via:
After installation of the package, you can create an user. First, become the postgres user:
sudo -i -u postgres
Create a new user, in this case
createuser -s -U ror
Leave this user again with
exit and create a new database with
the normal ror-user:
Since you have (hopefully) already downloaded this project with git or something else, you can install all stuff necessary to run the website with just two commands:
gem install bundle bundle install
Next we have to set some config variables:
echo "Yava::Application.config.secret_key_base = '" > config/initializers/secret_token.rb rake secret >> config/initializers/secret_token.rb echo "'" >> config/initializers/secret_token.rb
Afterwards, change the file
There you can set some settings like mail addresses and authentication
for them and choose between Omniauth providers like Google (you have to
create an app first) or Htaccess.
In case of Omniauth, there are no further steps required (except for adding the key and secret for each provider in the above file).
In case of Htaccess, change
in this file and uncomment this line in
This will use Htaccess and the default user (in
For the database, you have to edit
and change all occurences of username to your username, i.e. ror.
config/environments/production.rb and change
the mail settings at the end of the file.
Then precompile the assets:
rails generate jquery:install rake assets:precompile
Next, create the database, migrate the migrations in
db/migrations and initialize the database with the data
rake db:create db:migrate db:seed
And finally, start the server:
If you want to use another language than the default one (german), you have to change the following files:
config/locales/simple_form.de.yml and adjust them.
To send mails, you have to change the settings in
config/environments/production.rb. You can also choose a
mail host without authentication, then uncomment the
delivery_options lines in
app/mailers/yava_mailer.rb and set at least
If you have a mailserver installed and running, you can use it to receive mails and save them automatically in the database. This is useful for ingoing responses from the manufacturers.
You can pipe the mails like this:
cat testmail | /path/to/yava/bin/rails runner "YavaMailer.receive(STDIN.read)"
To provide up to date veganities and a daily dump of your database, you can set up a cronjob.
# http://stackoverflow.com/questions/285717/a-cron-job-for-rails-best-practices @hourly cd /path/to/yava && RAILS_ENV=production rake veganity:update --silent @daily /path/to/yava/db/dump_postgresql_db.sh
The app can be found here.
You just have to change the URL to get it running with the newly
created website described above, by changing
To generate the documentation for YAVA, run:
yardoc --no-private --protected app/**/*.rb - README.md
If you just want to create this file, run:
yardoc --no-private --protected - README.md
/path/to/yava/doc/index.html in your browser.