wort.schule uses Ruby on Rails as a framework and PostgreSQL as the default database.
git clone https://github.com/wintermeyer/wort.schule
cd wort.schule
.ruby-version
(e.g. use asdf)])brew install vips
on macOS with Homebrew)bin/setup
(der entsprechende User benötigt Superuser Rechte für diesen Schritt)bin/rails db:create db:migrate
(do a bin/rails db:drop
first if you want to delete an already existing database)bin/rails 'word_images:import[db/seeds/word_images]'
to import images associated to wordsbin/dev
The initial data is loaded by a migration, so that the database schema can be adapted without adapting the schema of the initial data.
db:setup
, because that loads the schema without running all migrations.bin/dev
bin/rails spec
config.mailer_sender
in config/initializers/devise.rb
config/environments/production.rb
config/storage.yml
config.action_mailer.default_url_options
in config/environments/production.rb
bin/rails 'word_images:import[db/seeds/word_images]'
(replace argument in []
with directory containing the images)Configure in config/application.rb
whether blank attributes of words should be shown or not:
config.hide_blank_items = true
Restart the Rails server when changing the configuration.
The first administrator needs to be created manually in the Rails console (bin/rails c
):
password = SecureRandom.hex
# Take note of the password
Admin.create(email: 'muster@example.com', password:, password_confirmation: password)
There is a Dockerfile
and an example docker-compose.yml.example
for a production setup of the application within Docker. Note that you should customize the docker-compose.yml
before running it in production.
After installing Docker and docker-compose
, run docker-compose up
in this directory to start the application.
To quickly test the application locally without customizing the docker-compose.yml
, you may run docker-compose -f docker-compose.yml.example up
in this directory.
config/google-tts-credentials.json
app/jobs/tts_job.rb
. This can be triggeredy manually via TtsJob.perform_now(word)
.good_job
gem handles the job. Start via bundle exec good_job
with_tts
flag on the word model, which determines whether an audio attachment for both the word itself and it's example sentences should be generated.log/tts.log
.To process all words, do: Word.where(with_tts: true).each { |w| TtsJob.perform_later(w) }
(or perform_now when there is no job runner).