The Kosa service for the Pariyatti mobile app.
rbenv
gem install pg -- --with-pg-config=/usr/local/bin/pg_config
If you intend to use the "looped cards" (Pali Word a Day, Daily Words
of the Buddha, or Daily Dohas), you will need access to the private
repository containing the input files (https://github.com/pariyatti/Daily_emails_RSS)
before you can run make txt-clone
, as explained below. Speak to Pariyatti Staff to
obtain access. If you do not have access to these files, Kosa will still run
without them.
Please ensure that you have docker and docker-compose installed on your machine. If you have a windows or macOS machine, Docker Desktop would be recommended on a personal device.
The command to get run the server running locally:
docker-compose up -d
rbenv
git clone git@github.com:pariyatti/kosa2.git
cd kosa2
rake db:drop # If you have a previous version in dev
rake db:create db:migrate # Setup DB
rake kosa:txt:clean # Remove TXT files
rake kosa:txt:clone # Clone TXT files from GitHub
rake kosa:txt:ingest # Ingest TXT files
rails s # -b 0.0.0.0 is not required anymore
# ... see `puma.rb` and `development.rb`
You may wish to prefix rake
and rails
commands with bundle exec
.
First deployment:
rake db:create db:migrate
rake kosa:txt:clean kosa:txt:clone kosa:txt:ingest
# If retroactive looped cards are required:
MONTHS=6 rake kosa:looped:publish
Subsequent deployments:
rake db:migrate
Date
and DateTime
classes exclusively.
Although Time
is capable of representing BCE dates, Kosa does not care about timezones or leap seconds,
since every time value is stored in UTC. Timezones are only used in clients.
DateTime
provides a saner approach to calendars than seconds from epoch.
See SO discussion.Optional / Future
geared_pagination
vs pagy