Skip to content

An app that inspires you with deliciously cheesy quotes!

Notifications You must be signed in to change notification settings

Reinoptland/cheezy-quote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codeship Status for Reinoptland/cheezy-quote

🌕 Cheesy-Quote 🌕

Cheesy-Quote is an app that inspires you with deliciously cheesy quotes!

Features

For Users

  • Displays random quotes or a list of all quotes in the database
  • Admin functionality to add quotes or edit/destroy existing ones
  • Search function powered by ElasticSearch
  • Quotes are scored on a CheesyScale™ that indicate how cheesy they are

For Maintainers

  • Tested with RSpec
  • Continuous Integration through Codeship
    • All branches pushed to this repository are automatically tested.
    • This app deploys on heroku. The master branch is automatically tested and deploys upon passing the test suite.
  • Automatically generated documentation using YARD

Setting up (local)

  • Ruby version
    • 2.4.2
  • Rails version
    • 5.1.4

Installation

  1. Clone the repository

  2. Run bundle install ->
    bundle install

  3. Create, load schema and seed the database -> rake db:setup

  4. Install and start elasticsearch -> ```
    brew install elasticsearch

elasticsearch
--config=/usr/local/opt/elasticsearch/config/elasticsearch.yml
```
  1. Import data from your models into elastic search -> bundle exec rake environment elasticsearch:import:model CLASS='Quote'

  2. Add the google api and cse keys ->
    The cheesy_scale uses a google api key and custom search engine (CSE) key.
    They need to be added to a file called environment_variables.yml - Make the file touch config/environments/environment_variables.yml - Add the keys to the file. You can get your keys here development: GOOGLE_API_KEY: "YourApiKeyHere" GOOGLE_CUSTOM_SEARCH_ENGINE_KEY: "YourCustomSearchEngineKeyHere" test: GOOGLE_API_KEY: "YourApiKeyHere" GOOGLE_CUSTOM_SEARCH_ENGINE_KEY: "YourCustomSearchEngineKeyHere" - Configure your custom search engine to search the entire web.

  3. Start server and run the first update cheesy score rails s - Log in as an admin at localhost:3000/admins/sign_in
    - Use the email and password from db/seeds.rb
    - Use "Update Cheesy Score" in the navbar at the bottom of the screen to get the initial cheesiness scores

  4. Enjoy the deliciously cheesy quotes!

Tests

This app is tested with Rspec to run the tests use ->

bundle exec rspec

Documentation

The documentation for this app is automatically generated using yard. To generate the documentation on your local machine use ->

yard doc

Services

  • The search functionality is powered by elasticsearch-rails. For more information visit their github repository

  • The CheesyScale™ makes use of Google Custom Search to assign each quote a cheesy score. For more information visit google's CSE portal

Deployment instructions

  1. If you want to deploy your own version start with this guide provided here by heroku:
  2. During deployment the app uses bonsai as a hosted elasticsearch provider.
    Provision your app with bonsai (using heroku command line interface) and import the models into elasticsearch
heroku addons:create bonsai:sandbox-10
heroku run bundle exec rake environment elasticsearch:import:model CLASS='Quote' FORCE=y
  1. Set your Google api and google CSE keys as env variables in heroku
heroku config:set GOOGLE_API_KEY="YourApiKeyHere"
heroku config:set GOOGLE_CUSTOM_SEARCH_ENGINE_KEY="YourCustomSearchEngineKeyHere"

About

An app that inspires you with deliciously cheesy quotes!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published