{"id":15152700,"url":"https://github.com/paulfioravanti/sample_app","last_synced_at":"2025-09-29T23:32:14.079Z","repository":{"id":2945028,"uuid":"3958251","full_name":"paulfioravanti/sample_app","owner":"paulfioravanti","description":"Rails 3 Ruby on Rails Tutorial sample application (plus mods!)","archived":true,"fork":false,"pushed_at":"2022-10-04T20:08:09.000Z","size":4442,"stargazers_count":10,"open_issues_count":7,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-09-18T01:38:18.966Z","etag":null,"topics":["rails","rails-tutorial","ruby"],"latest_commit_sha":null,"homepage":"https://pf-sampleapp.herokuapp.com/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulfioravanti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-07T14:30:44.000Z","updated_at":"2023-02-23T04:31:35.000Z","dependencies_parsed_at":"2023-01-11T16:13:30.237Z","dependency_job_id":null,"html_url":"https://github.com/paulfioravanti/sample_app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfioravanti%2Fsample_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfioravanti%2Fsample_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfioravanti%2Fsample_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfioravanti%2Fsample_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulfioravanti","download_url":"https://codeload.github.com/paulfioravanti/sample_app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219865594,"owners_count":16554162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rails","rails-tutorial","ruby"],"created_at":"2024-09-26T16:21:26.750Z","updated_at":"2025-09-29T23:32:08.726Z","avatar_url":"https://github.com/paulfioravanti.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby on Rails Tutorial: sample application\n[![Build Status](https://secure.travis-ci.org/paulfioravanti/sample_app.png)](http://travis-ci.org/paulfioravanti/sample_app) [![Code Climate](https://codeclimate.com/github/paulfioravanti/sample_app.png)](https://codeclimate.com/github/paulfioravanti/sample_app) [![Coverage Status](https://coveralls.io/repos/paulfioravanti/sample_app/badge.png?branch=master)](https://coveralls.io/r/paulfioravanti/sample_app) [![Security Status](http://rails-brakeman.com/paulfioravanti/sample_app.png)](http://rails-brakeman.com/paulfioravanti/sample_app)\n\nThis is the sample application for the Rails 3.2 version of\n[*Ruby on Rails Tutorial: Learn Rails by Example*](http://railstutorial.org/)\nby [Michael Hartl](http://michaelhartl.com) (plus some [modifications](#modifications)).\n\n(I'm not going to be maintaining this version of my Sample App anymore, so please find the [Rails 4 version here](https://github.com/paulfioravanti/sample_app_rails_4)).\n\n- This code is currently deployed [here](https://pf-sampleapp.herokuapp.com) using [Heroku](http://www.heroku.com/)\n- Translation keys are currently being managed [here](http://www.localeapp.com/projects/1043) with [Localeapp](http://www.localeapp.com/).\n\n### Cloning Locally\n\n    $ cd /tmp\n    $ git clone git@github.com:paulfioravanti/sample_app.git\n    $ cd sample_app\n    $ bundle install\n\n### Environment Configuration\n\n    $ cp config/application.example.yml config/application.yml\n\n**Inside Rails App**\n\nGenerate a secret token:\n\n    $ rake secret\n\nCopy the resulting string into the `SECRET_TOKEN` entry in **config/application.yml**, along with your database information:\n\n    # App keys\n    SECRET_TOKEN: # your rake secret generated token\n\n    development:\n      DB_NAME: # your dev db name here\n      DB_USER: # your dev db username here\n      DB_PASSWORD: # your dev db password here\n\n    test:\n      DB_NAME: # your test db name here\n      DB_USER: # your test db username here\n      DB_PASSWORD: # your test db password here\n\n    production:\n      DB_NAME: # your prod db name here\n      DB_USER: # your prod db username here\n      DB_PASSWORD: # your prod db password here\n\n**Testing with Travis CI**\n\nIf you're using Travis for continuous integration testing, do the following (without the `{{ }}`):\n\nCreate encrypted travis variables for your Heroku API key and Repo name:\n\n    $ gem install travis\n    $ travis encrypt your_username/your_repo HEROKU_API_KEY={{YOUR_HEROKU_API_KEY}}\n    $ travis encrypt HEROKU_GIT_URL={{YOUR_HEROKU_GIT_URL}} # eg git@heroku.com:my_app.git\n    $ travis encrypt DB_NAME={{YOUR_DB_NAME_UNDER_TEST}} # eg: sample_app_test\n    $ travis encrypt DB_USER={{YOUR_DB_USER}}\n    $ travis encrypt DB_PASSWORD={{YOUR_DB_PASSWORD}}\n\nThen add them to **.travis.yml**\n\n    env:\n      global:\n        - secure: {{YOUR_ENCRYPTED_HEROKU_API_KEY}}\n        - secure: {{YOUR_ENCRYPTED_HEROKU_GIT_URL}}\n        - secure: {{YOUR_ENCRYPTED_DB_NAME_UNDER_TEST}}\n        - secure: {{YOUR_ENCRYPTED_DB_USER}}\n        - secure: {{YOUR_ENCRYPTED_DB_PASSWORD}}\n\n**Deploying with Heroku**\n\nGenerate production environment variables automatically using Figaro:\n\n    $ rake figaro:heroku\n\nOr, do it manually:\n\n    $ heroku config:set SECRET_TOKEN={{YOUR_SECRET_TOKEN}}\n    $ heroku config:set DB_NAME={{YOUR_DB_NAME_UNDER_PRODUCTION}} # eg: sample_app_production\n    $ heroku config:set DB_USER={{YOUR_DB_USER}}\n    $ heroku config:set DB_PASSWORD={{YOUR_DB_PASSWORD}}\n\n**Localeapp**\n\nIf you want to use Localeapp to manage language keys in the app (ignore this if you don't), [create an account](http://www.localeapp.com/users/sign_up) on their site, get an API key, and copy it into the `LOCALE_API_KEY` entry in **config/application.yml**, and add the key to your Heroku environment, if you didn't generate it automatically with Figaro:\n\n    $ heroku config:set LOCALE_API_KEY={{YOUR_LOCALE_API_KEY}}\n\n**New Relic**\n\nIf you want to use New Relic for app metrics (ignore this if you don't), [create an account](http://newrelic.com/) on their site, get a license key, and copy it into the `NEW_RELIC_LICENSE_KEY` entry in **config/application.yml**, and add the key to your Heroku environment, if you didn't generate it automatically with Figaro:\n\n    $ heroku config:set NEW_RELIC_LICENSE_KEY={{YOUR_NEW_RELIC_LICENSE_KEY}}\n\nFinally, configure the databases:\n\n    $ bundle exec rake db:migrate\n    $ bundle exec rake db:seed\n    $ bundle exec rake db:test:prepare RAILS_ENV=test\n\n- - -\n\n## Modifications:\n\n### User Interface\n- Added [Font Awesome](http://fortawesome.github.com/Font-Awesome/) icons to the header\n- Added micropost character countdown based on Twitter's\n- Added an endless scroll to pages with paginated lists of users or microposts, as shown in [Railscast #114 Endless Page (revised)](http://railscasts.com/episodes/114-endless-page-revised)\n\n### i18n\n- Added locale switcher\n- Internationalized app labels with translations for Japanese and Italian\n- All static content internationalized in [Markdown](http://daringfireball.net/projects/markdown/) files instead of HTML/ERb files\n- Added i18n-specific routing\n- Added translations to dynamic data and its relevant sample data (microposts) using [Globalize3](https://github.com/svenfuchs/globalize3)\n\n### Backend\n- Moved development database over to [Postgresql](http://www.postgresql.org/) to match deployment database on Heroku.\n- Changed all views from HTML/ERb to [Haml](http://haml-lang.com/)\n- Refactored [SCSS](http://sass-lang.com/) files to use more mix-ins, as well as additions to add styling to the language selector\n- Used [rails-timeago](https://github.com/jgraichen/rails-timeago) to do time calculation for microposts on client-side rather than server-side (replaces method calls to `time_ago_in_words`)\n- Simplified implementation of most forms with [SimpleForm](https://github.com/plataformatec/simple_form)\n- Used [Figaro](https://github.com/laserlemon/figaro) to handle all secret keys in an attempt to remove any app-identifiable information from all environments.  Reasons why at [this StackOverflow thread](http://stackoverflow.com/q/14785257/567863)\n- Moved mass assignment handling over to [strong_parameters](https://github.com/rails/strong_parameters) in anticipation of Rails 4\n\n### Testing/Debugging\n- Internationalized [RSpec](http://rspec.info/) tests and further refactored them\n- Refactored model specs to use [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers)\n- Changed RSpec output to show a progress bar instead of dots using [Fuubar](https://github.com/jeffkreeftmeijer/fuubar)\n- Swapped out the debug block in the footer for [rails-footnotes](https://github.com/josevalim/rails-footnotes)\n- Complete refactoring of test suite to upgrade to [Capybara 2.x](https://github.com/jnicklas/capybara) (see [this StackOverflow thread](http://stackoverflow.com/q/13573525/567863) and [this StackOverflow thread](http://stackoverflow.com/q/14028247/567863) for the details)\n- Performance tested the RSpec test suite and as a result refactored the [**spec_helper.rb**](./spec/spec_helper.rb) file.  See [this StackOverflow thread](http://stackoverflow.com/a/12215946/567863) for details.\n- Added tests for [Globalize3](https://github.com/svenfuchs/globalize3) translations and expanded factories to include a micropost with its relevant translations\n\n### Reporting/Optimizing\n- Added service hooks to [Travis CI](http://travis-ci.org/), [Rails Brakeman](http://rails-brakeman.com/), [Gemnasium](https://gemnasium.com/), [Code Climate](https://codeclimate.com), [Rails Best Practices](http://railsbp.com/), [Coveralls](https://coveralls.io/).  See badges under title for details.\n- Used [SimpleCov](https://github.com/colszowka/simplecov) to ensure as much test coverage as possible.  Currently at 100%.\n- Used [Bullet](https://github.com/flyerhzm/bullet) to optimize queries\n- Added performance monitoring with [New Relic](http://newrelic.com/)\n\n### Deployment\n- Fully automatic deployment process put in place: after a commit is pushed\nto Github, it gets pushed to Travis CI, and then gets deployed directly from the Travis worker to Heroku.  See [the **.travis.yml**](./.travis.yml) for details and [this StackOverflow thread](http://stackoverflow.com/q/10235026/567863) for reference.\n\n#### TODOs\n- Tests for Javascript-based functionality: Follow/Unfollow button, micropost countdown, endless scroll\n- Tests for `strong_parameters`, if an appropriate method gets implemented before Rails 4 is released.\n\n## Social\n\n\u003ca href=\"http://stackoverflow.com/users/567863/paul-fioravanti\"\u003e\n  \u003cimg src=\"http://stackoverflow.com/users/flair/567863.png\" width=\"208\" height=\"58\" alt=\"profile for Paul Fioravanti at Stack Overflow, Q\u0026amp;A for professional and enthusiast programmers\" title=\"profile for Paul Fioravanti at Stack Overflow, Q\u0026amp;A for professional and enthusiast programmers\"\u003e\n\u003c/a\u003e\n\n[![endorse](http://api.coderwall.com/pfioravanti/endorsecount.png)](http://coderwall.com/pfioravanti)\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/paulfioravanti/sample_app/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulfioravanti%2Fsample_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulfioravanti%2Fsample_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulfioravanti%2Fsample_app/lists"}