Coder Social home page Coder Social logo

biblesearch-example-rails's Introduction

Bible Search Example for Rails

  • Build Status: Stable Version
  • Build Status: Development Version

This Ruby on Rails application provides a simple way to create a website people can use to read the Bible in various languages. Use it as is or extend it for your own purpose. We'd love to hear about your enhancements!

A live demo is at http://lite.bibles.org.

This application uses the Bible Search API Gem and Scripture data from Bibles.org.

Quick Start

  1. Install Ruby on Rails.
  2. Get the code: git clone [email protected]:americanbible/biblesearch-example-rails.git.
  3. Enter the directory: cd biblesearch-example-rails.
  4. Grab needed libraries: bundle install.
  5. Run the tests: rake.
  6. Get your own Bible Search API Key.
  7. Create config/application.yml to contain your personal API key (follow the example in config/application.example.yml).
  8. Start the local server: bundle exec rails s.

Point your browser to http://0.0.0.0:3000 (you may have to open allow Ruby in your firewall). You should see your very own Bible search page.

About Caching

Most live web sites benefit from some amount of caching. Sites that utilize the Bible Search API benefit more than most because the Scripture data changes very little and is moderately large. Versions are updated from time-to-time, but usually those updates are very rare and very minor, so we've set caching on the Bible text to two weeks. New versions are a bit more common, so we've set the list of Bibles to update daily.

Besides speeding up your site and cutting bandwidth costs, caching also helps steward hosting costs donated by Bibles.org. It can be very useful to turn off caching to solve some kinds of bugs and configuration problems, but please turn it back on once the problem are solved.

In Rails production mode, this application uses Memcached or any drop-in replacement for it such as Amazon ElastiCache. In development mode, it uses file-system caching, but this can be turned off (details in the Configuration section below).

Configuration

This application is configured using Figaro. Your configuration settings go in config/application.yml or environment variables. See config/application.example.yml for an example.

Here are the configurable settings:

  1. BIBLESEARCH_API_KEY: your personal API key from Bibles.org. This key allows your application to fetch and use Scripture versions.
  2. DEFAULT_VERSION: the initial Bible version you want to display, like eng-GNTD for Good News Translation, US Version. You can look up these abbreviations on the full Bibles.org Reading Site.
  3. SITE_VERSIONS: A list of the versions you want people to be able to choose from [eng-GNTD,eng-CEV,spa-RVR60].
  4. RAILS_CACHE_STORE: the caching you want to use when running in local (development) mode. Defaults to file_store. Use null_store to disable caching.
  5. ELASTICACHE_ENDPOINT: if you accelerate your site with Amazon ElastiCache, this points to your cache store.

Taking it Further

If you don't know Ruby on Rails yet, it's a great tool to learn. If you know it already—or when you learn it—we welcome your enhancements as GitHub Pull Requests.

biblesearch-example-rails's People

Contributors

bradobro avatar dallasbpeters avatar bryceallison avatar

Watchers

Rawneed avatar James Cloos avatar

Forkers

bravetortoise

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.