├── log └── .keep ├── tmp └── .keep ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── public ├── favicon.ico ├── apple-touch-icon.png ├── apple-touch-icon-precomposed.png ├── robots.txt ├── 500.html ├── 422.html └── 404.html ├── test ├── helpers │ └── .keep ├── mailers │ └── .keep ├── models │ └── .keep ├── controllers │ └── .keep ├── fixtures │ ├── .keep │ └── files │ │ └── .keep ├── integration │ └── .keep └── test_helper.rb ├── app ├── assets │ ├── images │ │ └── .keep │ ├── javascripts │ │ ├── channels │ │ │ └── .keep │ │ ├── cable.js │ │ └── application.js │ ├── config │ │ └── manifest.js │ └── stylesheets │ │ ├── api │ │ ├── booking_show.scss │ │ ├── modal.scss │ │ ├── booking.scss │ │ ├── header.scss │ │ ├── session.scss │ │ ├── host-show.scss │ │ ├── booking_form.scss │ │ ├── dashboard.scss │ │ ├── host-index.scss │ │ └── splash.scss │ │ └── application.css ├── models │ ├── concerns │ │ └── .keep │ ├── application_record.rb │ ├── host.rb │ ├── booking.rb │ └── user.rb ├── controllers │ ├── concerns │ │ └── .keep │ ├── static_pages_controller.rb │ ├── api │ │ ├── sessions_controller.rb │ │ ├── hosts_controller.rb │ │ ├── users_controller.rb │ │ └── bookings_controller.rb │ └── application_controller.rb ├── views │ ├── layouts │ │ ├── mailer.text.erb │ │ ├── mailer.html.erb │ │ └── application.html.erb │ ├── api │ │ ├── hosts │ │ │ ├── show.json.jbuilder │ │ │ ├── index.json.jbuilder │ │ │ └── _host.json.jbuilder │ │ ├── users │ │ │ ├── show.json.jbuilder │ │ │ ├── index.json.jbuilder │ │ │ └── _user.json.jbuilder │ │ └── bookings │ │ │ ├── show.json.jbuilder │ │ │ ├── _booking.json.jbuilder │ │ │ └── index.json.jbuilder │ └── static_pages │ │ └── root.html.erb ├── helpers │ └── application_helper.rb ├── jobs │ └── application_job.rb ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb └── mailers │ └── application_mailer.rb ├── vendor └── assets │ ├── javascripts │ └── .keep │ └── stylesheets │ └── .keep ├── .DS_Store ├── config ├── initializers │ ├── aws.rb │ ├── session_store.rb │ ├── mime_types.rb │ ├── application_controller_renderer.rb │ ├── filter_parameter_logging.rb │ ├── cookies_serializer.rb │ ├── backtrace_silencers.rb │ ├── assets.rb │ ├── wrap_parameters.rb │ ├── inflections.rb │ └── new_framework_defaults.rb ├── spring.rb ├── boot.rb ├── environment.rb ├── cable.yml ├── routes.rb ├── locales │ └── en.yml ├── application.rb ├── secrets.yml ├── environments │ ├── test.rb │ ├── development.rb │ └── production.rb ├── puma.rb └── database.yml ├── db ├── docs │ ├── wireframes │ │ ├── log_in.png │ │ ├── search_page.png │ │ ├── user_page.png │ │ ├── request_form.png │ │ └── create-account.png │ ├── api-endpoints.md │ ├── sample-state.md │ ├── README.md │ ├── component-heirarchy.md │ └── schema.md ├── migrate │ ├── 20170620181256_remove_columns_from_users.rb │ ├── 20170623160630_remove_status_from_users.rb │ ├── 20170626175301_add_index_to_owner_in_homes.rb │ ├── 20170628131943_add_default_to_status.rb │ ├── 20180411193735_add_latitude_and_longitude_to_users.rb │ ├── 20170620140631_remove_uniqueness_from_city.rb │ ├── 20170623134321_add_status_column_to_users.rb │ ├── 20180410012956_rename_columns_in_user.rb │ ├── 20180310003752_rename_columns_in_booking.rb │ ├── 20170620181444_change_null_on_columns_in_users.rb │ ├── 20170630132759_add_attachment_avatar_to_users.rb │ ├── 20170630145613_add_attachment_avatar_to_hosts.rb │ ├── 20170628133050_add_columns_to_hosts.rb │ ├── 20170728185708_change_type_of_column_in_bookings.rb │ ├── 20170630105944_change_value_to_date_in_bookings.rb │ ├── 20170626160102_create_homes.rb │ ├── 20170628111144_create_hosts.rb │ ├── 20170629042036_add_and_remove_columns_from_hosts.rb │ ├── 20180309233924_merge_host_to_user.rb │ ├── 20170625213818_create_bookings.rb │ └── 20170620132449_create_users.rb ├── schema.rb └── seeds.rb ├── bin ├── bundle ├── rake ├── rails ├── spring ├── update └── setup ├── config.ru ├── Rakefile ├── frontend ├── util │ ├── host_api_util.js │ ├── session_api_util.js │ ├── booking_api_util.js │ ├── route_util.jsx │ └── marker_manager.js ├── components │ ├── dashboard │ │ ├── dashboard_container.js │ │ └── dashboard.jsx │ ├── root.jsx │ ├── splash_screen │ │ ├── splash_screen_container.js │ │ └── splash_screen.jsx │ ├── hosts_map │ │ ├── hosts_map_container.js │ │ └── hosts_map.jsx │ ├── dropdown │ │ ├── dropdown.jsx │ │ └── dropdown_container.js │ ├── hosts │ │ ├── host_index_container.js │ │ ├── host_show_container.js │ │ ├── host_index_detail.jsx │ │ ├── host_show.jsx │ │ └── host_index.jsx │ ├── modal │ │ ├── modal_container.jsx │ │ └── modal.jsx │ ├── booking │ │ ├── bookings_show_container.js │ │ ├── bookings_container.js │ │ ├── bookings_show.jsx │ │ ├── bookings_form_container.js │ │ ├── bookings.jsx │ │ └── bookings_form.jsx │ ├── header │ │ ├── header_container.js │ │ └── header.jsx │ ├── session_form │ │ ├── session_form_container.js │ │ └── session_form.jsx │ └── App.jsx ├── actions │ ├── dropdown_actions.js │ ├── error_actions.js │ ├── modal_actions.js │ ├── host_actions.js │ ├── session_actions.js │ └── booking_actions.js ├── reducers │ ├── errors_reducer.js │ ├── hosts_reducer.js │ ├── filters_reducer.js │ ├── dropdown_reducer.js │ ├── root_reducer.js │ ├── bookings_reducer.js │ ├── session_reducer.js │ └── modal_reducer.js ├── store │ └── store.js └── futon_flying.jsx ├── README.md ├── .gitignore ├── webpack.config.js ├── package.json ├── Gemfile └── Gemfile.lock /log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vo-eric/FutonFlying/HEAD/.DS_Store -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /config/initializers/aws.rb: -------------------------------------------------------------------------------- 1 | Aws::VERSION = Gem.loaded_specs["aws-sdk"].version 2 | -------------------------------------------------------------------------------- /app/views/api/hosts/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.partial! 'api/hosts/host', host: @host 2 | -------------------------------------------------------------------------------- /db/docs/wireframes/log_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vo-eric/FutonFlying/HEAD/db/docs/wireframes/log_in.png -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /db/docs/wireframes/search_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vo-eric/FutonFlying/HEAD/db/docs/wireframes/search_page.png -------------------------------------------------------------------------------- /db/docs/wireframes/user_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vo-eric/FutonFlying/HEAD/db/docs/wireframes/user_page.png -------------------------------------------------------------------------------- /db/docs/wireframes/request_form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vo-eric/FutonFlying/HEAD/db/docs/wireframes/request_form.png -------------------------------------------------------------------------------- /app/controllers/static_pages_controller.rb: -------------------------------------------------------------------------------- 1 | class StaticPagesController < ApplicationController 2 | def root 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /db/docs/wireframes/create-account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vo-eric/FutonFlying/HEAD/db/docs/wireframes/create-account.png -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/views/api/users/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.partial! "api/users/user", user: @user 2 | 3 | # json.partial! "api/bookings/booking", booking: @booking -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /app/views/api/bookings/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.partial! 'api/bookings/booking', :locals => {booking: @booking, foo: @current_user.id == @booking.guest_id} 2 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /app/views/api/hosts/index.json.jbuilder: -------------------------------------------------------------------------------- 1 | @hosts.each do |host| 2 | json.set! host.id do 3 | json.partial! 'api/hosts/host', host: host 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/views/api/users/index.json.jbuilder: -------------------------------------------------------------------------------- 1 | @users.each do |user| 2 | json.set! user.id do 3 | json.partial! 'api/users/user', user: user 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /app/assets/stylesheets/api/booking_show.scss: -------------------------------------------------------------------------------- 1 | .booking-main { 2 | background-color: #fff; 3 | margin-top: 5%; 4 | 5 | .host-name { 6 | font-size: 2rem; 7 | } 8 | } -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /db/migrate/20170620181256_remove_columns_from_users.rb: -------------------------------------------------------------------------------- 1 | class RemoveColumnsFromUsers < ActiveRecord::Migration[5.0] 2 | def change 3 | remove_column :users, :city_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20170623160630_remove_status_from_users.rb: -------------------------------------------------------------------------------- 1 | class RemoveStatusFromUsers < ActiveRecord::Migration[5.0] 2 | def change 3 | remove_column :users, :status 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20170626175301_add_index_to_owner_in_homes.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToOwnerInHomes < ActiveRecord::Migration[5.0] 2 | def change 3 | add_index :homes, :owner_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/views/api/hosts/_host.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! host, :id, :description, :lat, :lng, :accepting_guests, :fname, :lname, :city, :country 2 | 3 | json.avatar_url asset_path(host.avatar.url) 4 | -------------------------------------------------------------------------------- /app/views/api/users/_user.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! user, :id, :bio, :latitude, :longitude, :accepting_guests, :fname, :lname, :city, :country 2 | 3 | json.avatar_url asset_path(user.avatar.url) -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_MyCouchSurfing_session' 4 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /db/migrate/20170628131943_add_default_to_status.rb: -------------------------------------------------------------------------------- 1 | class AddDefaultToStatus < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :hosts, :accepting_gusts, :boolean, :default => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180411193735_add_latitude_and_longitude_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddLatitudeAndLongitudeToUsers < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :users, :address, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20170620140631_remove_uniqueness_from_city.rb: -------------------------------------------------------------------------------- 1 | class RemoveUniquenessFromCity < ActiveRecord::Migration[5.0] 2 | def change 3 | remove_index :users, :city_id 4 | add_index :users, :city_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /db/migrate/20170623134321_add_status_column_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddStatusColumnToUsers < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :users, :status, :string, default: "Accepting Guests", null: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180410012956_rename_columns_in_user.rb: -------------------------------------------------------------------------------- 1 | class RenameColumnsInUser < ActiveRecord::Migration[5.0] 2 | def change 3 | rename_column :users, :lat, :latitude 4 | rename_column :users, :lng, :longitude 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /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_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /db/migrate/20180310003752_rename_columns_in_booking.rb: -------------------------------------------------------------------------------- 1 | class RenameColumnsInBooking < ActiveRecord::Migration[5.0] 2 | def change 3 | rename_column :bookings, :endDate, :end_date 4 | rename_column :bookings, :startDate, :start_date 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /db/migrate/20170620181444_change_null_on_columns_in_users.rb: -------------------------------------------------------------------------------- 1 | class ChangeNullOnColumnsInUsers < ActiveRecord::Migration[5.0] 2 | def change 3 | change_column_null :users, :fname, :null => false 4 | change_column_null :users, :lname, :null => false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/views/static_pages/root.html.erb: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /db/migrate/20170630132759_add_attachment_avatar_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddAttachmentAvatarToUsers < ActiveRecord::Migration 2 | def self.up 3 | change_table :users do |t| 4 | t.attachment :avatar 5 | end 6 | end 7 | 8 | def self.down 9 | remove_attachment :users, :avatar 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20170630145613_add_attachment_avatar_to_hosts.rb: -------------------------------------------------------------------------------- 1 | class AddAttachmentAvatarToHosts < ActiveRecord::Migration 2 | def self.up 3 | change_table :hosts do |t| 4 | t.attachment :avatar 5 | end 6 | end 7 | 8 | def self.down 9 | remove_attachment :hosts, :avatar 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /frontend/util/host_api_util.js: -------------------------------------------------------------------------------- 1 | export const fetchHosts = (data) => { 2 | return $.ajax({ 3 | method: 'GET', 4 | url: 'api/users', 5 | data 6 | }); 7 | }; 8 | 9 | export const fetchSingleHost = (id) => { 10 | return $.ajax({ 11 | method: 'GET', 12 | url: `api/users/${id}`, 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /db/migrate/20170628133050_add_columns_to_hosts.rb: -------------------------------------------------------------------------------- 1 | class AddColumnsToHosts < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :hosts, :fname, :string, null: false 4 | add_column :hosts, :lname, :string, null: false 5 | add_column :hosts, :city, :string 6 | add_column :hosts, :location, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170728185708_change_type_of_column_in_bookings.rb: -------------------------------------------------------------------------------- 1 | class ChangeTypeOfColumnInBookings < ActiveRecord::Migration[5.0] 2 | def change 3 | remove_column :bookings, :startDate 4 | remove_column :bookings, :endDate 5 | add_column :bookings, :startDate, :date 6 | add_column :bookings, :endDate, :date 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /frontend/components/dashboard/dashboard_container.js: -------------------------------------------------------------------------------- 1 | import { connect } from 'react-redux'; 2 | import Dashboard from './dashboard'; 3 | 4 | const mapStateToProps = (state) => { 5 | return { 6 | user: state.session.currentUser 7 | }; 8 | }; 9 | 10 | export default connect ( 11 | mapStateToProps, 12 | null 13 | )(Dashboard); 14 | -------------------------------------------------------------------------------- /frontend/actions/dropdown_actions.js: -------------------------------------------------------------------------------- 1 | export const OPEN_DROPDOWN = 'OPEN_DROPDOWN'; 2 | export const CLOSE_DROPDOWN = 'CLOSE_DROPDOWN'; 3 | 4 | export const openDropdown = () => { 5 | return { 6 | type: OPEN_DROPDOWN 7 | }; 8 | }; 9 | 10 | export const closeDropdown = () => { 11 | return { 12 | type: CLOSE_DROPDOWN 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /db/migrate/20170630105944_change_value_to_date_in_bookings.rb: -------------------------------------------------------------------------------- 1 | class ChangeValueToDateInBookings < ActiveRecord::Migration[5.0] 2 | def change 3 | remove_column :bookings, :startDate 4 | remove_column :bookings, :endDate 5 | add_column :bookings, :startDate, :date, null: false 6 | add_column :bookings, :endDate, :date, null: false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /frontend/actions/error_actions.js: -------------------------------------------------------------------------------- 1 | export const RECEIVE_ERRORS = 'RECEIVE_ERRORS'; 2 | export const CLEAR_ERRORS = 'CLEAR_ERRORS'; 3 | 4 | export const receiveErrors = errors => { 5 | return { 6 | type: RECEIVE_ERRORS, 7 | errors 8 | }; 9 | }; 10 | 11 | export const clearErrors = () => { 12 | return { 13 | type: CLEAR_ERRORS 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20170626160102_create_homes.rb: -------------------------------------------------------------------------------- 1 | class CreateHomes < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :homes do |t| 4 | t.float :lng, null: false 5 | t.float :lat, null: false 6 | t.integer :owner_id, null: false 7 | t.boolean :accepting_guests, null: false 8 | t.string :description 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /frontend/components/root.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Provider } from 'react-redux'; 3 | import { HashRouter } from 'react-router-dom'; 4 | import App from './App'; 5 | 6 | const Root = ({ store }) => ( 7 |21 | ACCEPTING GUESTS 22 |
23 | ); 24 | } else { 25 | return ( 26 |27 | NOT ACCEPTING GUESTS 28 |
29 | ); 30 | } 31 | } 32 | 33 | render() { 34 | const { selected } = this.props; 35 | return ( 36 |If you are the application owner check the logs for more information.
64 |Maybe you tried to change something you didn't have access to.
63 |If you are the application owner check the logs for more information.
65 |You may have mistyped the address or the page may have moved.
63 |If you are the application owner check the logs for more information.
65 |35 | {user.fname} {user.lname} 36 |
37 |38 | {user.city}, {user.country} 39 |
40 |45 | Explore The World 46 |
47 | 48 | 49 | 52 | Browse all Hosts 53 | 54 |33 | {booking.fname} {booking.lname} 34 |
35 |Arriving At
39 |Leaving At
45 |48 | {errors.map(error =>
{error}
)} 49 | 50 | ); 51 | } else { 52 | return null; 53 | } 54 | } 55 | 56 | render() { 57 | return ( 58 |60 | Request to stay 61 |
62 | 63 | 94 | 95 |73 | There are no rooms available at this location 74 |
75 |${hostBio}
81 |14 | Stay With Locals and Meet Fellow Travelers 15 |
16 |17 | Share your experiences. 18 |
19 |23 | How it Works 24 |
25 | 26 | 27 | 28 |
31 | Meet Amazing People
32 | 33 |34 | Futonfliers open their homes and share their lives. Be connected. 35 |
36 |
40 | Find a Host
41 | 42 | 43 | 44 |45 | Connect with hosts and confirm your stay through FutonFlying. Your stay with hosts is free! 46 |
47 |Top Futonflying Destinations
52 | 53 |
58 |
68 |
78 |
88 |
99 |
108 |
118 |
128 |
138 |
148 |
158 |