\ No newline at end of file
diff --git a/app/views/comments/_comment_comments.html.erb b/app/views/comments/_comment_comments.html.erb
new file mode 100644
index 000000000..6db717eac
--- /dev/null
+++ b/app/views/comments/_comment_comments.html.erb
@@ -0,0 +1,15 @@
+<% comment.comments.each do |c| %>
+
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/comments/_comment_new.html.erb b/app/views/comments/_comment_new.html.erb
new file mode 100644
index 000000000..918247075
--- /dev/null
+++ b/app/views/comments/_comment_new.html.erb
@@ -0,0 +1,22 @@
+
\ No newline at end of file
diff --git a/app/views/comments/_new_comment.html.erb b/app/views/comments/_new_comment.html.erb
new file mode 100644
index 000000000..7eac0975f
--- /dev/null
+++ b/app/views/comments/_new_comment.html.erb
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/app/views/posts/_new_post.html.erb b/app/views/posts/_new_post.html.erb
new file mode 100644
index 000000000..17495ab43
--- /dev/null
+++ b/app/views/posts/_new_post.html.erb
@@ -0,0 +1,12 @@
+
+
+
Post
+
+ <%= form_for [user, post], remote: true do |p| %>
+ <%= p.text_area :content, placeholder: "What's on your mind?", class: "new-post-text-area", cols: 62, rows: 7 %>
+ <%= p.submit "Post to the world!", class: "btn btn-primary center-block" %>
+ <% end %>
+
+
+
+
diff --git a/app/views/posts/_post.html.erb b/app/views/posts/_post.html.erb
new file mode 100644
index 000000000..6a2d50c80
--- /dev/null
+++ b/app/views/posts/_post.html.erb
@@ -0,0 +1,38 @@
+
\ No newline at end of file
diff --git a/app/views/profiles/update.html.erb b/app/views/profiles/update.html.erb
new file mode 100644
index 000000000..e3e90c203
--- /dev/null
+++ b/app/views/profiles/update.html.erb
@@ -0,0 +1,2 @@
+
Profile#update
+
Find me in app/views/profile/update.html.erb
diff --git a/app/views/relationships/_pending_friend_request.html.erb b/app/views/relationships/_pending_friend_request.html.erb
new file mode 100644
index 000000000..3caf99ebb
--- /dev/null
+++ b/app/views/relationships/_pending_friend_request.html.erb
@@ -0,0 +1,14 @@
+
+ <% current_user.been_friended.each do |friend_request| %>
+ <% user = User.find(friend_request.id) %>
+ <% if !current_user.friends.include?(user) %>
+ <%= user.name %> wants to be you friend!
+ <%= form_for(current_user.friended_relationships.build) do |f| %>
+
<%= hidden_field_tag :friended_id, user.id %>
+ <%= f.submit "Friend", class: "btn btn-primary same-line" %>
+ <% end %>
+ <%= link_to "Delete request", relationship_path(Relationship.where(friender_id: user.id ).where(friended_id: current_user.id).first),
+ method: :delete, data: {confirm: "Are you sure you want to delete #{user.name}'s friend request?"}, class: "btn btn-danger same-line" %>
+ <% end %>
+ <% end %>
+
+ <% if (@user == current_user) || (friend.friends.include?(current_user)) %>
+ <%= link_to friend.name, user_profiles_path(friend) %>
+ <% end %>
+
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/shared/_flash.html.erb b/app/views/shared/_flash.html.erb
new file mode 100644
index 000000000..f2c7dbfb6
--- /dev/null
+++ b/app/views/shared/_flash.html.erb
@@ -0,0 +1,5 @@
+
+ <% flash.each do |key, value| %>
+
<%= value %>
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/shared/_friend_button.html.erb b/app/views/shared/_friend_button.html.erb
new file mode 100644
index 000000000..29edd5e6d
--- /dev/null
+++ b/app/views/shared/_friend_button.html.erb
@@ -0,0 +1,21 @@
+<% if current_user %>
+ <% if current_user == @user %>
+ <%= link_to "Edit", edit_user_profiles_path(@user) %>
+ <% elsif !current_user.friends.include?(@user) %>
+ <%= form_for(current_user.friended_relationships.build) do |f| %>
+
<%= hidden_field_tag :friended_id, @user.id %>
+ <%= f.submit "Friend", class: "btn btn-primary" %>
+ <% end %>
+ <% elsif current_user.friends.include?(@user) && !@user.friends.include?(current_user) %>
+ <%= form_for(current_user.friended_relationships.find_by(friended_id: @user.id),
+ html: { method: :delete },
+ data: {confirm: "Are you sure you want to delete that friend request?"}) do |f| %>
+ <%= f.submit "Pending Friend Request", class: "btn btn-danger" %>
+ <% end %>
+ <% else %>
+ <%= form_for(current_user.friended_relationships.find_by(friended_id: @user.id),
+ html: { method: :delete }) do |f| %>
+ <%= f.submit "Unfriend", class: "btn btn-danger" %>
+ <% end %>
+ <% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/shared/_profile_cover_photos.html.erb b/app/views/shared/_profile_cover_photos.html.erb
new file mode 100644
index 000000000..783bc3375
--- /dev/null
+++ b/app/views/shared/_profile_cover_photos.html.erb
@@ -0,0 +1,2 @@
+<%= image_tag("default_image.jpg", class: "profile-photo") %>
+<%= image_tag("default_cover.jpg", class: "cover-photo") %>
\ No newline at end of file
diff --git a/app/views/shared/_profile_header.html.erb b/app/views/shared/_profile_header.html.erb
new file mode 100644
index 000000000..96dfd2754
--- /dev/null
+++ b/app/views/shared/_profile_header.html.erb
@@ -0,0 +1,24 @@
+
\ No newline at end of file
diff --git a/app/views/shared/_search_navbar.html.erb b/app/views/shared/_search_navbar.html.erb
new file mode 100644
index 000000000..93f21716d
--- /dev/null
+++ b/app/views/shared/_search_navbar.html.erb
@@ -0,0 +1,47 @@
+
<%= link_to @commenter.first_name, @commenter %> just commented on a <%= @object.class.to_s.downcase%> of yours!
+
+
You can see it <%= link_to "here", "http://localhost:3000/users/#{@user.id}" %>
diff --git a/app/views/user_mailer/commented_by.text.erb b/app/views/user_mailer/commented_by.text.erb
new file mode 100644
index 000000000..738d46296
--- /dev/null
+++ b/app/views/user_mailer/commented_by.text.erb
@@ -0,0 +1,5 @@
+Hi <%= @user.first_name %>!
+
+<%= @commenter.first_name %> just commented on a <%= @object.class.to_s.downcase%> of yours!
+
+You can see it here: <%= link_to @user.first_name, "http://localhost:3000/users/#{@user.id}" %>
diff --git a/app/views/user_mailer/welcome.html.erb b/app/views/user_mailer/welcome.html.erb
new file mode 100644
index 000000000..2f1e82ae5
--- /dev/null
+++ b/app/views/user_mailer/welcome.html.erb
@@ -0,0 +1,9 @@
+
Welcome!
+
+
+ Hi <%= @user.first_name %>, welcome to DaneBook!!
+
+
+
+ View your account at <%= link_to @user.first_name, "http://localhost:3000/users/#{@user.id}" %>
+
\ No newline at end of file
diff --git a/app/views/user_mailer/welcome.text.erb b/app/views/user_mailer/welcome.text.erb
new file mode 100644
index 000000000..19081ea6b
--- /dev/null
+++ b/app/views/user_mailer/welcome.text.erb
@@ -0,0 +1,3 @@
+Hi <%= @user.first_name %>, and welcome to Danebook!
+
+View your account at <%= link_to @user.first_name, "http://localhost:3000/users/#{@user.id}" %>
\ No newline at end of file
diff --git a/app/views/users/_new_navbar.html.erb b/app/views/users/_new_navbar.html.erb
new file mode 100644
index 000000000..a6c98dfc3
--- /dev/null
+++ b/app/views/users/_new_navbar.html.erb
@@ -0,0 +1,47 @@
+
+
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb
new file mode 100644
index 000000000..1881fbdba
--- /dev/null
+++ b/app/views/users/edit.html.erb
@@ -0,0 +1,2 @@
+
Users#edit
+
Find me in app/views/users/edit.html.erb
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
new file mode 100644
index 000000000..f2381a2fb
--- /dev/null
+++ b/app/views/users/index.html.erb
@@ -0,0 +1,9 @@
+
Users#index
+
Find me in app/views/users/index.html.erb
+<%= render "shared/flash" %>
+
+<% @users.each do |user| %>
+ <%= link_to user.first_name +
+ user.last_name, user_path(user) %>
+ <%= user.email %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb
new file mode 100644
index 000000000..d1d0cb96a
--- /dev/null
+++ b/app/views/users/new.html.erb
@@ -0,0 +1,38 @@
+<%= render "new_navbar" %>
+<%= render "shared/flash" %>
+
+
+
+
+
Connect with all of your friends!
+
+
See photos and updates in your news feed
+
Post your status for the world to see on your proile
+ <% if current_user #&& current_user.friends.include?(@user) %>
+
+
+ <%= render partial: "posts/new_post", locals: {post: @post, user: @user} if @post && current_user%>
+ <% @posts.each do |post|%>
+ <%= render partial: "posts/post", locals: {post: post, user: @user} %>
+ <% end %>
+
+
+ <% end %>
+
diff --git a/bin/bundle b/bin/bundle
new file mode 100755
index 000000000..66e9889e8
--- /dev/null
+++ b/bin/bundle
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+load Gem.bin_path('bundler', 'bundle')
diff --git a/bin/rails b/bin/rails
new file mode 100755
index 000000000..5badb2fde
--- /dev/null
+++ b/bin/rails
@@ -0,0 +1,9 @@
+#!/usr/bin/env ruby
+begin
+ load File.expand_path('../spring', __FILE__)
+rescue LoadError => e
+ raise unless e.message.include?('spring')
+end
+APP_PATH = File.expand_path('../config/application', __dir__)
+require_relative '../config/boot'
+require 'rails/commands'
diff --git a/bin/rake b/bin/rake
new file mode 100755
index 000000000..d87d5f578
--- /dev/null
+++ b/bin/rake
@@ -0,0 +1,9 @@
+#!/usr/bin/env ruby
+begin
+ load File.expand_path('../spring', __FILE__)
+rescue LoadError => e
+ raise unless e.message.include?('spring')
+end
+require_relative '../config/boot'
+require 'rake'
+Rake.application.run
diff --git a/bin/setup b/bin/setup
new file mode 100755
index 000000000..e620b4dad
--- /dev/null
+++ b/bin/setup
@@ -0,0 +1,34 @@
+#!/usr/bin/env ruby
+require 'pathname'
+require 'fileutils'
+include FileUtils
+
+# path to your application root.
+APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
+
+def system!(*args)
+ system(*args) || abort("\n== Command #{args} failed ==")
+end
+
+chdir APP_ROOT do
+ # This script is a starting point to setup your application.
+ # Add necessary setup steps to this file.
+
+ puts '== Installing dependencies =='
+ system! 'gem install bundler --conservative'
+ system('bundle check') || system!('bundle install')
+
+ # puts "\n== Copying sample files =="
+ # unless File.exist?('config/database.yml')
+ # cp 'config/database.yml.sample', 'config/database.yml'
+ # end
+
+ puts "\n== Preparing database =="
+ system! 'bin/rails db:setup'
+
+ puts "\n== Removing old logs and tempfiles =="
+ system! 'bin/rails log:clear tmp:clear'
+
+ puts "\n== Restarting application server =="
+ system! 'bin/rails restart'
+end
diff --git a/bin/spring b/bin/spring
new file mode 100755
index 000000000..7fe232c3a
--- /dev/null
+++ b/bin/spring
@@ -0,0 +1,15 @@
+#!/usr/bin/env ruby
+
+# This file loads spring without using Bundler, in order to be fast.
+# It gets overwritten when you run the `spring binstub` command.
+
+unless defined?(Spring)
+ require 'rubygems'
+ require 'bundler'
+
+ if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m))
+ Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }
+ gem 'spring', match[1]
+ require 'spring/binstub'
+ end
+end
diff --git a/bin/update b/bin/update
new file mode 100755
index 000000000..a8e4462f2
--- /dev/null
+++ b/bin/update
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+require 'pathname'
+require 'fileutils'
+include FileUtils
+
+# path to your application root.
+APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
+
+def system!(*args)
+ system(*args) || abort("\n== Command #{args} failed ==")
+end
+
+chdir APP_ROOT do
+ # This script is a way to update your development environment automatically.
+ # Add necessary update steps to this file.
+
+ puts '== Installing dependencies =='
+ system! 'gem install bundler --conservative'
+ system('bundle check') || system!('bundle install')
+
+ puts "\n== Updating database =="
+ system! 'bin/rails db:migrate'
+
+ puts "\n== Removing old logs and tempfiles =="
+ system! 'bin/rails log:clear tmp:clear'
+
+ puts "\n== Restarting application server =="
+ system! 'bin/rails restart'
+end
diff --git a/config.ru b/config.ru
new file mode 100644
index 000000000..f7ba0b527
--- /dev/null
+++ b/config.ru
@@ -0,0 +1,5 @@
+# This file is used by Rack-based servers to start the application.
+
+require_relative 'config/environment'
+
+run Rails.application
diff --git a/config/application.rb b/config/application.rb
new file mode 100644
index 000000000..af54ad3ac
--- /dev/null
+++ b/config/application.rb
@@ -0,0 +1,15 @@
+require_relative 'boot'
+
+require 'rails/all'
+
+# Require the gems listed in Gemfile, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(*Rails.groups)
+
+module ProjectDanebook
+ class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+ end
+end
diff --git a/config/boot.rb b/config/boot.rb
new file mode 100644
index 000000000..30f5120df
--- /dev/null
+++ b/config/boot.rb
@@ -0,0 +1,3 @@
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
+
+require 'bundler/setup' # Set up gems listed in the Gemfile.
diff --git a/config/cable.yml b/config/cable.yml
new file mode 100644
index 000000000..0bbde6f74
--- /dev/null
+++ b/config/cable.yml
@@ -0,0 +1,9 @@
+development:
+ adapter: async
+
+test:
+ adapter: async
+
+production:
+ adapter: redis
+ url: redis://localhost:6379/1
diff --git a/config/database.yml b/config/database.yml
new file mode 100644
index 000000000..57fcbb54e
--- /dev/null
+++ b/config/database.yml
@@ -0,0 +1,25 @@
+# SQLite version 3.x
+# gem install sqlite3
+#
+# Ensure the SQLite 3 gem is defined in your Gemfile
+# gem 'sqlite3'
+#
+default: &default
+ adapter: postgresql
+ pool: 5
+ timeout: 5000
+
+development:
+ <<: *default
+ database: db/danebook_development
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+ <<: *default
+ database: db/danebook_test
+
+production:
+ <<: *default
+ database: db/danebook_production
diff --git a/config/environment.rb b/config/environment.rb
new file mode 100644
index 000000000..426333bb4
--- /dev/null
+++ b/config/environment.rb
@@ -0,0 +1,5 @@
+# Load the Rails application.
+require_relative 'application'
+
+# Initialize the Rails application.
+Rails.application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
new file mode 100644
index 000000000..ae2427fca
--- /dev/null
+++ b/config/environments/development.rb
@@ -0,0 +1,75 @@
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+ Paperclip.options[:command_path] = "/usr/local/bin"
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the web server when you make code changes.
+ config.cache_classes = false
+
+ config.action_mailer.delivery_method = :letter_opener
+
+ config.action_mailer.default_url_options = {:host => 'localhost:3000'}
+
+ config.paperclip_defaults = {
+
+ :storage => :s3,
+
+ :s3_credentials => {
+
+
+ :host_name => "dylanlynch.s3-website-us-east-1.amazonaws.com",
+
+
+ :bucket => Rails.application.secrets.s3_bucket_name,
+ :access_key_id => Rails.application.secrets.s3_api_id,
+ :secret_access_key => Rails.application.secrets.s3_api_key,
+ :s3_region=> Rails.application.secrets.s3_region
+ }
+}
+
+ # Do not eager load code on boot.
+ config.eager_load = false
+
+ # Show full error reports.
+ config.consider_all_requests_local = true
+
+ # Enable/disable caching. By default caching is disabled.
+ if Rails.root.join('tmp/caching-dev.txt').exist?
+ config.action_controller.perform_caching = true
+
+ config.cache_store = :memory_store
+ config.public_file_server.headers = {
+ 'Cache-Control' => 'public, max-age=172800'
+ }
+ else
+ config.action_controller.perform_caching = false
+
+ config.cache_store = :null_store
+ end
+
+ # Don't care if the mailer can't send.
+ config.action_mailer.raise_delivery_errors = false
+
+ config.action_mailer.perform_caching = false
+
+ # Print deprecation notices to the Rails logger.
+ config.active_support.deprecation = :log
+
+ # Raise an error on page load if there are pending migrations.
+ config.active_record.migration_error = :page_load
+
+ # Debug mode disables concatenation and preprocessing of assets.
+ # This option may cause significant delays in view rendering with a large
+ # number of complex assets.
+ config.assets.debug = true
+
+ # Suppress logger output for asset requests.
+ config.assets.quiet = true
+
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
+
+ # Use an evented file watcher to asynchronously detect changes in source code,
+ # routes, locales, etc. This feature depends on the listen gem.
+ config.file_watcher = ActiveSupport::EventedFileUpdateChecker
+end
diff --git a/config/environments/production.rb b/config/environments/production.rb
new file mode 100644
index 000000000..18833845a
--- /dev/null
+++ b/config/environments/production.rb
@@ -0,0 +1,108 @@
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # Code is not reloaded between requests.
+ config.cache_classes = true
+
+ # Eager load code on boot. This eager loads most of Rails and
+ # your application in memory, allowing both threaded web servers
+ # and those relying on copy on write to perform better.
+ # Rake tasks automatically ignore this option for performance.
+ config.eager_load = true
+
+ # Full error reports are disabled and caching is turned on.
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Disable serving static files from the `/public` folder by default since
+ # Apache or NGINX already handles this.
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
+
+ config.action_mailer.default_url_options = {
+ :host => 'https://stormy-forest-22873.herokuapp.com/',
+ }
+
+ config.action_mailer.delivery_method = :letter_opener
+
+ config.paperclip_defaults = {
+
+ :storage => :s3,
+
+ :s3_credentials => {
+
+
+ :host_name => "dylanlynch.s3-website-us-east-1.amazonaws.com",
+
+
+ :bucket => Rails.application.secrets.s3_bucket_name,
+ :access_key_id => Rails.application.secrets.s3_api_id,
+ :secret_access_key => Rails.application.secrets.s3_api_key,
+ :s3_region=> Rails.application.secrets.s3_region
+ }
+}
+ # Compress JavaScripts and CSS.
+ config.assets.js_compressor = :uglifier
+ # config.assets.css_compressor = :sass
+
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
+ config.assets.compile = false
+
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
+
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
+ # config.action_controller.asset_host = 'http://assets.example.com'
+
+ # Specifies the header that your server uses for sending files.
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
+
+ # Mount Action Cable outside main process or domain
+ # config.action_cable.mount_path = nil
+ # config.action_cable.url = 'wss://example.com/cable'
+ # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
+
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
+
+ # Use the lowest log level to ensure availability of diagnostic information
+ # when problems arise.
+ config.log_level = :debug
+
+ # Prepend all log lines with the following tags.
+ config.log_tags = [ :request_id ]
+
+ # Use a different cache store in production.
+ # config.cache_store = :mem_cache_store
+
+ # Use a real queuing backend for Active Job (and separate queues per environment)
+ # config.active_job.queue_adapter = :resque
+ # config.active_job.queue_name_prefix = "project_danebook_#{Rails.env}"
+ config.action_mailer.perform_caching = false
+
+ # Ignore bad email addresses and do not raise email delivery errors.
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation cannot be found).
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners.
+ config.active_support.deprecation = :notify
+
+ # Use default logging formatter so that PID and timestamp are not suppressed.
+ config.log_formatter = ::Logger::Formatter.new
+
+ # Use a different logger for distributed setups.
+ # require 'syslog/logger'
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
+
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
+ logger = ActiveSupport::Logger.new(STDOUT)
+ logger.formatter = config.log_formatter
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
+ end
+
+ # Do not dump schema after migrations.
+ config.active_record.dump_schema_after_migration = false
+end
diff --git a/config/environments/test.rb b/config/environments/test.rb
new file mode 100644
index 000000000..30587ef6d
--- /dev/null
+++ b/config/environments/test.rb
@@ -0,0 +1,42 @@
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
+
+ # Do not eager load code on boot. This avoids loading your whole application
+ # just for the purpose of running a single test. If you are using a tool that
+ # preloads Rails for running tests, you may have to set it to true.
+ config.eager_load = false
+
+ # Configure public file server for tests with Cache-Control for performance.
+ config.public_file_server.enabled = true
+ config.public_file_server.headers = {
+ 'Cache-Control' => 'public, max-age=3600'
+ }
+
+ # Show full error reports and disable caching.
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Raise exceptions instead of rendering exception templates.
+ config.action_dispatch.show_exceptions = false
+
+ # Disable request forgery protection in test environment.
+ config.action_controller.allow_forgery_protection = false
+ config.action_mailer.perform_caching = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # Print deprecation notices to the stderr.
+ config.active_support.deprecation = :stderr
+
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
+end
diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb
new file mode 100644
index 000000000..51639b67a
--- /dev/null
+++ b/config/initializers/application_controller_renderer.rb
@@ -0,0 +1,6 @@
+# Be sure to restart your server when you modify this file.
+
+# ApplicationController.renderer.defaults.merge!(
+# http_host: 'example.org',
+# https: false
+# )
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
new file mode 100644
index 000000000..01ef3e663
--- /dev/null
+++ b/config/initializers/assets.rb
@@ -0,0 +1,11 @@
+# Be sure to restart your server when you modify this file.
+
+# Version of your assets, change this if you want to expire all your assets.
+Rails.application.config.assets.version = '1.0'
+
+# Add additional assets to the asset load path
+# Rails.application.config.assets.paths << Emoji.images_path
+
+# Precompile additional assets.
+# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
+# Rails.application.config.assets.precompile += %w( search.js )
diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb
new file mode 100644
index 000000000..59385cdf3
--- /dev/null
+++ b/config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb
new file mode 100644
index 000000000..5a6a32d37
--- /dev/null
+++ b/config/initializers/cookies_serializer.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
+# Specify a serializer for the signed and encrypted cookie jars.
+# Valid options are :json, :marshal, and :hybrid.
+Rails.application.config.action_dispatch.cookies_serializer = :json
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb
new file mode 100644
index 000000000..4a994e1e7
--- /dev/null
+++ b/config/initializers/filter_parameter_logging.rb
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Configure sensitive parameters which will be filtered from the log file.
+Rails.application.config.filter_parameters += [:password]
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
new file mode 100644
index 000000000..ac033bf9d
--- /dev/null
+++ b/config/initializers/inflections.rb
@@ -0,0 +1,16 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format. Inflections
+# are locale specific, and you may define rules for as many different
+# locales as you wish. All of these examples are active by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
+
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.acronym 'RESTful'
+# end
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
new file mode 100644
index 000000000..dc1899682
--- /dev/null
+++ b/config/initializers/mime_types.rb
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb
new file mode 100644
index 000000000..0706cafd4
--- /dev/null
+++ b/config/initializers/new_framework_defaults.rb
@@ -0,0 +1,24 @@
+# Be sure to restart your server when you modify this file.
+#
+# This file contains migration options to ease your Rails 5.0 upgrade.
+#
+# Read the Rails 5.0 release notes for more info on each option.
+
+# Enable per-form CSRF tokens. Previous versions had false.
+Rails.application.config.action_controller.per_form_csrf_tokens = true
+
+# Enable origin-checking CSRF mitigation. Previous versions had false.
+Rails.application.config.action_controller.forgery_protection_origin_check = true
+
+# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
+# Previous versions had false.
+ActiveSupport.to_time_preserves_timezone = true
+
+# Require `belongs_to` associations by default. Previous versions had false.
+Rails.application.config.active_record.belongs_to_required_by_default = true
+
+# Do not halt callback chains when a callback returns false. Previous versions had true.
+ActiveSupport.halt_callback_chains_on_return_false = false
+
+# Configure SSL options to enable HSTS with subdomains. Previous versions had false.
+Rails.application.config.ssl_options = { hsts: { subdomains: true } }
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
new file mode 100644
index 000000000..f2d118131
--- /dev/null
+++ b/config/initializers/session_store.rb
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.config.session_store :cookie_store, key: '_project_danebook_session'
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
new file mode 100644
index 000000000..bbfc3961b
--- /dev/null
+++ b/config/initializers/wrap_parameters.rb
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters format: [:json]
+end
+
+# To enable root element in JSON for ActiveRecord objects.
+# ActiveSupport.on_load(:active_record) do
+# self.include_root_in_json = true
+# end
diff --git a/config/locales/en.yml b/config/locales/en.yml
new file mode 100644
index 000000000..065395716
--- /dev/null
+++ b/config/locales/en.yml
@@ -0,0 +1,23 @@
+# Files in the config/locales directory are used for internationalization
+# and are automatically loaded by Rails. If you want to use locales other
+# than English, add the necessary files in this directory.
+#
+# To use the locales, use `I18n.t`:
+#
+# I18n.t 'hello'
+#
+# In views, this is aliased to just `t`:
+#
+# <%= t('hello') %>
+#
+# To use a different locale, set it with `I18n.locale`:
+#
+# I18n.locale = :es
+#
+# This would use the information in config/locales/es.yml.
+#
+# To learn more, please read the Rails Internationalization guide
+# available at http://guides.rubyonrails.org/i18n.html.
+
+en:
+ hello: "Hello world"
diff --git a/config/puma.rb b/config/puma.rb
new file mode 100644
index 000000000..c7f311f81
--- /dev/null
+++ b/config/puma.rb
@@ -0,0 +1,47 @@
+# Puma can serve each request in a thread from an internal thread pool.
+# The `threads` method setting takes two numbers a minimum and maximum.
+# Any libraries that use thread pools should be configured to match
+# the maximum value specified for Puma. Default is set to 5 threads for minimum
+# and maximum, this matches the default thread size of Active Record.
+#
+threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
+threads threads_count, threads_count
+
+# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
+#
+port ENV.fetch("PORT") { 3000 }
+
+# Specifies the `environment` that Puma will run in.
+#
+environment ENV.fetch("RAILS_ENV") { "development" }
+
+# Specifies the number of `workers` to boot in clustered mode.
+# Workers are forked webserver processes. If using threads and workers together
+# the concurrency of the application would be max `threads` * `workers`.
+# Workers do not work on JRuby or Windows (both of which do not support
+# processes).
+#
+# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
+
+# Use the `preload_app!` method when specifying a `workers` number.
+# This directive tells Puma to first boot the application and load code
+# before forking the application. This takes advantage of Copy On Write
+# process behavior so workers use less memory. If you use this option
+# you need to make sure to reconnect any threads in the `on_worker_boot`
+# block.
+#
+# preload_app!
+
+# The code in the `on_worker_boot` will be called if you are using
+# clustered mode by specifying a number of `workers`. After each worker
+# process is booted this block will be run, if you are using `preload_app!`
+# option you will want to use this block to reconnect to any threads
+# or connections that may have been created at application boot, Ruby
+# cannot share connections between processes.
+#
+# on_worker_boot do
+# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
+# end
+
+# Allow puma to be restarted by `rails restart` command.
+plugin :tmp_restart
diff --git a/config/routes.rb b/config/routes.rb
new file mode 100644
index 000000000..7733f6824
--- /dev/null
+++ b/config/routes.rb
@@ -0,0 +1,38 @@
+Rails.application.routes.draw do
+
+ get 'comments/new'
+
+ resources :users do
+ resource :profiles, only: [:edit, :show, :update]
+ resources :posts, only: [:create, :destroy]
+ resources :photos
+ resources :relationships, only: [:index]
+ end
+
+ resources :posts do
+ resources :comments, defaults: {commentable: "Post"}
+ resources :likes, defaults: {likeable: "Post"}
+ end
+
+ resources :comments do
+ resources :comments, defaults: {commentable: "Comment"}
+ resources :likes, defaults: {likeable: "Comment"}
+ end
+
+ resources :photos do
+ resources :comments, defaults: {commentable: "Photo"}
+ resources :likes, defaults: {likeable: "Photo"}
+ end
+
+ resources :relationships, only: [:create, :destroy]
+
+ root "users#new"
+
+ resource :session, :only => [:new, :create, :destroy]
+ get "login" => "sessions#new"
+ delete "logout" => "sessions#destroy"
+
+ get '*path' => redirect("/")
+
+ # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
+end
diff --git a/config/secrets.yml b/config/secrets.yml
new file mode 100644
index 000000000..507796a0a
--- /dev/null
+++ b/config/secrets.yml
@@ -0,0 +1,30 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key is used for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+# You can use `rails secret` to generate a secure secret key.
+
+# Make sure the secrets in this file are kept private
+# if you're sharing your code publicly.
+
+development:
+ secret_key_base: 4a8ab98976c8adefce7471fd7a3d1c240af246cc1dc57ead037ac053faab4f42b5d9f0ee2c3017d9825c535efe6a3e6e87ca18b841207161b336a9e14f5cfee4
+ s3_bucket_name: <%= ENV["S3_BUCKET_NAME"] %>
+ s3_api_id: <%= ENV["S3_API_ID"] %>
+ s3_api_key: <%= ENV["S3_API_KEY"] %>
+ s3_region: <%= ENV["S3_REGION"] %>
+
+test:
+ secret_key_base: 8ed5c1fef5f8594431a217909d96653bfd594285b6180e7786c16347f7f4671ae5a32a2104643aeaf846a87f832b0f59cbc2595fe2c204f720ae792e1a23b17c
+
+# Do not keep production secrets in the repository,
+# instead read values from the environment.
+production:
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
+ s3_bucket_name: <%= ENV["S3_BUCKET_NAME"] %>
+ s3_api_id: <%= ENV["S3_API_ID"] %>
+ s3_api_key: <%= ENV["S3_API_KEY"] %>
+ s3_region: <%= ENV["S3_REGION"] %>
diff --git a/config/spring.rb b/config/spring.rb
new file mode 100644
index 000000000..c9119b40c
--- /dev/null
+++ b/config/spring.rb
@@ -0,0 +1,6 @@
+%w(
+ .ruby-version
+ .rbenv-vars
+ tmp/restart.txt
+ tmp/caching-dev.txt
+).each { |path| Spring.watch(path) }
diff --git a/db/migrate/20160810213213_create_users.rb b/db/migrate/20160810213213_create_users.rb
new file mode 100644
index 000000000..851ed6b47
--- /dev/null
+++ b/db/migrate/20160810213213_create_users.rb
@@ -0,0 +1,8 @@
+class CreateUsers < ActiveRecord::Migration[5.0]
+ def change
+ create_table :users do |t|
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20160810214240_add_password_and_email_to_user.rb b/db/migrate/20160810214240_add_password_and_email_to_user.rb
new file mode 100644
index 000000000..2024bb0fd
--- /dev/null
+++ b/db/migrate/20160810214240_add_password_and_email_to_user.rb
@@ -0,0 +1,6 @@
+class AddPasswordAndEmailToUser < ActiveRecord::Migration[5.0]
+ def change
+ add_column :users, :email, :string
+ add_column :users, :password_digest, :string
+ end
+end
diff --git a/db/migrate/20160810220240_add_auth_token.rb b/db/migrate/20160810220240_add_auth_token.rb
new file mode 100644
index 000000000..c0f80d652
--- /dev/null
+++ b/db/migrate/20160810220240_add_auth_token.rb
@@ -0,0 +1,6 @@
+class AddAuthToken < ActiveRecord::Migration[5.0]
+ def change
+ add_column :users, :auth_token, :string
+ add_index :users, :auth_token, :unique => true
+ end
+end
diff --git a/db/migrate/20160810232400_create_profiles.rb b/db/migrate/20160810232400_create_profiles.rb
new file mode 100644
index 000000000..b700877f2
--- /dev/null
+++ b/db/migrate/20160810232400_create_profiles.rb
@@ -0,0 +1,15 @@
+class CreateProfiles < ActiveRecord::Migration[5.0]
+ def change
+ create_table :profiles do |t|
+ t.references :user, foreign_key: true
+ t.string :month
+ t.integer :year
+ t.integer :day
+ t.string :college
+ t.string :hometown
+ t.string :current_location
+ t.string :telephone
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20160811195710_add_first_name_last_name_to_user.rb b/db/migrate/20160811195710_add_first_name_last_name_to_user.rb
new file mode 100644
index 000000000..f71848b74
--- /dev/null
+++ b/db/migrate/20160811195710_add_first_name_last_name_to_user.rb
@@ -0,0 +1,6 @@
+class AddFirstNameLastNameToUser < ActiveRecord::Migration[5.0]
+ def change
+ add_column :users, :first_name, :string
+ add_column :users, :last_name, :string
+ end
+end
diff --git a/db/migrate/20160811214951_create_photos.rb b/db/migrate/20160811214951_create_photos.rb
new file mode 100644
index 000000000..5a536ef74
--- /dev/null
+++ b/db/migrate/20160811214951_create_photos.rb
@@ -0,0 +1,9 @@
+class CreatePhotos < ActiveRecord::Migration[5.0]
+ def change
+ create_table :photos do |t|
+ t.references :profile, foreign_key: true
+ t.string :url
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20160812160556_add_profile_text_attributes.rb b/db/migrate/20160812160556_add_profile_text_attributes.rb
new file mode 100644
index 000000000..663201851
--- /dev/null
+++ b/db/migrate/20160812160556_add_profile_text_attributes.rb
@@ -0,0 +1,6 @@
+class AddProfileTextAttributes < ActiveRecord::Migration[5.0]
+ def change
+ add_column :profiles, :about_me, :text
+ add_column :profiles, :words_to_live_by, :text
+ end
+end
diff --git a/db/migrate/20160812180656_add_birthday_to_profile.rb b/db/migrate/20160812180656_add_birthday_to_profile.rb
new file mode 100644
index 000000000..cf9391c24
--- /dev/null
+++ b/db/migrate/20160812180656_add_birthday_to_profile.rb
@@ -0,0 +1,5 @@
+class AddBirthdayToProfile < ActiveRecord::Migration[5.0]
+ def change
+ add_column :profiles, :birthday, :date
+ end
+end
diff --git a/db/migrate/20160812182041_create_posts.rb b/db/migrate/20160812182041_create_posts.rb
new file mode 100644
index 000000000..c2daa0c3e
--- /dev/null
+++ b/db/migrate/20160812182041_create_posts.rb
@@ -0,0 +1,10 @@
+class CreatePosts < ActiveRecord::Migration[5.0]
+ def change
+ create_table :posts do |t|
+ t.references :user, foreign_key: true
+ t.text :content
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20160812221758_create_comments.rb b/db/migrate/20160812221758_create_comments.rb
new file mode 100644
index 000000000..b4c493fb1
--- /dev/null
+++ b/db/migrate/20160812221758_create_comments.rb
@@ -0,0 +1,11 @@
+class CreateComments < ActiveRecord::Migration[5.0]
+ def change
+ create_table :comments do |t|
+ t.references :user
+ t.string :type
+ t.text :content
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20160812225137_add_unique_to_email.rb b/db/migrate/20160812225137_add_unique_to_email.rb
new file mode 100644
index 000000000..e1bbce28f
--- /dev/null
+++ b/db/migrate/20160812225137_add_unique_to_email.rb
@@ -0,0 +1,5 @@
+class AddUniqueToEmail < ActiveRecord::Migration[5.0]
+ def change
+ add_index :users, :email, :unique => true
+ end
+end
diff --git a/db/migrate/20160814021709_add_to_id_to_posts.rb b/db/migrate/20160814021709_add_to_id_to_posts.rb
new file mode 100644
index 000000000..94466231b
--- /dev/null
+++ b/db/migrate/20160814021709_add_to_id_to_posts.rb
@@ -0,0 +1,5 @@
+class AddToIdToPosts < ActiveRecord::Migration[5.0]
+ def change
+ add_column :posts, :from, :integer
+ end
+end
diff --git a/db/migrate/20160814151629_add_commentable_type_id.rb b/db/migrate/20160814151629_add_commentable_type_id.rb
new file mode 100644
index 000000000..ff1b2b2b8
--- /dev/null
+++ b/db/migrate/20160814151629_add_commentable_type_id.rb
@@ -0,0 +1,7 @@
+class AddCommentableTypeId < ActiveRecord::Migration[5.0]
+ def change
+ add_column :comments, :commentable_type, :string
+ add_column :comments, :commentable_id, :integer
+ add_index :comments, [:commentable_id, :commentable_type]
+ end
+end
diff --git a/db/migrate/20160815020752_remove_user_id_from_comment.rb b/db/migrate/20160815020752_remove_user_id_from_comment.rb
new file mode 100644
index 000000000..0db3513ff
--- /dev/null
+++ b/db/migrate/20160815020752_remove_user_id_from_comment.rb
@@ -0,0 +1,5 @@
+class RemoveUserIdFromComment < ActiveRecord::Migration[5.0]
+ def change
+ remove_column :comments, :user_id
+ end
+end
diff --git a/db/migrate/20160815030937_create_likes.rb b/db/migrate/20160815030937_create_likes.rb
new file mode 100644
index 000000000..fb550bdb0
--- /dev/null
+++ b/db/migrate/20160815030937_create_likes.rb
@@ -0,0 +1,11 @@
+class CreateLikes < ActiveRecord::Migration[5.0]
+ def change
+ create_table :likes do |t|
+ t.string :likeable_type
+ t.integer :likeable_id
+ t.references :user
+ t.timestamps
+ end
+ add_index :likes, [:likeable_id, :likeable_type]
+ end
+end
diff --git a/db/migrate/20160818214302_add_avatar_to_photos.rb b/db/migrate/20160818214302_add_avatar_to_photos.rb
new file mode 100644
index 000000000..6bfc1a25a
--- /dev/null
+++ b/db/migrate/20160818214302_add_avatar_to_photos.rb
@@ -0,0 +1,7 @@
+class AddAvatarToPhotos < ActiveRecord::Migration[5.0]
+ def change
+ add_attachment :photos, :picture
+ add_column :profiles, :cover_photo_id, :integer
+ add_column :profiles, :profile_photo_id, :integer
+ end
+end
diff --git a/db/migrate/20160819192645_add_from_on_comment_table.rb b/db/migrate/20160819192645_add_from_on_comment_table.rb
new file mode 100644
index 000000000..be3b71462
--- /dev/null
+++ b/db/migrate/20160819192645_add_from_on_comment_table.rb
@@ -0,0 +1,11 @@
+class AddFromOnCommentTable < ActiveRecord::Migration[5.0]
+ def change
+ add_column :comments, :from, :integer
+ add_column :likes, :from, :integer
+ add_column :comments, :user_id, :integer
+ add_index :comments, :user_id
+ add_column :photos, :user_id, :integer
+ add_index :photos, :user_id
+ remove_column :photos, :profile_id
+ end
+end
diff --git a/db/migrate/20160822172215_create_relationships.rb b/db/migrate/20160822172215_create_relationships.rb
new file mode 100644
index 000000000..308c577b3
--- /dev/null
+++ b/db/migrate/20160822172215_create_relationships.rb
@@ -0,0 +1,12 @@
+class CreateRelationships < ActiveRecord::Migration[5.0]
+ def change
+ create_table :relationships do |t|
+ t.integer :friender_id
+ t.integer :friended_id
+ t.timestamps
+ end
+ add_index :relationships, :friender_id
+ add_index :relationships, :friended_id
+ add_index :relationships, [:friender_id, :friended_id], unique: true
+ end
+end
diff --git a/db/migrate/20160822173552_add_description_to_pictures.rb b/db/migrate/20160822173552_add_description_to_pictures.rb
new file mode 100644
index 000000000..01f4e2ebc
--- /dev/null
+++ b/db/migrate/20160822173552_add_description_to_pictures.rb
@@ -0,0 +1,5 @@
+class AddDescriptionToPictures < ActiveRecord::Migration[5.0]
+ def change
+ add_column :photos, :description, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
new file mode 100644
index 000000000..78e5dfdcd
--- /dev/null
+++ b/db/schema.rb
@@ -0,0 +1,107 @@
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended that you check this file into your version control system.
+
+ActiveRecord::Schema.define(version: 20160822173552) do
+
+ # These are extensions that must be enabled in order to support this database
+ enable_extension "plpgsql"
+
+ create_table "comments", force: :cascade do |t|
+ t.string "type"
+ t.text "content"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "commentable_type"
+ t.integer "commentable_id"
+ t.integer "from"
+ t.integer "user_id"
+ t.index ["commentable_id", "commentable_type"], name: "index_comments_on_commentable_id_and_commentable_type", using: :btree
+ t.index ["user_id"], name: "index_comments_on_user_id", using: :btree
+ end
+
+ create_table "likes", force: :cascade do |t|
+ t.string "likeable_type"
+ t.integer "likeable_id"
+ t.integer "user_id"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.integer "from"
+ t.index ["likeable_id", "likeable_type"], name: "index_likes_on_likeable_id_and_likeable_type", using: :btree
+ t.index ["user_id"], name: "index_likes_on_user_id", using: :btree
+ end
+
+ create_table "photos", force: :cascade do |t|
+ t.string "url"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "picture_file_name"
+ t.string "picture_content_type"
+ t.integer "picture_file_size"
+ t.datetime "picture_updated_at"
+ t.integer "user_id"
+ t.string "description"
+ t.index ["user_id"], name: "index_photos_on_user_id", using: :btree
+ end
+
+ create_table "posts", force: :cascade do |t|
+ t.integer "user_id"
+ t.text "content"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.integer "from"
+ t.index ["user_id"], name: "index_posts_on_user_id", using: :btree
+ end
+
+ create_table "profiles", force: :cascade do |t|
+ t.integer "user_id"
+ t.string "month"
+ t.integer "year"
+ t.integer "day"
+ t.string "college"
+ t.string "hometown"
+ t.string "current_location"
+ t.string "telephone"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.text "about_me"
+ t.text "words_to_live_by"
+ t.date "birthday"
+ t.integer "cover_photo_id"
+ t.integer "profile_photo_id"
+ t.index ["user_id"], name: "index_profiles_on_user_id", using: :btree
+ end
+
+ create_table "relationships", force: :cascade do |t|
+ t.integer "friender_id"
+ t.integer "friended_id"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["friended_id"], name: "index_relationships_on_friended_id", using: :btree
+ t.index ["friender_id", "friended_id"], name: "index_relationships_on_friender_id_and_friended_id", unique: true, using: :btree
+ t.index ["friender_id"], name: "index_relationships_on_friender_id", using: :btree
+ end
+
+ create_table "users", force: :cascade do |t|
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "email"
+ t.string "password_digest"
+ t.string "auth_token"
+ t.string "first_name"
+ t.string "last_name"
+ t.index ["auth_token"], name: "index_users_on_auth_token", unique: true, using: :btree
+ t.index ["email"], name: "index_users_on_email", unique: true, using: :btree
+ end
+
+ add_foreign_key "posts", "users"
+ add_foreign_key "profiles", "users"
+end
diff --git a/db/seeds.rb b/db/seeds.rb
new file mode 100644
index 000000000..1beea2acc
--- /dev/null
+++ b/db/seeds.rb
@@ -0,0 +1,7 @@
+# This file should contain all the record creation needed to seed the database with its default values.
+# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
+#
+# Examples:
+#
+# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
+# Character.create(name: 'Luke', movie: movies.first)
diff --git a/lib/assets/.keep b/lib/assets/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/lib/tasks/.keep b/lib/tasks/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/log/.keep b/log/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/public/404.html b/public/404.html
new file mode 100644
index 000000000..b612547fc
--- /dev/null
+++ b/public/404.html
@@ -0,0 +1,67 @@
+
+
+
+ The page you were looking for doesn't exist (404)
+
+
+
+
+
+
+
+
+
The page you were looking for doesn't exist.
+
You may have mistyped the address or the page may have moved.
+
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/public/422.html b/public/422.html
new file mode 100644
index 000000000..a21f82b3b
--- /dev/null
+++ b/public/422.html
@@ -0,0 +1,67 @@
+
+
+
+ The change you wanted was rejected (422)
+
+
+
+
+
+
+
+
+
The change you wanted was rejected.
+
Maybe you tried to change something you didn't have access to.
+
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/public/500.html b/public/500.html
new file mode 100644
index 000000000..061abc587
--- /dev/null
+++ b/public/500.html
@@ -0,0 +1,66 @@
+
+
+
+ We're sorry, but something went wrong (500)
+
+
+
+
+
+
+
+
+
We're sorry, but something went wrong.
+
+
If you are the application owner check the logs for more information.
+-
+
+ <%= image_tag("default_image.jpg", class: "comment-picture") %>
+
+
+
+ <%= form_for [comment, comment.likes.build], remote: true do |like| %>
+ <%= like.hidden_field :user_id, value: current_user.id %>
+ <%= like.submit "Like", class: "btn btn-primary like-section"%>
+ <% end %>
+ <%= link_to "Delete Comment", comment_path(comment), method: :delete, class: "btn btn-danger delete-section delete-comment", remote: true, data: {comment_id: comment.id} if current_user == user%>
+ <%= render "comments/new_comment", comment: comment, new_comment: comment.comments.build, like: comment.likes.build%>
+
+
+
+
+Commented by: <%= link_to comment.commentable.user.first_name + " " + comment.commentable.user.last_name, user_profiles_path(comment.commentable.user) %> on <%= comment.created_at.strftime(' %b %d at %r')%>
+<%=comment.likes.count %> likes
+<%= comment.content %>
+