├── .eslintrc ├── .gitignore ├── .ruby-version ├── Gemfile ├── Gemfile.lock ├── Procfile ├── README.md ├── Rakefile ├── app ├── admin │ ├── dashboard.rb │ └── user.rb ├── assets │ ├── javascripts │ │ ├── application_common.js │ │ ├── application_desktop.js │ │ ├── application_phone.js │ │ ├── common │ │ │ ├── active_admin.js │ │ │ ├── bootstrap.js │ │ │ └── modal_behavior.js │ │ ├── components.js │ │ ├── components │ │ │ ├── .gitkeep │ │ │ ├── comments │ │ │ │ └── CommentsNew.js.jsx │ │ │ ├── pages │ │ │ │ └── redux.js.jsx │ │ │ └── posts │ │ │ │ ├── PostsIndex.js.jsx │ │ │ │ ├── PostsNew.js.jsx │ │ │ │ └── PostsShow.js.jsx │ │ ├── desktop │ │ │ └── .gitkeep │ │ ├── phone │ │ │ └── .gitkeep │ │ └── vendor │ │ │ ├── fetch.js │ │ │ ├── react-redux.min.js │ │ │ └── redux.min.js │ └── stylesheets │ │ ├── application_common.scss │ │ ├── application_desktop.scss │ │ ├── application_phone.scss │ │ ├── bootstrap │ │ ├── custom.scss │ │ └── devise_forms.scss │ │ ├── common │ │ ├── active_admin.scss │ │ ├── alerts.scss │ │ └── base.scss │ │ ├── components │ │ └── posts.scss │ │ ├── desktop │ │ └── .gitkeep │ │ ├── environment │ │ └── ribbon.scss │ │ └── phone │ │ └── .gitkeep ├── carriers │ └── layout_carrier.rb ├── controllers │ ├── api │ │ └── v1 │ │ │ ├── base_controller.rb │ │ │ ├── sessions_controller.rb │ │ │ └── users_controller.rb │ ├── application_controller.rb │ ├── comments_controller.rb │ ├── contacts_controller.rb │ ├── home_controller.rb │ ├── pages_controller.rb │ ├── posts_controller.rb │ ├── registrations_controller.rb │ ├── sessions_controller.rb │ └── superadmin │ │ ├── base_controller.rb │ │ └── users_controller.rb ├── helpers │ └── application_helper.rb ├── mailers │ └── mailer.rb ├── middleware │ └── catch_json_parse_errors.rb ├── models │ ├── comment.rb │ ├── contact.rb │ ├── post.rb │ └── user.rb ├── services │ └── addition_service.rb ├── uploaders │ └── profile_image_uploader.rb ├── views │ ├── home │ │ └── index.html.haml │ ├── layouts │ │ ├── application.html+phone.haml │ │ ├── application.html.haml │ │ ├── mailer.haml │ │ └── superadmin.html.haml │ ├── mailer │ │ └── contact_us_notification.html.haml │ ├── pages │ │ ├── about.html+phone.haml │ │ ├── about.html.haml │ │ ├── contact_us.html.haml │ │ ├── index.html.haml │ │ └── redux.html.haml │ ├── posts │ │ ├── _index.json.jbuilder │ │ ├── _show.json.jbuilder │ │ ├── index.html.haml │ │ └── show.html.haml │ ├── shared │ │ ├── _bootstrap_flash.html.haml │ │ ├── _modal.html.haml │ │ ├── _nav.html.haml │ │ ├── _superadmin_nav.html.haml │ │ ├── _user_is_signed_in.html.haml │ │ └── _user_right_nav.html.haml │ ├── superadmin │ │ └── users │ │ │ ├── _edit_modal.html.haml │ │ │ └── index.html.haml │ └── users │ │ ├── confirmations │ │ └── new.html.haml │ │ ├── mailer │ │ ├── confirmation_instructions.html.haml │ │ ├── reset_password_instructions.html.haml │ │ └── unlock_instructions.html.haml │ │ ├── passwords │ │ ├── edit.html.haml │ │ └── new.html.haml │ │ ├── registrations │ │ ├── edit.html.haml │ │ ├── edit_password.html.haml │ │ └── new.html.haml │ │ ├── sessions │ │ └── new.html.haml │ │ ├── shared │ │ └── _links.haml │ │ └── unlocks │ │ └── new.html.haml └── workers │ ├── base_worker.rb │ └── event_notification_worker.rb ├── bin ├── bundle ├── delayed_job ├── honeybadger ├── rails ├── rake ├── setup └── spring ├── circle.yml ├── config.ru ├── config ├── application.rb ├── boot.rb ├── database.yml.ci ├── database.yml.postgresql ├── database.yml.postgresqlapp ├── database.yml.sqlite3 ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ ├── staging.rb │ └── test.rb ├── honeybadger.yml ├── initializers │ ├── active_admin.rb │ ├── asset_precompile.rb │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── carrierwave.rb │ ├── catch_json_parser_errors.rb │ ├── cookies_serializer.rb │ ├── delayed_job_config.rb │ ├── delayed_job_invoke_worker_automatically.rb │ ├── devise.rb │ ├── devise_async.rb │ ├── email_interceptor.rb │ ├── email_prefixer.rb │ ├── filter_parameter_logging.rb │ ├── honeybadger.rb │ ├── inflections.rb │ ├── marginalia.rb │ ├── mime_types.rb │ ├── rack_deflater.rb │ ├── session_store.rb │ ├── setup_email.rb │ ├── simple_form.rb │ ├── simple_form_bootstrap.rb │ ├── tagged_logging.rb │ └── wrap_parameters.rb ├── locales │ ├── devise.en.yml │ ├── en.bootstrap.yml │ ├── en.yml │ └── simple_form.en.yml ├── routes.rb ├── secrets.yml └── unicorn.rb ├── db ├── migrate │ ├── 20131112184628_add_devise_to_users.rb │ ├── 20131120170220_create_delayed_jobs.rb │ ├── 20131122045009_add_user_attributes.rb │ ├── 20131213184726_create_active_admin_comments.rb │ ├── 20140220111712_add_authentication_token_to_users.rb │ ├── 20140225143027_add_profile_image_to_users.rb │ ├── 20150827192424_create_posts.rb │ └── 20150827192538_create_comments.rb ├── schema.rb └── seeds.rb ├── doc ├── api.md └── why_database_name_only_63_characters_long.md ├── lib ├── tasks │ └── setup.rake └── templates │ └── erb │ └── scaffold │ └── _form.html.erb ├── public ├── 404.html ├── 422.html ├── 500.html ├── favicon.ico └── robots.txt └── test ├── controllers ├── active_admin │ └── dashboard_controller_test.rb ├── api │ └── v1 │ │ ├── sessions_controller_test.rb │ │ └── users_controller_test.rb ├── contacts_controller_test.rb ├── home_controller_test.rb ├── pages_controller_test.rb ├── registrations_controller_test.rb └── superadmin │ └── users_controller_test.rb ├── fixtures ├── comments.yml ├── posts.yml └── users.yml ├── integration ├── api_invalid_json_data_test.rb └── compression_test.rb ├── models ├── comment_test.rb ├── contact_test.rb ├── post_test.rb └── user_test.rb ├── services └── addition_service_test.rb └── test_helper.rb /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "env": { 4 | "browser": true, 5 | "es6": true, 6 | "node": true, 7 | "jquery": true // This will remove warnings related to $ being undefined. PR #97 8 | }, 9 | "plugins": [ 10 | "react" // This will remove warnings related to React not being defined. PR #98 11 | ], 12 | "ecmaFeatures": { 13 | "arrowFunctions": true, 14 | "blockBindings": true, 15 | "classes": true, 16 | "defaultParams": true, 17 | "destructuring": true, 18 | "forOf": true, 19 | "generators": true, 20 | "modules": true, 21 | "spread": true, 22 | "templateStrings": true, 23 | "jsx": true 24 | }, 25 | "rules": { 26 | "consistent-return": [0], 27 | "key-spacing": [0], 28 | "quotes": [0], 29 | "new-cap": [0], 30 | "no-multi-spaces": [0], 31 | "no-shadow": [0], 32 | 33 | // allow alert 34 | "no-alert": [0], 35 | 36 | // in ReactJS it is common to have components defined first and then used later. PR #88 37 | "no-unused-vars": [0], 38 | 39 | //allow function names starting with underscore statements like this._executeQuery is being flagged. PR #86 40 | "no-underscore-dangle": [0], 41 | 42 | //In ReactNavite code it is common to have styles.xxx at the top while styles is defined later. PR #85 43 | "no-use-before-define": [0, "nofunc"], 44 | 45 | // Allow dangling commas 46 | "comma-dangle": [0], 47 | 48 | // Force space after keywords like if, else and before code blocks. PR #91 49 | "space-after-keywords": [2], 50 | "space-before-blocks": [2], 51 | 52 | // Don't warn if camelcase variable names are used. PR #96 53 | "camelcase": [0], 54 | 55 | // Prefer === over ==. PR #100 56 | "eqeqeq": [2] 57 | 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore database.yml file 15 | /config/database.yml 16 | 17 | # Ignore all logfiles and tempfiles. 18 | /log/*.log 19 | /tmp 20 | /db/backups 21 | public/uploads 22 | .idea 23 | *.DS_Store 24 | coverage 25 | .*swp 26 | /uploads/* 27 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.2.2 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | ruby '2.2.2' 4 | 5 | gem 'rails', '4.2.1' 6 | 7 | gem 'arel' 8 | gem 'jquery-rails' 9 | 10 | gem 'sprockets-rails', :require => 'sprockets/railtie' 11 | gem 'sass-rails', '>= 5.0.3' 12 | gem 'uglifier', '>= 2.7.1' 13 | 14 | # database 15 | gem 'sqlite3' 16 | # gem 'pg' 17 | 18 | # Sprockets support for .es6 files, using babel. 19 | gem 'sprockets-es6', require: 'sprockets/es6' 20 | 21 | # for building JSON 22 | gem 'jbuilder', '>= 2.2.13' 23 | 24 | # for authentication 25 | gem 'devise', '3.4.1' 26 | 27 | # for sending devise emails in background 28 | gem 'devise-async', git: 'https://github.com/mhfs/devise-async.git' 29 | 30 | # for background job processing 31 | gem 'delayed_job_active_record' 32 | 33 | # web interface for delayed job 34 | gem 'delayed_job_web', '>= 1.2.10' 35 | 36 | # For starting Delayed job background process 37 | gem 'daemons' 38 | 39 | # collection of handy tools 40 | gem 'handy' 41 | 42 | # for error tracking 43 | gem 'honeybadger' 44 | 45 | # use bootstrap3 46 | gem 'bootstrap-sass', '~> 3.3.3' 47 | 48 | # use font-awesome 49 | gem 'font-awesome-sass', '~> 4.3.0' 50 | 51 | # forms made easy for rails 52 | gem 'simple_form' 53 | 54 | # admin framework 55 | gem 'activeadmin', git: 'https://github.com/activeadmin/activeadmin' 56 | 57 | # for handling file uploads 58 | gem 'carrierwave' 59 | 60 | # for CarrierWave to upload files to cloud storage like Amazon S3 61 | gem 'fog', require: false 62 | 63 | # for CarrierWave to perform image manipulations 64 | #gem 'mini_magick' 65 | 66 | # for logging to work in heroku 67 | gem 'rails_12factor', group: [:staging, :production] 68 | 69 | # for email validation 70 | gem 'email_validator' 71 | 72 | # for variants support 73 | gem 'browser' 74 | 75 | # haml as templating engine 76 | gem 'haml-rails' 77 | 78 | # intercepts outgoing emails in non-production environment 79 | gem 'mail_interceptor', git: 'https://github.com/bigbinary/mail_interceptor', group: [:development, :staging] 80 | 81 | # Adds prefix to the subject in emails 82 | gem 'email_prefixer' 83 | 84 | # HTTP server for Rack applications for staging and production 85 | # See https://github.com/bigbinary/wheel/issues/43 for why unicorn is 86 | # not used in development. 87 | gem 'unicorn', group: [:staging, :production] 88 | 89 | group :development do 90 | 91 | # application server for development 92 | gem 'thin' 93 | 94 | # mutes assets pipeline log messages 95 | gem 'quiet_assets' 96 | 97 | # speeds up development by keeping your application running in the background 98 | gem 'spring' 99 | 100 | # web console 101 | gem 'web-console', '~> 2.0' 102 | end 103 | 104 | group :test do 105 | 106 | # customizable MiniTest output formats 107 | gem 'minitest-reporters', require: false 108 | 109 | # for test coverage report 110 | gem 'simplecov', require: false 111 | 112 | end 113 | 114 | # Attach comments to Active Record queries 115 | gem 'marginalia' 116 | 117 | gem 'react-rails', '1.6.0' 118 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: https://github.com/activeadmin/activeadmin 3 | revision: 7ffcc55544d0624c6a242315798bbeff2b1e9078 4 | specs: 5 | activeadmin (1.0.0.pre2) 6 | arbre (~> 1.0, >= 1.0.2) 7 | bourbon 8 | coffee-rails 9 | formtastic (~> 3.1) 10 | formtastic_i18n 11 | inherited_resources (~> 1.6) 12 | jquery-rails 13 | jquery-ui-rails 14 | kaminari (~> 0.15) 15 | rails (>= 3.2, < 5.0) 16 | ransack (~> 1.3) 17 | sass-rails 18 | 19 | GIT 20 | remote: https://github.com/bigbinary/mail_interceptor 21 | revision: 8152faaf2481a4c0901fb32484a4393f37be83cd 22 | specs: 23 | mail_interceptor (0.0.6) 24 | activesupport 25 | 26 | GIT 27 | remote: https://github.com/mhfs/devise-async.git 28 | revision: 5c5971c625f7ebfcfccdc0d643fc60fa3bb28eb1 29 | specs: 30 | devise-async (0.10.1) 31 | devise (~> 3.2) 32 | 33 | GEM 34 | remote: https://rubygems.org/ 35 | specs: 36 | CFPropertyList (2.3.1) 37 | actionmailer (4.2.1) 38 | actionpack (= 4.2.1) 39 | actionview (= 4.2.1) 40 | activejob (= 4.2.1) 41 | mail (~> 2.5, >= 2.5.4) 42 | rails-dom-testing (~> 1.0, >= 1.0.5) 43 | actionpack (4.2.1) 44 | actionview (= 4.2.1) 45 | activesupport (= 4.2.1) 46 | rack (~> 1.6) 47 | rack-test (~> 0.6.2) 48 | rails-dom-testing (~> 1.0, >= 1.0.5) 49 | rails-html-sanitizer (~> 1.0, >= 1.0.1) 50 | actionview (4.2.1) 51 | activesupport (= 4.2.1) 52 | builder (~> 3.1) 53 | erubis (~> 2.7.0) 54 | rails-dom-testing (~> 1.0, >= 1.0.5) 55 | rails-html-sanitizer (~> 1.0, >= 1.0.1) 56 | activejob (4.2.1) 57 | activesupport (= 4.2.1) 58 | globalid (>= 0.3.0) 59 | activemodel (4.2.1) 60 | activesupport (= 4.2.1) 61 | builder (~> 3.1) 62 | activerecord (4.2.1) 63 | activemodel (= 4.2.1) 64 | activesupport (= 4.2.1) 65 | arel (~> 6.0) 66 | activesupport (4.2.1) 67 | i18n (~> 0.7) 68 | json (~> 1.7, >= 1.7.7) 69 | minitest (~> 5.1) 70 | thread_safe (~> 0.3, >= 0.3.4) 71 | tzinfo (~> 1.1) 72 | ansi (1.5.0) 73 | arbre (1.0.3) 74 | activesupport (>= 3.0.0) 75 | arel (6.0.3) 76 | autoprefixer-rails (5.1.7) 77 | execjs 78 | json 79 | babel-source (5.8.35) 80 | babel-transpiler (0.7.0) 81 | babel-source (>= 4.0, < 6) 82 | execjs (~> 2.0) 83 | bcrypt (3.1.10) 84 | binding_of_caller (0.7.2) 85 | debug_inspector (>= 0.0.1) 86 | bootstrap-sass (3.3.3) 87 | autoprefixer-rails (>= 5.0.0.1) 88 | sass (>= 3.2.19) 89 | bourbon (4.2.6) 90 | sass (~> 3.4) 91 | thor (~> 0.19) 92 | browser (0.8.0) 93 | builder (3.2.2) 94 | carrierwave (0.10.0) 95 | activemodel (>= 3.2.0) 96 | activesupport (>= 3.2.0) 97 | json (>= 1.7) 98 | mime-types (>= 1.16) 99 | coffee-rails (4.1.1) 100 | coffee-script (>= 2.2.0) 101 | railties (>= 4.0.0, < 5.1.x) 102 | coffee-script (2.4.1) 103 | coffee-script-source 104 | execjs 105 | coffee-script-source (1.10.0) 106 | concurrent-ruby (1.0.0) 107 | connection_pool (2.2.0) 108 | daemons (1.1.9) 109 | debug_inspector (0.0.2) 110 | delayed_job (4.0.6) 111 | activesupport (>= 3.0, < 5.0) 112 | delayed_job_active_record (4.0.3) 113 | activerecord (>= 3.0, < 5.0) 114 | delayed_job (>= 3.0, < 4.1) 115 | delayed_job_web (1.2.10) 116 | activerecord (> 3.0.0) 117 | delayed_job (> 2.0.3) 118 | sinatra (>= 1.4.4) 119 | devise (3.4.1) 120 | bcrypt (~> 3.0) 121 | orm_adapter (~> 0.1) 122 | railties (>= 3.2.6, < 5) 123 | responders 124 | thread_safe (~> 0.1) 125 | warden (~> 1.2.3) 126 | docile (1.1.5) 127 | email_prefixer (1.1.0) 128 | rails (>= 4.0) 129 | email_validator (1.5.0) 130 | activemodel 131 | erubis (2.7.0) 132 | eventmachine (1.0.7) 133 | excon (0.45.4) 134 | execjs (2.6.0) 135 | fission (0.5.0) 136 | CFPropertyList (~> 2.2) 137 | fog (1.32.0) 138 | fog-atmos 139 | fog-aws (>= 0.6.0) 140 | fog-brightbox (~> 0.4) 141 | fog-core (~> 1.32) 142 | fog-ecloud (= 0.1.1) 143 | fog-google (>= 0.0.2) 144 | fog-json 145 | fog-local 146 | fog-powerdns (>= 0.1.1) 147 | fog-profitbricks 148 | fog-radosgw (>= 0.0.2) 149 | fog-riakcs 150 | fog-sakuracloud (>= 0.0.4) 151 | fog-serverlove 152 | fog-softlayer 153 | fog-storm_on_demand 154 | fog-terremark 155 | fog-vmfusion 156 | fog-voxel 157 | fog-xml (~> 0.1.1) 158 | ipaddress (~> 0.5) 159 | nokogiri (~> 1.5, >= 1.5.11) 160 | fog-atmos (0.1.0) 161 | fog-core 162 | fog-xml 163 | fog-aws (0.7.4) 164 | fog-core (~> 1.27) 165 | fog-json (~> 1.0) 166 | fog-xml (~> 0.1) 167 | ipaddress (~> 0.8) 168 | fog-brightbox (0.8.0) 169 | fog-core (~> 1.22) 170 | fog-json 171 | inflecto (~> 0.0.2) 172 | fog-core (1.32.0) 173 | builder 174 | excon (~> 0.45) 175 | formatador (~> 0.2) 176 | mime-types 177 | net-scp (~> 1.1) 178 | net-ssh (>= 2.1.3) 179 | fog-ecloud (0.1.1) 180 | fog-core 181 | fog-xml 182 | fog-google (0.0.7) 183 | fog-core 184 | fog-json 185 | fog-xml 186 | fog-json (1.0.2) 187 | fog-core (~> 1.0) 188 | multi_json (~> 1.10) 189 | fog-local (0.2.1) 190 | fog-core (~> 1.27) 191 | fog-powerdns (0.1.1) 192 | fog-core (~> 1.27) 193 | fog-json (~> 1.0) 194 | fog-xml (~> 0.1) 195 | fog-profitbricks (0.0.5) 196 | fog-core 197 | fog-xml 198 | nokogiri 199 | fog-radosgw (0.0.4) 200 | fog-core (>= 1.21.0) 201 | fog-json 202 | fog-xml (>= 0.0.1) 203 | fog-riakcs (0.1.0) 204 | fog-core 205 | fog-json 206 | fog-xml 207 | fog-sakuracloud (1.0.1) 208 | fog-core 209 | fog-json 210 | fog-serverlove (0.1.2) 211 | fog-core 212 | fog-json 213 | fog-softlayer (0.4.7) 214 | fog-core 215 | fog-json 216 | fog-storm_on_demand (0.1.1) 217 | fog-core 218 | fog-json 219 | fog-terremark (0.1.0) 220 | fog-core 221 | fog-xml 222 | fog-vmfusion (0.1.0) 223 | fission 224 | fog-core 225 | fog-voxel (0.1.0) 226 | fog-core 227 | fog-xml 228 | fog-xml (0.1.2) 229 | fog-core 230 | nokogiri (~> 1.5, >= 1.5.11) 231 | font-awesome-sass (4.3.1) 232 | sass (~> 3.2) 233 | formatador (0.2.5) 234 | formtastic (3.1.3) 235 | actionpack (>= 3.2.13) 236 | formtastic_i18n (0.5.0) 237 | globalid (0.3.6) 238 | activesupport (>= 4.1.0) 239 | haml (4.0.6) 240 | tilt 241 | haml-rails (0.8.2) 242 | actionpack (>= 4.0.1) 243 | activesupport (>= 4.0.1) 244 | haml (>= 3.1, < 5.0) 245 | html2haml (>= 1.0.1) 246 | railties (>= 4.0.1) 247 | handy (0.0.28) 248 | hashr 249 | has_scope (0.6.0) 250 | actionpack (>= 3.2, < 5) 251 | activesupport (>= 3.2, < 5) 252 | hashr (0.0.22) 253 | honeybadger (2.0.11) 254 | html2haml (2.0.0) 255 | erubis (~> 2.7.0) 256 | haml (~> 4.0.0) 257 | nokogiri (~> 1.6.0) 258 | ruby_parser (~> 3.5) 259 | i18n (0.7.0) 260 | inflecto (0.0.2) 261 | inherited_resources (1.6.0) 262 | actionpack (>= 3.2, < 5) 263 | has_scope (~> 0.6.0.rc) 264 | railties (>= 3.2, < 5) 265 | responders 266 | ipaddress (0.8.0) 267 | jbuilder (2.2.13) 268 | activesupport (>= 3.0.0, < 5) 269 | multi_json (~> 1.2) 270 | jquery-rails (4.0.3) 271 | rails-dom-testing (~> 1.0) 272 | railties (>= 4.2.0) 273 | thor (>= 0.14, < 2.0) 274 | jquery-ui-rails (5.0.5) 275 | railties (>= 3.2.16) 276 | json (1.8.3) 277 | kaminari (0.16.3) 278 | actionpack (>= 3.0.0) 279 | activesupport (>= 3.0.0) 280 | kgio (2.9.3) 281 | loofah (2.0.3) 282 | nokogiri (>= 1.5.9) 283 | mail (2.6.3) 284 | mime-types (>= 1.16, < 3) 285 | marginalia (1.3.0) 286 | actionpack (>= 2.3) 287 | activerecord (>= 2.3) 288 | mime-types (2.99) 289 | mini_portile2 (2.0.0) 290 | minitest (5.8.4) 291 | minitest-reporters (1.0.11) 292 | ansi 293 | builder 294 | minitest (>= 5.0) 295 | ruby-progressbar 296 | multi_json (1.11.1) 297 | net-scp (1.2.1) 298 | net-ssh (>= 2.6.5) 299 | net-ssh (2.9.2) 300 | nokogiri (1.6.7.2) 301 | mini_portile2 (~> 2.0.0.rc2) 302 | orm_adapter (0.5.0) 303 | polyamorous (1.3.0) 304 | activerecord (>= 3.0) 305 | quiet_assets (1.1.0) 306 | railties (>= 3.1, < 5.0) 307 | rack (1.6.4) 308 | rack-protection (1.5.3) 309 | rack 310 | rack-test (0.6.3) 311 | rack (>= 1.0) 312 | rails (4.2.1) 313 | actionmailer (= 4.2.1) 314 | actionpack (= 4.2.1) 315 | actionview (= 4.2.1) 316 | activejob (= 4.2.1) 317 | activemodel (= 4.2.1) 318 | activerecord (= 4.2.1) 319 | activesupport (= 4.2.1) 320 | bundler (>= 1.3.0, < 2.0) 321 | railties (= 4.2.1) 322 | sprockets-rails 323 | rails-deprecated_sanitizer (1.0.3) 324 | activesupport (>= 4.2.0.alpha) 325 | rails-dom-testing (1.0.7) 326 | activesupport (>= 4.2.0.beta, < 5.0) 327 | nokogiri (~> 1.6.0) 328 | rails-deprecated_sanitizer (>= 1.0.1) 329 | rails-html-sanitizer (1.0.3) 330 | loofah (~> 2.0) 331 | rails_12factor (0.0.3) 332 | rails_serve_static_assets 333 | rails_stdout_logging 334 | rails_serve_static_assets (0.0.4) 335 | rails_stdout_logging (0.0.3) 336 | railties (4.2.1) 337 | actionpack (= 4.2.1) 338 | activesupport (= 4.2.1) 339 | rake (>= 0.8.7) 340 | thor (>= 0.18.1, < 2.0) 341 | raindrops (0.13.0) 342 | rake (10.5.0) 343 | ransack (1.7.0) 344 | actionpack (>= 3.0) 345 | activerecord (>= 3.0) 346 | activesupport (>= 3.0) 347 | i18n 348 | polyamorous (~> 1.2) 349 | react-rails (1.6.0) 350 | babel-transpiler (>= 0.7.0) 351 | coffee-script-source (~> 1.8) 352 | connection_pool 353 | execjs 354 | rails (>= 3.2) 355 | tilt 356 | responders (2.1.0) 357 | railties (>= 4.2.0, < 5) 358 | ruby-progressbar (1.7.1) 359 | ruby_parser (3.6.4) 360 | sexp_processor (~> 4.1) 361 | sass (3.4.13) 362 | sass-rails (5.0.3) 363 | railties (>= 4.0.0, < 5.0) 364 | sass (~> 3.1) 365 | sprockets (>= 2.8, < 4.0) 366 | sprockets-rails (>= 2.0, < 4.0) 367 | tilt (~> 1.1) 368 | sexp_processor (4.4.5) 369 | simple_form (3.1.0) 370 | actionpack (~> 4.0) 371 | activemodel (~> 4.0) 372 | simplecov (0.9.2) 373 | docile (~> 1.1.0) 374 | multi_json (~> 1.0) 375 | simplecov-html (~> 0.9.0) 376 | simplecov-html (0.9.0) 377 | sinatra (1.4.5) 378 | rack (~> 1.4) 379 | rack-protection (~> 1.4) 380 | tilt (~> 1.3, >= 1.3.4) 381 | spring (1.3.3) 382 | sprockets (3.5.2) 383 | concurrent-ruby (~> 1.0) 384 | rack (> 1, < 3) 385 | sprockets-es6 (0.6.2) 386 | babel-transpiler 387 | sprockets (>= 3.0.0) 388 | sprockets-rails (3.0.0) 389 | actionpack (>= 4.0) 390 | activesupport (>= 4.0) 391 | sprockets (>= 3.0.0) 392 | sqlite3 (1.3.11) 393 | thin (1.6.3) 394 | daemons (~> 1.0, >= 1.0.9) 395 | eventmachine (~> 1.0) 396 | rack (~> 1.0) 397 | thor (0.19.1) 398 | thread_safe (0.3.5) 399 | tilt (1.4.1) 400 | tzinfo (1.2.2) 401 | thread_safe (~> 0.1) 402 | uglifier (2.7.1) 403 | execjs (>= 0.3.0) 404 | json (>= 1.8.0) 405 | unicorn (4.8.3) 406 | kgio (~> 2.6) 407 | rack 408 | raindrops (~> 0.7) 409 | warden (1.2.3) 410 | rack (>= 1.0) 411 | web-console (2.1.1) 412 | activemodel (>= 4.0) 413 | binding_of_caller (>= 0.7.2) 414 | railties (>= 4.0) 415 | sprockets-rails (>= 2.0, < 4.0) 416 | 417 | PLATFORMS 418 | ruby 419 | 420 | DEPENDENCIES 421 | activeadmin! 422 | arel 423 | bootstrap-sass (~> 3.3.3) 424 | browser 425 | carrierwave 426 | daemons 427 | delayed_job_active_record 428 | delayed_job_web (>= 1.2.10) 429 | devise (= 3.4.1) 430 | devise-async! 431 | email_prefixer 432 | email_validator 433 | fog 434 | font-awesome-sass (~> 4.3.0) 435 | haml-rails 436 | handy 437 | honeybadger 438 | jbuilder (>= 2.2.13) 439 | jquery-rails 440 | mail_interceptor! 441 | marginalia 442 | minitest-reporters 443 | quiet_assets 444 | rails (= 4.2.1) 445 | rails_12factor 446 | react-rails (= 1.6.0) 447 | sass-rails (>= 5.0.3) 448 | simple_form 449 | simplecov 450 | spring 451 | sprockets-es6 452 | sprockets-rails 453 | sqlite3 454 | thin 455 | uglifier (>= 2.7.1) 456 | unicorn 457 | web-console (~> 2.0) 458 | 459 | BUNDLED WITH 460 | 1.11.2 461 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb 2 | worker: bundle exec rake jobs:work 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Circle CI](https://circleci.com/gh/bigbinary/wheel.png?style=badge)](https://circleci.com/gh/bigbinary/wheel) 2 | 3 | #### Setup 4 | 5 | ``` 6 | bundle install 7 | cp config/database.yml.postgresqlapp config/database.yml 8 | rake setup 9 | bundle exec rails server 10 | ``` 11 | 12 | #### Replace Wheel with your project name 13 | 14 | Let's say that the project name is `Pump`. Execute the command below to 15 | replace all occurrences of `Wheel` with `Pump`. 16 | 17 | ``` 18 | perl -e "s/Wheel/Pump/g;" -pi $(find . -type f) 19 | ``` 20 | 21 | #### Features 22 | 23 | - Uses [Bootstrap](http://getbootstrap.com) . 24 | - rake setup to set sensible sample data including user `sam@example.com` with password `welcome`. 25 | - Uses [devise](https://github.com/plataformatec/devise) . 26 | - Heroku ready. Push to heroku and it will work . 27 | - Uses [honeybadger](https://www.honeybadger.io). 28 | - Built in superadmin feature. 29 | - Uses modal box to showcase an example of editing information using modal box. 30 | - Enables __strict mode__ for all JavaScript code. 31 | - Uses __unicorn__ for staging and production. 32 | - Uses __thin__ for development and test. 33 | - An orange ribbon at the top for non-production environment. 34 | - Uses haml for cleaner syntax over erb. 35 | - No coffeescript. We prefer JavaScript. 36 | - No turbo-link. 37 | - Uses [ActiveAdmin](http://activeadmin.info). 38 | - When exception is sent to honeybadger then uuid is also sent for [debugging](http://videos.bigbinary.com/rubyonrails/use-uuid-x-request-id-to-debug-rails-application.html) . 39 | - Uses [DelayedJob](https://github.com/collectiveidea/delayed_job). 40 | - Intercepts all outgoing emails in non production environment using gem [mail_interceptor](https://github.com/bigbinary/mail_interceptor). 41 | - Uses [CircleCI](https://circleci.com) for continuous testing. 42 | - Has a bunch of tests to make it easier to get started with new tests. 43 | - Uses PostgreSQL. 44 | - Built in support for [carrierwave](https://github.com/carrierwaveuploader/carrierwave) to easily upload items to s3. 45 | - Built in support for "variants" so the pages can be customized for tablet or phone easily. 46 | - Uses [simple_form](https://github.com/plataformatec/simple_form). 47 | - Built in support for [mandrill](http://how-we-work.bigbinary.com/externalservices/mandrill.html). 48 | - Easy to generate "test coverage". 49 | - Content compression via [Rack::Deflater](https://github.com/rack/rack/blob/master/lib/rack/deflater.rb). 50 | 51 | 52 | #### Brought to you by 53 | 54 | [![BigBinary logo](http://bigbinary.com/assets/common/logo.png)](http://BigBinary.com) 55 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Wheel::Application.load_tasks 7 | -------------------------------------------------------------------------------- /app/admin/dashboard.rb: -------------------------------------------------------------------------------- 1 | ActiveAdmin.register_page "Dashboard" do 2 | 3 | menu priority: 1, label: proc { I18n.t("active_admin.dashboard") } 4 | 5 | content :title => proc { I18n.t("active_admin.dashboard") } do 6 | div :class => "blank_slate_container", :id => "dashboard_default_message" do 7 | span :class => "blank_slate" do 8 | span I18n.t("active_admin.dashboard_welcome.welcome") 9 | small I18n.t("active_admin.dashboard_welcome.call_to_action") 10 | end 11 | end 12 | 13 | # Here is an example of a simple dashboard with columns and panels. 14 | # 15 | # columns do 16 | # column do 17 | # panel "Recent Posts" do 18 | # ul do 19 | # Post.recent(5).map do |post| 20 | # li link_to(post.title, admin_post_path(post)) 21 | # end 22 | # end 23 | # end 24 | # end 25 | 26 | # column do 27 | # panel "Info" do 28 | # para "Welcome to ActiveAdmin." 29 | # end 30 | # end 31 | # end 32 | end # content 33 | end 34 | -------------------------------------------------------------------------------- /app/admin/user.rb: -------------------------------------------------------------------------------- 1 | ActiveAdmin.register User do 2 | 3 | permit_params :email, :password, :password_confirmation 4 | 5 | index do 6 | column :email 7 | column :current_sign_in_at 8 | column :last_sign_in_at 9 | column :sign_in_count 10 | end 11 | 12 | filter :email 13 | 14 | form do |f| 15 | f.inputs "Admin Details" do 16 | f.input :email 17 | f.input :password 18 | f.input :password_confirmation 19 | end 20 | f.actions 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /app/assets/javascripts/application_common.js: -------------------------------------------------------------------------------- 1 | //= require jquery 2 | //= require jquery_ujs 3 | //= require bootstrap-sprockets 4 | //= require react 5 | //= require react_ujs 6 | //= require_tree ./vendor 7 | //= require components 8 | 9 | // 10 | //= require_tree ./common 11 | -------------------------------------------------------------------------------- /app/assets/javascripts/application_desktop.js: -------------------------------------------------------------------------------- 1 | //= require ./application_common 2 | //= require_tree ./desktop 3 | -------------------------------------------------------------------------------- /app/assets/javascripts/application_phone.js: -------------------------------------------------------------------------------- 1 | //= require ./application_common 2 | //= require_tree ./phone 3 | -------------------------------------------------------------------------------- /app/assets/javascripts/common/active_admin.js: -------------------------------------------------------------------------------- 1 | #= require active_admin/base 2 | -------------------------------------------------------------------------------- /app/assets/javascripts/common/bootstrap.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | $("a[rel~=popover], .has-popover").popover(); 4 | 5 | return $("a[rel~=tooltip], .has-tooltip").tooltip(); 6 | 7 | }); 8 | -------------------------------------------------------------------------------- /app/assets/javascripts/common/modal_behavior.js: -------------------------------------------------------------------------------- 1 | if ( Modal !== undefined ) { 2 | alert('Modal is already defined'); 3 | } 4 | 5 | var Modal = (function() { 6 | 7 | var modalContentSelector = "[data-behavior ~= modal-content]", 8 | modalContainerSelector = "[data-behavior ~= modal-container]"; 9 | 10 | function _displayModal(link) { 11 | var $modalContainer = _findOrCreateModalContainer(), 12 | url = link.data('url'); 13 | 14 | $modalContainer.load(url, function() { 15 | var $element = $(this).find(modalContentSelector); 16 | $element.show(); 17 | $element.find('[data-focus~=true]').focus(); 18 | }); 19 | } 20 | 21 | function _findOrCreateModalContainer() { 22 | var element; 23 | 24 | if ($(modalContainerSelector).length) { 25 | element = $(modalContainerSelector); 26 | } else { 27 | element = $('
'); 28 | $('body').append(element); 29 | } 30 | 31 | return element 32 | }; 33 | 34 | function _formSubmissionResponseHandler(data) { 35 | var modalContainer = _findOrCreateModalContainer(); 36 | 37 | if (data.modal_content) { 38 | modalContainer.html(data.modal_content) 39 | modalContainer.find(modalContentSelector).show(); 40 | 41 | } else if (data.redirect_to) { 42 | window.location.href = data.redirect_to; 43 | 44 | } else { 45 | modalContainer.find(modalContentSelector).hide(); 46 | }; 47 | } 48 | 49 | function displayInModal(event) { 50 | event.preventDefault(); 51 | _displayModal($(this)); 52 | }; 53 | 54 | function hide(event) { 55 | event.preventDefault() 56 | $(this).closest(modalContentSelector).hide(); 57 | }; 58 | 59 | function submitForm(event){ 60 | var form = $(this); 61 | event.preventDefault(); 62 | 63 | $.ajax({ 64 | type: form.attr('method'), 65 | url: form.attr('action'), 66 | data: form.serialize() 67 | }).done(_formSubmissionResponseHandler); 68 | }; 69 | 70 | return { "displayInModal": displayInModal, 71 | "hide": hide, 72 | "submitForm": submitForm } 73 | 74 | })(); 75 | 76 | $(document).on('click', 'a[data-behavior ~= display-in-modal]', Modal.displayInModal); 77 | $(document).on("click", "[data-behavior ~= modal-close]", Modal.hide) 78 | $(document).on('submit', "[data-behavior ~= modal-container] form", Modal.submitForm) 79 | -------------------------------------------------------------------------------- /app/assets/javascripts/components.js: -------------------------------------------------------------------------------- 1 | //= require_tree ./components 2 | -------------------------------------------------------------------------------- /app/assets/javascripts/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vipulnsward/react-rails-examples/a8fdfc190d6ffbddfe11c9e9c7574345ad8ad9c8/app/assets/javascripts/components/.gitkeep -------------------------------------------------------------------------------- /app/assets/javascripts/components/comments/CommentsNew.js.jsx: -------------------------------------------------------------------------------- 1 | class CommentsNew extends React.Component { 2 | constructor(props) { 3 | super(props); 4 | var {post} = this.props; 5 | post = JSON.parse(post); 6 | 7 | this.state = {user_id: this.props.user_id, post: post} 8 | } 9 | 10 | render() { 11 | var errorMessage = this.renderError(); 12 | return ( 13 |
14 | {errorMessage} 15 |
16 | 17 |
18 |