Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby CSS JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db
doc
lib
log
public
script
test
vendor
.gitignore
Gemfile
Gemfile.lock
README.rdoc
Rakefile
config.ru

README.rdoc

Welcome to Eric's Rails App

This project is to serve as a boilerplate app to clone for a quick starting point with some common practices & tools.

Getting Started

  1. Confirm Prerequisites (see below)

  2. Clone the Repository via github.com/TheEricMiller/erics_rails_app.git

  3. Rename / Fix Refrences…

    * http://jakeboxer.com/blog/2012/03/15/changing-a-rails-3-project-name/
    
        /app/views/layouts/application.html.erb:
        /config.ru:
        /config/application.rb:
        /config/environment.rb:
        /config/environments/development.rb:
        /config/environments/production.rb:
        /config/environments/test.rb:
        /config/initializers/secret_token.rb:
        /config/initializers/session_store.rb:
        /config/routes.rb:
        /Rakefile:
  4. Setup Dev Database

    * Grant AWS RDS Remote Access (see below)
    * $ cp -f config/~database.example.yml config/database.yml
    * > edit config/database.yml
  5. Setup App Secrets & Email

    * $ cp -f config/~application.example.yml config/application.yml
    * > edit config/application.yml
  6. Test App Localy … $ rails s

  7. Git Commit…

    * Merge develop ~> master
    * Create GitHub Repo via https://github.com/new/
    * $ git remote add GitHub https://github.com/your-username/your_app.git
    * Push all to GitHub remote
  8. Setup Heroku & Prod Database

    * Create App on Heroku
      + $ heroku login
      + $ cd ~/your_rails_app
      + $ heroku create
    * Change App Name via http://dashboard.heroku.com/apps/
      + "Apps" > {new-app-12345} > "Settings" > "Name"
      + [Rename] to your unique heroku app name
      + Copy "Info" > "Git URL:"
      + $ git remote rm heroku
      + $ git remote add Heroku git@heroku.com:your-rails-app.git
      + (Optional) Enter "GitHub Repo"
    * Setup AWS RDS MySQL Database
      + Confirm Heroku is Granted AWS RDS Remote Access
      + $ heroku config:get DATABASE_URL
      + $ heroku addons:add amazon_rds url=mysql2://masteruser:pass@dbinstance.123endpoint321.amazonaws.com/databasename
      + $ heroku config:get DATABASE_URL
      + Confirm New Database Settings
  9. Deploy to Heroku

    * Deploy by git push of master to 'Heroku' remote
    * $ rake figaro:heroku
    * $ heroku run rake db:create
  10. ENJOY!

Prerequisites

  1. Install Ruby on Rails per railsinstaller.org/

  2. SignUp for Heroku Free Scalable Hosting via www.heroku.com/

* Install Heroku Toolbelt via https://toolbelt.heroku.com/
  1. SignUp for Amazon Web Services via aws.amazon.com/

* Setup MySQL Instance via http://aws.amazon.com/rds/
* (Optional) Install MySQL Workbench from http://www.mysql.com/downloads/workbench/
* (Optional) Install MySQL DB Serverlocaly via http://mxcl.github.com/homebrew/
  1. SignUp for GitHub via github.com/

* (Optional) Install Git GUI from 
    + http://www.sourcetreeapp.com/
    + http://mac.github.com/
    + http://windows.github.com/

How to Add Users

open `$ rails c`

#### SET FIRST USER _confirmation email will be sent_

$ User.create!(:email => "admin@domain.com", :password => "changeME", :invitation_limit => "777")

_no confirmation email will be sent_

$ user = User.new(:email => "admin@domain.com", :password => "changeME", :invitation_limit => "777")
$ user.skip_confirmation!
$ user.save!

#### INVITE OTHER USER

$ User.invite!(:email => "email@domain.com", :invitation_limit => "0")

#### OR IF EXISTING UPDATE INVITE_LIMIT

$ sql = "update users set invitation_limit=777 where email='email@domain.com' "
$ ActiveRecord::Base.connection.execute(sql)

### USER ADD NOTES? $ User.invite!(:email => “new_user@example.com”, :skip_invitation => true)

AWS RDS Remote Access


Amazon requires you to grant access from both your local machine's WAN IP. You will also need to grant Heroku's application servers authorized access for production.

1. SignIn to AWS via http://console.aws.amazon.com/
2. Go to "Services" > "RDS"
3. Under left menu "Navigation/Databases" > "DB Security Groups" > "default"
4. Add CIDR/IP: #.#.#.# (your local pc ip  http://www.whatsmyip.us/)
5. Add EC2 Security Group (this is heroku aws id)
  - aws account id: "098166147350"
  - ec2 security group: "default"

Setup MySQL WorkBench


* hostname = dbinstance.123endpoint789.us-east-1.rds.amazonaws.com
* user = masterusername
* pass = password
* port = 3306

Boilerplate Features

Tools

Roadmap

* Heroku Cloud Hosting
* Amazon RDS MySQL Database Support

* Devise
  + Devise_Invitable

* time_zone support

* mailcatcher
* quiet_assets
* better_errors
  + binding_of_caller
* meta_request (RailsPanel)

* bootstrap  AND/OR  foundation

* ssl for email

* cert for domain

* work on invitation system
  + allow guests to request signup for BETA
  + hold email invitations & mark as 'signup'
  + build web admin panel to send delayed invitations
    - by scale rate? , by FIFO? , by most shared?
  + allow social sharing (allow users not yet signed up to get credit and share)
  + give partial credit to all that referred, full credit to last referrer
  + beta startup user site?
Something went wrong with that request. Please try again.