From 5d5355537b333b5a4b761220c02c692708d586cd Mon Sep 17 00:00:00 2001 From: Dan Andersen Date: Thu, 2 Jun 2016 13:46:54 -0400 Subject: [PATCH] Reorganize repo with rails app and react app folders --- .../EventListView.js | 0 EventView.js => react-native-app/EventView.js | 0 README.md => react-native-app/README.md | 0 .../android}/app/build.gradle | 0 .../android}/app/proguard-rules.pro | 0 .../android}/app/react.gradle | 0 .../android}/app/src/main/AndroidManifest.xml | 0 .../main/java/com/diarylist/MainActivity.java | 0 .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../app/src/main/res/values/strings.xml | 0 .../app/src/main/res/values/styles.xml | 0 .../android}/build.gradle | 0 .../android}/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 0 {android => react-native-app/android}/gradlew | 0 .../android}/gradlew.bat | 0 .../android}/settings.gradle | 0 .../geo-location.js | 0 .../index.android.js | 0 index.ios.js => react-native-app/index.ios.js | 0 .../ios}/DiaryList.xcodeproj/project.pbxproj | 0 .../xcshareddata/xcschemes/DiaryList.xcscheme | 0 .../ios}/DiaryList/AppDelegate.h | 0 .../ios}/DiaryList/AppDelegate.m | 0 .../DiaryList/Base.lproj/LaunchScreen.xib | 0 .../AppIcon.appiconset/Contents.json | 0 .../ios}/DiaryList/Info.plist | 0 .../ios}/DiaryList/main.m | 0 .../ios}/DiaryListTests/DiaryListTests.m | 0 .../ios}/DiaryListTests/Info.plist | 0 .../GoogleSignIn.bundle/Info.plist | Bin .../GoogleSignIn.bundle/Roboto-Bold.ttf | Bin .../ar.lproj/GoogleSignIn.strings | Bin .../ca.lproj/GoogleSignIn.strings | Bin .../cs.lproj/GoogleSignIn.strings | Bin .../da.lproj/GoogleSignIn.strings | Bin .../de.lproj/GoogleSignIn.strings | Bin .../el.lproj/GoogleSignIn.strings | Bin .../en.lproj/GoogleSignIn.strings | Bin .../en_GB.lproj/GoogleSignIn.strings | Bin .../es.lproj/GoogleSignIn.strings | Bin .../es_MX.lproj/GoogleSignIn.strings | Bin .../fi.lproj/GoogleSignIn.strings | Bin .../fr.lproj/GoogleSignIn.strings | Bin .../GoogleSignIn.bundle/google.png | Bin .../GoogleSignIn.bundle/google@2x.png | Bin .../GoogleSignIn.bundle/google@3x.png | Bin .../GoogleSignIn.bundle/gplus.png | Bin .../GoogleSignIn.bundle/gplus@2x.png | Bin .../GoogleSignIn.bundle/gplus@3x.png | Bin .../he.lproj/GoogleSignIn.strings | Bin .../hr.lproj/GoogleSignIn.strings | Bin .../hu.lproj/GoogleSignIn.strings | Bin .../id.lproj/GoogleSignIn.strings | Bin .../it.lproj/GoogleSignIn.strings | Bin .../ja.lproj/GoogleSignIn.strings | Bin .../ko.lproj/GoogleSignIn.strings | Bin .../ms.lproj/GoogleSignIn.strings | Bin .../nb.lproj/GoogleSignIn.strings | Bin .../nl.lproj/GoogleSignIn.strings | Bin .../pl.lproj/GoogleSignIn.strings | Bin .../pt.lproj/GoogleSignIn.strings | Bin .../pt_BR.lproj/GoogleSignIn.strings | Bin .../pt_PT.lproj/GoogleSignIn.strings | Bin .../ro.lproj/GoogleSignIn.strings | Bin .../ru.lproj/GoogleSignIn.strings | Bin .../sk.lproj/GoogleSignIn.strings | Bin .../sv.lproj/GoogleSignIn.strings | Bin .../th.lproj/GoogleSignIn.strings | Bin .../tr.lproj/GoogleSignIn.strings | Bin .../uk.lproj/GoogleSignIn.strings | Bin .../vi.lproj/GoogleSignIn.strings | Bin .../zh_CN.lproj/GoogleSignIn.strings | Bin .../zh_TW.lproj/GoogleSignIn.strings | Bin .../GoogleSignIn.framework/GoogleSignIn | Bin .../Headers/GIDAuthentication.h | 0 .../Headers/GIDGoogleUser.h | 0 .../Headers/GIDProfileData.h | 0 .../Headers/GIDSignIn.h | 0 .../Headers/GIDSignInButton.h | 0 .../Headers/GoogleSignIn.h | 0 .../Headers/UIViewController+SignIn.h | 0 .../_CodeSignature/CodeDirectory | Bin .../_CodeSignature/CodeRequirements | Bin .../_CodeSignature/CodeResources | 0 .../_CodeSignature/CodeSignature | Bin .../embedded.mobileprovision | Bin .../ios}/RNGoogleSignin/RNGoogleSignin.h | 0 .../ios}/RNGoogleSignin/RNGoogleSignin.m | 0 .../RNGoogleSigninButtonManager.m | 0 man curl => react-native-app/man curl | 0 package.json => react-native-app/package.json | 0 sshot.png => react-native-app/sshot.png | Bin styles.js => react-native-app/styles.js | 0 server-side-rails-app/Capfile | 11 + server-side-rails-app/Gemfile | 65 +++++ server-side-rails-app/Gemfile.lock | 228 ++++++++++++++++++ server-side-rails-app/README.rdoc | 28 +++ server-side-rails-app/Rakefile | 6 + server-side-rails-app/app/assets/images/.keep | 0 .../app/assets/javascripts/application.js | 15 ++ .../app/assets/stylesheets/application.css | 15 ++ .../app/controllers/application_controller.rb | 5 + .../app/controllers/concerns/.keep | 0 .../app/controllers/events_controller.rb | 55 +++++ .../app/helpers/application_helper.rb | 2 + server-side-rails-app/app/mailers/.keep | 0 server-side-rails-app/app/models/.keep | 0 .../app/models/concerns/.keep | 0 server-side-rails-app/app/models/event.rb | 17 ++ .../app/views/events/index.html.erb | 18 ++ .../app/views/layouts/application.html.erb | 13 + server-side-rails-app/bin/bundle | 3 + server-side-rails-app/bin/rails | 9 + server-side-rails-app/bin/rake | 9 + server-side-rails-app/bin/setup | 29 +++ server-side-rails-app/bin/spring | 15 ++ server-side-rails-app/config.ru | 4 + server-side-rails-app/config/application.rb | 37 +++ server-side-rails-app/config/boot.rb | 3 + server-side-rails-app/config/cert.pem | 144 +++++++++++ server-side-rails-app/config/database.yml | 84 +++++++ server-side-rails-app/config/deploy.rb | 84 +++++++ .../config/deploy/production.rb | 61 +++++ .../config/deploy/staging.rb | 61 +++++ server-side-rails-app/config/environment.rb | 5 + .../config/environments/development.rb | 41 ++++ .../config/environments/production.rb | 79 ++++++ .../config/environments/test.rb | 42 ++++ .../config/initializers/apns.rb | 1 + .../config/initializers/assets.rb | 11 + .../initializers/backtrace_silencers.rb | 7 + .../config/initializers/cookies_serializer.rb | 3 + .../initializers/filter_parameter_logging.rb | 4 + .../config/initializers/inflections.rb | 16 ++ .../config/initializers/mime_types.rb | 4 + .../config/initializers/session_store.rb | 3 + .../config/initializers/wrap_parameters.rb | 14 ++ server-side-rails-app/config/locales/en.yml | 23 ++ server-side-rails-app/config/nginx.conf | 31 +++ server-side-rails-app/config/routes.rb | 58 +++++ server-side-rails-app/config/secrets.yml | 22 ++ .../migrate/20160221003045_create_events.rb | 21 ++ .../20160224234247_add_google_event_id.rb | 5 + server-side-rails-app/db/schema.rb | 37 +++ server-side-rails-app/db/seeds.rb | 215 +++++++++++++++++ server-side-rails-app/lib/assets/.keep | 0 server-side-rails-app/lib/tasks/.keep | 0 .../lib/tasks/initiate_alert.rake | 38 +++ server-side-rails-app/log.log | 159 ++++++++++++ server-side-rails-app/log/.keep | 0 server-side-rails-app/public/404.html | 67 +++++ server-side-rails-app/public/422.html | 67 +++++ server-side-rails-app/public/500.html | 66 +++++ server-side-rails-app/public/favicon.ico | 0 server-side-rails-app/public/robots.txt | 5 + server-side-rails-app/spec/rails_helper.rb | 57 +++++ server-side-rails-app/spec/spec_helper.rb | 92 +++++++ .../vendor/assets/javascripts/.keep | 0 .../vendor/assets/stylesheets/.keep | 0 164 files changed, 2214 insertions(+) rename EventListView.js => react-native-app/EventListView.js (100%) rename EventView.js => react-native-app/EventView.js (100%) rename README.md => react-native-app/README.md (100%) rename {android => react-native-app/android}/app/build.gradle (100%) rename {android => react-native-app/android}/app/proguard-rules.pro (100%) rename {android => react-native-app/android}/app/react.gradle (100%) rename {android => react-native-app/android}/app/src/main/AndroidManifest.xml (100%) rename {android => react-native-app/android}/app/src/main/java/com/diarylist/MainActivity.java (100%) rename {android => react-native-app/android}/app/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename {android => react-native-app/android}/app/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename {android => react-native-app/android}/app/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename {android => react-native-app/android}/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) rename {android => react-native-app/android}/app/src/main/res/values/strings.xml (100%) rename {android => react-native-app/android}/app/src/main/res/values/styles.xml (100%) rename {android => react-native-app/android}/build.gradle (100%) rename {android => react-native-app/android}/gradle.properties (100%) rename {android => react-native-app/android}/gradle/wrapper/gradle-wrapper.jar (100%) rename {android => react-native-app/android}/gradle/wrapper/gradle-wrapper.properties (100%) rename {android => react-native-app/android}/gradlew (100%) rename {android => react-native-app/android}/gradlew.bat (100%) rename {android => react-native-app/android}/settings.gradle (100%) rename geo-location.js => react-native-app/geo-location.js (100%) rename index.android.js => react-native-app/index.android.js (100%) rename index.ios.js => react-native-app/index.ios.js (100%) rename {ios => react-native-app/ios}/DiaryList.xcodeproj/project.pbxproj (100%) rename {ios => react-native-app/ios}/DiaryList.xcodeproj/xcshareddata/xcschemes/DiaryList.xcscheme (100%) rename {ios => react-native-app/ios}/DiaryList/AppDelegate.h (100%) rename {ios => react-native-app/ios}/DiaryList/AppDelegate.m (100%) rename {ios => react-native-app/ios}/DiaryList/Base.lproj/LaunchScreen.xib (100%) rename {ios => react-native-app/ios}/DiaryList/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename {ios => react-native-app/ios}/DiaryList/Info.plist (100%) rename {ios => react-native-app/ios}/DiaryList/main.m (100%) rename {ios => react-native-app/ios}/DiaryListTests/DiaryListTests.m (100%) rename {ios => react-native-app/ios}/DiaryListTests/Info.plist (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/Info.plist (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/Roboto-Bold.ttf (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/ar.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/ca.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/cs.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/da.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/de.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/el.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/en.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/en_GB.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/es.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/es_MX.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/fi.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/fr.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/google.png (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/google@2x.png (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/google@3x.png (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/gplus.png (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/gplus@2x.png (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/gplus@3x.png (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/he.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/hr.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/hu.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/id.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/it.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/ja.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/ko.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/ms.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/nb.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/nl.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/pl.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/pt.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/pt_BR.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/pt_PT.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/ro.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/ru.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/sk.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/sv.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/th.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/tr.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/uk.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/vi.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/zh_CN.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.bundle/zh_TW.lproj/GoogleSignIn.strings (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/GoogleSignIn (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDAuthentication.h (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDGoogleUser.h (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDProfileData.h (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDSignIn.h (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDSignInButton.h (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/Headers/GoogleSignIn.h (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/Headers/UIViewController+SignIn.h (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeDirectory (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeRequirements (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeResources (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeSignature (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/GoogleSignIn.framework/embedded.mobileprovision (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/RNGoogleSignin.h (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/RNGoogleSignin.m (100%) rename {ios => react-native-app/ios}/RNGoogleSignin/RNGoogleSigninButtonManager.m (100%) rename man curl => react-native-app/man curl (100%) rename package.json => react-native-app/package.json (100%) rename sshot.png => react-native-app/sshot.png (100%) rename styles.js => react-native-app/styles.js (100%) create mode 100644 server-side-rails-app/Capfile create mode 100644 server-side-rails-app/Gemfile create mode 100644 server-side-rails-app/Gemfile.lock create mode 100644 server-side-rails-app/README.rdoc create mode 100644 server-side-rails-app/Rakefile create mode 100644 server-side-rails-app/app/assets/images/.keep create mode 100644 server-side-rails-app/app/assets/javascripts/application.js create mode 100644 server-side-rails-app/app/assets/stylesheets/application.css create mode 100644 server-side-rails-app/app/controllers/application_controller.rb create mode 100644 server-side-rails-app/app/controllers/concerns/.keep create mode 100644 server-side-rails-app/app/controllers/events_controller.rb create mode 100644 server-side-rails-app/app/helpers/application_helper.rb create mode 100644 server-side-rails-app/app/mailers/.keep create mode 100644 server-side-rails-app/app/models/.keep create mode 100644 server-side-rails-app/app/models/concerns/.keep create mode 100644 server-side-rails-app/app/models/event.rb create mode 100644 server-side-rails-app/app/views/events/index.html.erb create mode 100644 server-side-rails-app/app/views/layouts/application.html.erb create mode 100755 server-side-rails-app/bin/bundle create mode 100755 server-side-rails-app/bin/rails create mode 100755 server-side-rails-app/bin/rake create mode 100755 server-side-rails-app/bin/setup create mode 100755 server-side-rails-app/bin/spring create mode 100644 server-side-rails-app/config.ru create mode 100644 server-side-rails-app/config/application.rb create mode 100644 server-side-rails-app/config/boot.rb create mode 100644 server-side-rails-app/config/cert.pem create mode 100644 server-side-rails-app/config/database.yml create mode 100644 server-side-rails-app/config/deploy.rb create mode 100644 server-side-rails-app/config/deploy/production.rb create mode 100644 server-side-rails-app/config/deploy/staging.rb create mode 100644 server-side-rails-app/config/environment.rb create mode 100644 server-side-rails-app/config/environments/development.rb create mode 100644 server-side-rails-app/config/environments/production.rb create mode 100644 server-side-rails-app/config/environments/test.rb create mode 100644 server-side-rails-app/config/initializers/apns.rb create mode 100644 server-side-rails-app/config/initializers/assets.rb create mode 100644 server-side-rails-app/config/initializers/backtrace_silencers.rb create mode 100644 server-side-rails-app/config/initializers/cookies_serializer.rb create mode 100644 server-side-rails-app/config/initializers/filter_parameter_logging.rb create mode 100644 server-side-rails-app/config/initializers/inflections.rb create mode 100644 server-side-rails-app/config/initializers/mime_types.rb create mode 100644 server-side-rails-app/config/initializers/session_store.rb create mode 100644 server-side-rails-app/config/initializers/wrap_parameters.rb create mode 100644 server-side-rails-app/config/locales/en.yml create mode 100644 server-side-rails-app/config/nginx.conf create mode 100644 server-side-rails-app/config/routes.rb create mode 100644 server-side-rails-app/config/secrets.yml create mode 100644 server-side-rails-app/db/migrate/20160221003045_create_events.rb create mode 100644 server-side-rails-app/db/migrate/20160224234247_add_google_event_id.rb create mode 100644 server-side-rails-app/db/schema.rb create mode 100644 server-side-rails-app/db/seeds.rb create mode 100644 server-side-rails-app/lib/assets/.keep create mode 100644 server-side-rails-app/lib/tasks/.keep create mode 100644 server-side-rails-app/lib/tasks/initiate_alert.rake create mode 100644 server-side-rails-app/log.log create mode 100644 server-side-rails-app/log/.keep create mode 100644 server-side-rails-app/public/404.html create mode 100644 server-side-rails-app/public/422.html create mode 100644 server-side-rails-app/public/500.html create mode 100644 server-side-rails-app/public/favicon.ico create mode 100644 server-side-rails-app/public/robots.txt create mode 100644 server-side-rails-app/spec/rails_helper.rb create mode 100644 server-side-rails-app/spec/spec_helper.rb create mode 100644 server-side-rails-app/vendor/assets/javascripts/.keep create mode 100644 server-side-rails-app/vendor/assets/stylesheets/.keep diff --git a/EventListView.js b/react-native-app/EventListView.js similarity index 100% rename from EventListView.js rename to react-native-app/EventListView.js diff --git a/EventView.js b/react-native-app/EventView.js similarity index 100% rename from EventView.js rename to react-native-app/EventView.js diff --git a/README.md b/react-native-app/README.md similarity index 100% rename from README.md rename to react-native-app/README.md diff --git a/android/app/build.gradle b/react-native-app/android/app/build.gradle similarity index 100% rename from android/app/build.gradle rename to react-native-app/android/app/build.gradle diff --git a/android/app/proguard-rules.pro b/react-native-app/android/app/proguard-rules.pro similarity index 100% rename from android/app/proguard-rules.pro rename to react-native-app/android/app/proguard-rules.pro diff --git a/android/app/react.gradle b/react-native-app/android/app/react.gradle similarity index 100% rename from android/app/react.gradle rename to react-native-app/android/app/react.gradle diff --git a/android/app/src/main/AndroidManifest.xml b/react-native-app/android/app/src/main/AndroidManifest.xml similarity index 100% rename from android/app/src/main/AndroidManifest.xml rename to react-native-app/android/app/src/main/AndroidManifest.xml diff --git a/android/app/src/main/java/com/diarylist/MainActivity.java b/react-native-app/android/app/src/main/java/com/diarylist/MainActivity.java similarity index 100% rename from android/app/src/main/java/com/diarylist/MainActivity.java rename to react-native-app/android/app/src/main/java/com/diarylist/MainActivity.java diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/react-native-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to react-native-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/react-native-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to react-native-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/react-native-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to react-native-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/react-native-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to react-native-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/android/app/src/main/res/values/strings.xml b/react-native-app/android/app/src/main/res/values/strings.xml similarity index 100% rename from android/app/src/main/res/values/strings.xml rename to react-native-app/android/app/src/main/res/values/strings.xml diff --git a/android/app/src/main/res/values/styles.xml b/react-native-app/android/app/src/main/res/values/styles.xml similarity index 100% rename from android/app/src/main/res/values/styles.xml rename to react-native-app/android/app/src/main/res/values/styles.xml diff --git a/android/build.gradle b/react-native-app/android/build.gradle similarity index 100% rename from android/build.gradle rename to react-native-app/android/build.gradle diff --git a/android/gradle.properties b/react-native-app/android/gradle.properties similarity index 100% rename from android/gradle.properties rename to react-native-app/android/gradle.properties diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/react-native-app/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from android/gradle/wrapper/gradle-wrapper.jar rename to react-native-app/android/gradle/wrapper/gradle-wrapper.jar diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/react-native-app/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from android/gradle/wrapper/gradle-wrapper.properties rename to react-native-app/android/gradle/wrapper/gradle-wrapper.properties diff --git a/android/gradlew b/react-native-app/android/gradlew similarity index 100% rename from android/gradlew rename to react-native-app/android/gradlew diff --git a/android/gradlew.bat b/react-native-app/android/gradlew.bat similarity index 100% rename from android/gradlew.bat rename to react-native-app/android/gradlew.bat diff --git a/android/settings.gradle b/react-native-app/android/settings.gradle similarity index 100% rename from android/settings.gradle rename to react-native-app/android/settings.gradle diff --git a/geo-location.js b/react-native-app/geo-location.js similarity index 100% rename from geo-location.js rename to react-native-app/geo-location.js diff --git a/index.android.js b/react-native-app/index.android.js similarity index 100% rename from index.android.js rename to react-native-app/index.android.js diff --git a/index.ios.js b/react-native-app/index.ios.js similarity index 100% rename from index.ios.js rename to react-native-app/index.ios.js diff --git a/ios/DiaryList.xcodeproj/project.pbxproj b/react-native-app/ios/DiaryList.xcodeproj/project.pbxproj similarity index 100% rename from ios/DiaryList.xcodeproj/project.pbxproj rename to react-native-app/ios/DiaryList.xcodeproj/project.pbxproj diff --git a/ios/DiaryList.xcodeproj/xcshareddata/xcschemes/DiaryList.xcscheme b/react-native-app/ios/DiaryList.xcodeproj/xcshareddata/xcschemes/DiaryList.xcscheme similarity index 100% rename from ios/DiaryList.xcodeproj/xcshareddata/xcschemes/DiaryList.xcscheme rename to react-native-app/ios/DiaryList.xcodeproj/xcshareddata/xcschemes/DiaryList.xcscheme diff --git a/ios/DiaryList/AppDelegate.h b/react-native-app/ios/DiaryList/AppDelegate.h similarity index 100% rename from ios/DiaryList/AppDelegate.h rename to react-native-app/ios/DiaryList/AppDelegate.h diff --git a/ios/DiaryList/AppDelegate.m b/react-native-app/ios/DiaryList/AppDelegate.m similarity index 100% rename from ios/DiaryList/AppDelegate.m rename to react-native-app/ios/DiaryList/AppDelegate.m diff --git a/ios/DiaryList/Base.lproj/LaunchScreen.xib b/react-native-app/ios/DiaryList/Base.lproj/LaunchScreen.xib similarity index 100% rename from ios/DiaryList/Base.lproj/LaunchScreen.xib rename to react-native-app/ios/DiaryList/Base.lproj/LaunchScreen.xib diff --git a/ios/DiaryList/Images.xcassets/AppIcon.appiconset/Contents.json b/react-native-app/ios/DiaryList/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from ios/DiaryList/Images.xcassets/AppIcon.appiconset/Contents.json rename to react-native-app/ios/DiaryList/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/ios/DiaryList/Info.plist b/react-native-app/ios/DiaryList/Info.plist similarity index 100% rename from ios/DiaryList/Info.plist rename to react-native-app/ios/DiaryList/Info.plist diff --git a/ios/DiaryList/main.m b/react-native-app/ios/DiaryList/main.m similarity index 100% rename from ios/DiaryList/main.m rename to react-native-app/ios/DiaryList/main.m diff --git a/ios/DiaryListTests/DiaryListTests.m b/react-native-app/ios/DiaryListTests/DiaryListTests.m similarity index 100% rename from ios/DiaryListTests/DiaryListTests.m rename to react-native-app/ios/DiaryListTests/DiaryListTests.m diff --git a/ios/DiaryListTests/Info.plist b/react-native-app/ios/DiaryListTests/Info.plist similarity index 100% rename from ios/DiaryListTests/Info.plist rename to react-native-app/ios/DiaryListTests/Info.plist diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/Info.plist b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/Info.plist similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/Info.plist rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/Info.plist diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/Roboto-Bold.ttf b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/Roboto-Bold.ttf similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/Roboto-Bold.ttf rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/Roboto-Bold.ttf diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/ar.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ar.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/ar.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ar.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/ca.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ca.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/ca.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ca.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/cs.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/cs.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/cs.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/cs.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/da.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/da.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/da.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/da.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/de.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/de.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/de.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/de.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/el.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/el.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/el.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/el.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/en.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/en.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/en.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/en.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/en_GB.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/en_GB.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/en_GB.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/en_GB.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/es.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/es.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/es.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/es.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/es_MX.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/es_MX.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/es_MX.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/es_MX.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/fi.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/fi.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/fi.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/fi.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/fr.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/fr.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/fr.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/fr.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/google.png b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/google.png similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/google.png rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/google.png diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/google@2x.png b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/google@2x.png similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/google@2x.png rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/google@2x.png diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/google@3x.png b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/google@3x.png similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/google@3x.png rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/google@3x.png diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/gplus.png b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/gplus.png similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/gplus.png rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/gplus.png diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/gplus@2x.png b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/gplus@2x.png similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/gplus@2x.png rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/gplus@2x.png diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/gplus@3x.png b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/gplus@3x.png similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/gplus@3x.png rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/gplus@3x.png diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/he.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/he.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/he.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/he.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/hr.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/hr.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/hr.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/hr.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/hu.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/hu.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/hu.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/hu.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/id.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/id.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/id.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/id.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/it.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/it.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/it.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/it.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/ja.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ja.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/ja.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ja.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/ko.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ko.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/ko.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ko.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/ms.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ms.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/ms.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ms.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/nb.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/nb.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/nb.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/nb.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/nl.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/nl.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/nl.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/nl.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/pl.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/pl.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/pl.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/pl.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/pt.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/pt.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/pt.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/pt.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/pt_BR.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/pt_BR.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/pt_BR.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/pt_BR.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/pt_PT.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/pt_PT.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/pt_PT.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/pt_PT.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/ro.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ro.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/ro.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ro.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/ru.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ru.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/ru.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/ru.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/sk.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/sk.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/sk.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/sk.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/sv.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/sv.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/sv.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/sv.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/th.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/th.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/th.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/th.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/tr.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/tr.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/tr.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/tr.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/uk.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/uk.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/uk.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/uk.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/vi.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/vi.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/vi.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/vi.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/zh_CN.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/zh_CN.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/zh_CN.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/zh_CN.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.bundle/zh_TW.lproj/GoogleSignIn.strings b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/zh_TW.lproj/GoogleSignIn.strings similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.bundle/zh_TW.lproj/GoogleSignIn.strings rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.bundle/zh_TW.lproj/GoogleSignIn.strings diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/GoogleSignIn b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/GoogleSignIn similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/GoogleSignIn rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/GoogleSignIn diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDAuthentication.h b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDAuthentication.h similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDAuthentication.h rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDAuthentication.h diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDGoogleUser.h b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDGoogleUser.h similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDGoogleUser.h rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDGoogleUser.h diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDProfileData.h b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDProfileData.h similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDProfileData.h rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDProfileData.h diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDSignIn.h b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDSignIn.h similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDSignIn.h rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDSignIn.h diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDSignInButton.h b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDSignInButton.h similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDSignInButton.h rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GIDSignInButton.h diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GoogleSignIn.h b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GoogleSignIn.h similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GoogleSignIn.h rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/GoogleSignIn.h diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/UIViewController+SignIn.h b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/UIViewController+SignIn.h similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/Headers/UIViewController+SignIn.h rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/Headers/UIViewController+SignIn.h diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeDirectory b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeDirectory similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeDirectory rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeDirectory diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeRequirements b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeRequirements similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeRequirements rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeRequirements diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeResources b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeResources similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeResources rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeResources diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeSignature b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeSignature similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeSignature rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/_CodeSignature/CodeSignature diff --git a/ios/RNGoogleSignin/GoogleSignIn.framework/embedded.mobileprovision b/react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/embedded.mobileprovision similarity index 100% rename from ios/RNGoogleSignin/GoogleSignIn.framework/embedded.mobileprovision rename to react-native-app/ios/RNGoogleSignin/GoogleSignIn.framework/embedded.mobileprovision diff --git a/ios/RNGoogleSignin/RNGoogleSignin.h b/react-native-app/ios/RNGoogleSignin/RNGoogleSignin.h similarity index 100% rename from ios/RNGoogleSignin/RNGoogleSignin.h rename to react-native-app/ios/RNGoogleSignin/RNGoogleSignin.h diff --git a/ios/RNGoogleSignin/RNGoogleSignin.m b/react-native-app/ios/RNGoogleSignin/RNGoogleSignin.m similarity index 100% rename from ios/RNGoogleSignin/RNGoogleSignin.m rename to react-native-app/ios/RNGoogleSignin/RNGoogleSignin.m diff --git a/ios/RNGoogleSignin/RNGoogleSigninButtonManager.m b/react-native-app/ios/RNGoogleSignin/RNGoogleSigninButtonManager.m similarity index 100% rename from ios/RNGoogleSignin/RNGoogleSigninButtonManager.m rename to react-native-app/ios/RNGoogleSignin/RNGoogleSigninButtonManager.m diff --git a/man curl b/react-native-app/man curl similarity index 100% rename from man curl rename to react-native-app/man curl diff --git a/package.json b/react-native-app/package.json similarity index 100% rename from package.json rename to react-native-app/package.json diff --git a/sshot.png b/react-native-app/sshot.png similarity index 100% rename from sshot.png rename to react-native-app/sshot.png diff --git a/styles.js b/react-native-app/styles.js similarity index 100% rename from styles.js rename to react-native-app/styles.js diff --git a/server-side-rails-app/Capfile b/server-side-rails-app/Capfile new file mode 100644 index 0000000..6b297ad --- /dev/null +++ b/server-side-rails-app/Capfile @@ -0,0 +1,11 @@ +# Load DSL and Setup Up Stages +require 'capistrano/setup' +require 'capistrano/deploy' + +require 'capistrano/rails' +require 'capistrano/bundler' +require 'capistrano/rvm' +require 'capistrano/puma' + +# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. +Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } diff --git a/server-side-rails-app/Gemfile b/server-side-rails-app/Gemfile new file mode 100644 index 0000000..0511c47 --- /dev/null +++ b/server-side-rails-app/Gemfile @@ -0,0 +1,65 @@ +source 'https://rubygems.org' +ruby '2.2.3' + +gem 'httparty' +gem 'apns' +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '4.2.5.1' +# Use postgresql as the database for Active Record +gem 'pg', '~> 0.15' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' +gem 'pry' +gem 'table_print' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'therubyracer', platforms: :ruby + +# Use jquery as the JavaScript library +gem 'jquery-rails' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.0' +# bundle exec rake doc:rails generates the API under doc/api. +gem 'sdoc', '~> 0.4.0', group: :doc + +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7' + +# Use Unicorn as the app server +# gem 'unicorn' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug' + gem 'rspec-rails' + gem 'faker' + gem 'factory_girl_rails' +end + +group :development do + # Access an IRB console on exception pages or by using <%= console %> in views + gem 'web-console', '~> 2.0' + + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' +end + +group :production do + gem 'rails_12factor' +end + + +group :development do + gem 'capistrano', require: false + gem 'capistrano-rvm', require: false + gem 'capistrano-rails', require: false + gem 'capistrano-bundler', require: false + gem 'capistrano3-puma', require: false +end + +gem 'puma' + diff --git a/server-side-rails-app/Gemfile.lock b/server-side-rails-app/Gemfile.lock new file mode 100644 index 0000000..9d8606c --- /dev/null +++ b/server-side-rails-app/Gemfile.lock @@ -0,0 +1,228 @@ +GEM + remote: https://rubygems.org/ + specs: + actionmailer (4.2.5.1) + actionpack (= 4.2.5.1) + actionview (= 4.2.5.1) + activejob (= 4.2.5.1) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.5.1) + actionview (= 4.2.5.1) + activesupport (= 4.2.5.1) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.5.1) + activesupport (= 4.2.5.1) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.5.1) + activesupport (= 4.2.5.1) + globalid (>= 0.3.0) + activemodel (4.2.5.1) + activesupport (= 4.2.5.1) + builder (~> 3.1) + activerecord (4.2.5.1) + activemodel (= 4.2.5.1) + activesupport (= 4.2.5.1) + arel (~> 6.0) + activesupport (4.2.5.1) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + apns (1.0.0) + arel (6.0.3) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) + builder (3.2.2) + byebug (8.2.2) + capistrano (3.4.0) + i18n + rake (>= 10.0.0) + sshkit (~> 1.3) + capistrano-bundler (1.1.4) + capistrano (~> 3.1) + sshkit (~> 1.2) + capistrano-rails (1.1.6) + capistrano (~> 3.1) + capistrano-bundler (~> 1.1) + capistrano-rvm (0.1.2) + capistrano (~> 3.0) + sshkit (~> 1.2) + capistrano3-puma (1.2.1) + capistrano (~> 3.0) + puma (>= 2.6) + coderay (1.1.0) + concurrent-ruby (1.0.0) + debug_inspector (0.0.2) + diff-lcs (1.2.5) + erubis (2.7.0) + execjs (2.6.0) + factory_girl (4.5.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.6.0) + factory_girl (~> 4.5.0) + railties (>= 3.0.0) + faker (1.6.1) + i18n (~> 0.5) + globalid (0.3.6) + activesupport (>= 4.1.0) + httparty (0.13.7) + json (~> 1.8) + multi_xml (>= 0.5.2) + i18n (0.7.0) + jbuilder (2.4.1) + activesupport (>= 3.0.0, < 5.1) + multi_json (~> 1.2) + jquery-rails (4.1.0) + rails-dom-testing (~> 1.0) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (1.8.3) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.3) + mime-types (>= 1.16, < 3) + method_source (0.8.2) + mime-types (2.99) + mini_portile2 (2.0.0) + minitest (5.8.4) + multi_json (1.11.2) + multi_xml (0.5.5) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (3.0.2) + nokogiri (1.6.7.2) + mini_portile2 (~> 2.0.0.rc2) + pg (0.18.4) + pry (0.10.3) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + puma (2.16.0) + rack (1.6.4) + rack-test (0.6.3) + rack (>= 1.0) + rails (4.2.5.1) + actionmailer (= 4.2.5.1) + actionpack (= 4.2.5.1) + actionview (= 4.2.5.1) + activejob (= 4.2.5.1) + activemodel (= 4.2.5.1) + activerecord (= 4.2.5.1) + activesupport (= 4.2.5.1) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.5.1) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.7) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + rails_12factor (0.0.3) + rails_serve_static_assets + rails_stdout_logging + rails_serve_static_assets (0.0.5) + rails_stdout_logging (0.0.4) + railties (4.2.5.1) + actionpack (= 4.2.5.1) + activesupport (= 4.2.5.1) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (10.5.0) + rdoc (4.2.2) + json (~> 1.4) + rspec-core (3.4.3) + rspec-support (~> 3.4.0) + rspec-expectations (3.4.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.4.0) + rspec-mocks (3.4.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.4.0) + rspec-rails (3.4.2) + actionpack (>= 3.0, < 4.3) + activesupport (>= 3.0, < 4.3) + railties (>= 3.0, < 4.3) + rspec-core (~> 3.4.0) + rspec-expectations (~> 3.4.0) + rspec-mocks (~> 3.4.0) + rspec-support (~> 3.4.0) + rspec-support (3.4.1) + sass (3.4.21) + sass-rails (5.0.4) + railties (>= 4.0.0, < 5.0) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + sdoc (0.4.1) + json (~> 1.7, >= 1.7.7) + rdoc (~> 4.0) + slop (3.6.0) + spring (1.6.3) + sprockets (3.5.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.0.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sshkit (1.8.1) + net-scp (>= 1.1.2) + net-ssh (>= 2.8.0) + table_print (1.5.4) + thor (0.19.1) + thread_safe (0.3.5) + tilt (2.0.2) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (2.7.2) + execjs (>= 0.3.0) + json (>= 1.8.0) + web-console (2.3.0) + activemodel (>= 4.0) + binding_of_caller (>= 0.7.2) + railties (>= 4.0) + sprockets-rails (>= 2.0, < 4.0) + +PLATFORMS + ruby + +DEPENDENCIES + apns + byebug + capistrano + capistrano-bundler + capistrano-rails + capistrano-rvm + capistrano3-puma + factory_girl_rails + faker + httparty + jbuilder (~> 2.0) + jquery-rails + pg (~> 0.15) + pry + puma + rails (= 4.2.5.1) + rails_12factor + rspec-rails + sass-rails (~> 5.0) + sdoc (~> 0.4.0) + spring + table_print + uglifier (>= 1.3.0) + web-console (~> 2.0) + +BUNDLED WITH + 1.11.2 diff --git a/server-side-rails-app/README.rdoc b/server-side-rails-app/README.rdoc new file mode 100644 index 0000000..dd4e97e --- /dev/null +++ b/server-side-rails-app/README.rdoc @@ -0,0 +1,28 @@ +== README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... + + +Please feel free to use a different markup language if you do not plan to run +rake doc:app. diff --git a/server-side-rails-app/Rakefile b/server-side-rails-app/Rakefile new file mode 100644 index 0000000..ba6b733 --- /dev/null +++ b/server-side-rails-app/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Rails.application.load_tasks diff --git a/server-side-rails-app/app/assets/images/.keep b/server-side-rails-app/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/server-side-rails-app/app/assets/javascripts/application.js b/server-side-rails-app/app/assets/javascripts/application.js new file mode 100644 index 0000000..646c5ab --- /dev/null +++ b/server-side-rails-app/app/assets/javascripts/application.js @@ -0,0 +1,15 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require jquery +//= require jquery_ujs +//= require_tree . diff --git a/server-side-rails-app/app/assets/stylesheets/application.css b/server-side-rails-app/app/assets/stylesheets/application.css new file mode 100644 index 0000000..f9cd5b3 --- /dev/null +++ b/server-side-rails-app/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/server-side-rails-app/app/controllers/application_controller.rb b/server-side-rails-app/app/controllers/application_controller.rb new file mode 100644 index 0000000..9e7c494 --- /dev/null +++ b/server-side-rails-app/app/controllers/application_controller.rb @@ -0,0 +1,5 @@ +class ApplicationController < ActionController::Base + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :null_session +end diff --git a/server-side-rails-app/app/controllers/concerns/.keep b/server-side-rails-app/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/server-side-rails-app/app/controllers/events_controller.rb b/server-side-rails-app/app/controllers/events_controller.rb new file mode 100644 index 0000000..696fa46 --- /dev/null +++ b/server-side-rails-app/app/controllers/events_controller.rb @@ -0,0 +1,55 @@ +class EventsController < ApplicationController + + def index + @events = Event.all.order(created_at: :desc) + end + + def create + @event = load_event + if (@event) + puts "Updating existing event" + update_event + else + puts "Creating new event" + @event = Event.new( + google_event_id: params["id"], + name: params["name"], + address: params["address"], + user_email: params["user_email"], + start_time: params["start_time"], + departure_time: params["departure_time"], + device_token: params["device_token"], + user_lat: params["user_lat"], + user_lng: params["user_lng"], + event_lat: params["event_lat"], + event_lng: params["event_lng"] + ) + end + + if @event.save + render text: "Event saved #{@event.google_event_id}" + else + render text: 'Event not saved' + puts "Not saving #{@event.google_event_id}" + end + end + + private + + def update_event + @event.name = params["name"] + @event.address = params["address"] + @event.user_email = params["user_email"] + @event.start_time = params["start_time"] + @event.device_token = params["device_token"] + @event.user_lat = params["user_lat"] + @event.user_lng = params["user_lng"] + @event.event_lat = params["event_lat"] + @event.event_lng = params["event_lng"] + end + + def load_event + Event.find_by(google_event_id: params[:id]) + end + +end diff --git a/server-side-rails-app/app/helpers/application_helper.rb b/server-side-rails-app/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/server-side-rails-app/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/server-side-rails-app/app/mailers/.keep b/server-side-rails-app/app/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/server-side-rails-app/app/models/.keep b/server-side-rails-app/app/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/server-side-rails-app/app/models/concerns/.keep b/server-side-rails-app/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/server-side-rails-app/app/models/event.rb b/server-side-rails-app/app/models/event.rb new file mode 100644 index 0000000..f145845 --- /dev/null +++ b/server-side-rails-app/app/models/event.rb @@ -0,0 +1,17 @@ +class Event < ActiveRecord::Base + validates :name, presence: true + validates :address, presence: true + validates :user_email, presence: true + validates :start_time, presence: true + validates :device_token, presence: true + + before_save :set_new_latest + + def set_new_latest + prev_notified = Event.where(user_email: user_email, google_event_id: self.google_event_id).where(has_notified: true).exists? + if prev_notified + errors.add(:base, 'Event already_notified') + end + end + +end diff --git a/server-side-rails-app/app/views/events/index.html.erb b/server-side-rails-app/app/views/events/index.html.erb new file mode 100644 index 0000000..d8e144e --- /dev/null +++ b/server-side-rails-app/app/views/events/index.html.erb @@ -0,0 +1,18 @@ +<% @events.each do |event| %> +

Name: <%= event.name %>

+

Address: <%= event.address %>

+

Start Time: <%= event.start_time %>

+

Departure Time: <%= event.departure_time %>

+

is_latest: <%= event.is_latest %>

+

has_notified: <%= event.has_notified %>

+

created_at: <%= event.created_at %>

+

updated_at: <%= event.updated_at %>

+

Device Token Present: <%= !!event.device_token %>

+

Device Token: <%= event.device_token %>

+

user_lat:<%= event.user_lat %>

+

user_lng:<%= event.user_lng %>

+

event_lat:<%= event.event_lat %>

+

event_lng:<%= event.event_lng %>

+
+
+<% end %> diff --git a/server-side-rails-app/app/views/layouts/application.html.erb b/server-side-rails-app/app/views/layouts/application.html.erb new file mode 100644 index 0000000..215a014 --- /dev/null +++ b/server-side-rails-app/app/views/layouts/application.html.erb @@ -0,0 +1,13 @@ + + + + Get Moving Rails Server! + <%= stylesheet_link_tag 'application', media: 'all' %> + <%= javascript_include_tag 'application' %> + + + +<%= yield %> + + + diff --git a/server-side-rails-app/bin/bundle b/server-side-rails-app/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/server-side-rails-app/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/server-side-rails-app/bin/rails b/server-side-rails-app/bin/rails new file mode 100755 index 0000000..0138d79 --- /dev/null +++ b/server-side-rails-app/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', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/server-side-rails-app/bin/rake b/server-side-rails-app/bin/rake new file mode 100755 index 0000000..d87d5f5 --- /dev/null +++ b/server-side-rails-app/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/server-side-rails-app/bin/setup b/server-side-rails-app/bin/setup new file mode 100755 index 0000000..acdb2c1 --- /dev/null +++ b/server-side-rails-app/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.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 || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/server-side-rails-app/bin/spring b/server-side-rails-app/bin/spring new file mode 100755 index 0000000..62ec28f --- /dev/null +++ b/server-side-rails-app/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 } + gem 'spring', match[1] + require 'spring/binstub' + end +end diff --git a/server-side-rails-app/config.ru b/server-side-rails-app/config.ru new file mode 100644 index 0000000..bd83b25 --- /dev/null +++ b/server-side-rails-app/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/server-side-rails-app/config/application.rb b/server-side-rails-app/config/application.rb new file mode 100644 index 0000000..ca72afb --- /dev/null +++ b/server-side-rails-app/config/application.rb @@ -0,0 +1,37 @@ +require File.expand_path('../boot', __FILE__) + +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_job/railtie" +require "active_record/railtie" +require "action_controller/railtie" +require "action_mailer/railtie" +require "action_view/railtie" +require "sprockets/railtie" +# require "rails/test_unit/railtie" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module GetMovingRails + 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. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + + + end +end diff --git a/server-side-rails-app/config/boot.rb b/server-side-rails-app/config/boot.rb new file mode 100644 index 0000000..6b750f0 --- /dev/null +++ b/server-side-rails-app/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/server-side-rails-app/config/cert.pem b/server-side-rails-app/config/cert.pem new file mode 100644 index 0000000..8d57047 --- /dev/null +++ b/server-side-rails-app/config/cert.pem @@ -0,0 +1,144 @@ +Bag Attributes + friendlyName: Apple Push Services: com.scass.rjsn.DiaryList + localKeyID: 2A B3 1C 1E BA F4 60 87 FD CF D9 57 20 30 35 2C 99 65 AC 41 +subject=/UID=com.scass.rjsn.DiaryList/CN=Apple Push Services: com.scass.rjsn.DiaryList/OU=ADG3UY38G6/O=Yi Lu/C=US +issuer=/C=US/O=Apple Inc./OU=Apple Worldwide Developer Relations/CN=Apple Worldwide Developer Relations Certification Authority +-----BEGIN CERTIFICATE----- +MIIGMDCCBRigAwIBAgIIChRT0YC4sZIwDQYJKoZIhvcNAQELBQAwgZYxCzAJBgNV +BAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3Js +ZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3 +aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw +HhcNMTYwMjIyMjExMDE0WhcNMTcwMzIzMjExMDE0WjCBlDEoMCYGCgmSJomT8ixk +AQEMGGNvbS5zY2Fzcy5yanNuLkRpYXJ5TGlzdDE2MDQGA1UEAwwtQXBwbGUgUHVz +aCBTZXJ2aWNlczogY29tLnNjYXNzLnJqc24uRGlhcnlMaXN0MRMwEQYDVQQLDApB +REczVVkzOEc2MQ4wDAYDVQQKDAVZaSBMdTELMAkGA1UEBhMCVVMwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQC0nPqo3EPJP0RTSFsf4abLnBGZZ9F9mNbA +pGNO5Bwp52OTxXoWUJuz/zcVLcPl96elyBgJL4pIUQWJi7/4jTUK4JGrGo8aVDK2 +cqqA544bzg7Tlt8iEK5TDPInYfgdIkuHRZm0r9uUtZan/C4yiKk+RJyK99iEj/FN +pEzbDDhcld9uzGNnHLe9/nmHg3hM1NuKMmfpGuRWix+mBYqA49Y19wJFhGArZ9Zl +t9p8nkLA/VgFmWk1cAB3aMyH/Z+MkALZTfc67BgewSxxXIIUxPSOHpOLuG1uHV7r +OVq5TU0ZPD2oPGlO/59yBJBGJhx4kTTG12o75zQ9iv3k9UrZn2FxAgMBAAGjggKA +MIICfDAdBgNVHQ4EFgQUKrMcHrr0YIf9z9lXIDA1LJllrEEwDAYDVR0TAQH/BAIw +ADAfBgNVHSMEGDAWgBSIJxcJqbYYYIvs67r2R1nFUlSjtzCCARwGA1UdIASCARMw +ggEPMIIBCwYJKoZIhvdjZAUBMIH9MIHDBggrBgEFBQcCAjCBtgyBs1JlbGlhbmNl +IG9uIHRoaXMgY2VydGlmaWNhdGUgYnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0 +YW5jZSBvZiB0aGUgdGhlbiBhcHBsaWNhYmxlIHN0YW5kYXJkIHRlcm1zIGFuZCBj +b25kaXRpb25zIG9mIHVzZSwgY2VydGlmaWNhdGUgcG9saWN5IGFuZCBjZXJ0aWZp +Y2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudHMuMDUGCCsGAQUFBwIBFilodHRwOi8v +d3d3LmFwcGxlLmNvbS9jZXJ0aWZpY2F0ZWF1dGhvcml0eTAwBgNVHR8EKTAnMCWg +I6Ahhh9odHRwOi8vY3JsLmFwcGxlLmNvbS93d2RyY2EuY3JsMA4GA1UdDwEB/wQE +AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAjAQBgoqhkiG92NkBgMBBAIFADAQBgoq +hkiG92NkBgMCBAIFADCBkAYKKoZIhvdjZAYDBgSBgTB/DBhjb20uc2Nhc3Mucmpz +bi5EaWFyeUxpc3QwBQwDYXBwDB1jb20uc2Nhc3Mucmpzbi5EaWFyeUxpc3Qudm9p +cDAGDAR2b2lwDCVjb20uc2Nhc3Mucmpzbi5EaWFyeUxpc3QuY29tcGxpY2F0aW9u +MA4MDGNvbXBsaWNhdGlvbjANBgkqhkiG9w0BAQsFAAOCAQEAntQIiUYzC3aG67rO +iaFysUS3oCd13i0VQQpxHDS7AhBrPWwBMqLHRrwJsFGR6hFWw7Hfm8d50dow5TE+ +y9cuf3p9Cba4838dSvbs7MWaZMSbIwZArwdvnjWBu+CSl6kl5wD1ily2M4BHbpyX +iWJxmHYeSy2s1UoSMImARX9wIgIFaM8WYAW15dIWmXursFH6rgmLYjLMmLIENcs0 +9RQOLbfpXpcFcnmZw3GMBAbb1JLgD8CJXpPkueQAkAtWzWmZ3CXg43aGm0A/glyd +0450LfN6eUkRxomHdQ6xpQI2RyRGSCjxSwWAhHzG7y4ugfUB2vbDiZjwBiWgMtwu +4PWxKw== +-----END CERTIFICATE----- +Bag Attributes + friendlyName: Apple Push Services: com.scass.rjsn.DiaryList + localKeyID: 2A B3 1C 1E BA F4 60 87 FD CF D9 57 20 30 35 2C 99 65 AC 41 +subject=/UID=com.scass.rjsn.DiaryList/CN=Apple Push Services: com.scass.rjsn.DiaryList/OU=ADG3UY38G6/O=Yi Lu/C=US +issuer=/C=US/O=Apple Inc./OU=Apple Worldwide Developer Relations/CN=Apple Worldwide Developer Relations Certification Authority +-----BEGIN CERTIFICATE----- +MIIGMDCCBRigAwIBAgIIChRT0YC4sZIwDQYJKoZIhvcNAQELBQAwgZYxCzAJBgNV +BAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3Js +ZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3 +aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw +HhcNMTYwMjIyMjExMDE0WhcNMTcwMzIzMjExMDE0WjCBlDEoMCYGCgmSJomT8ixk +AQEMGGNvbS5zY2Fzcy5yanNuLkRpYXJ5TGlzdDE2MDQGA1UEAwwtQXBwbGUgUHVz +aCBTZXJ2aWNlczogY29tLnNjYXNzLnJqc24uRGlhcnlMaXN0MRMwEQYDVQQLDApB +REczVVkzOEc2MQ4wDAYDVQQKDAVZaSBMdTELMAkGA1UEBhMCVVMwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQC0nPqo3EPJP0RTSFsf4abLnBGZZ9F9mNbA +pGNO5Bwp52OTxXoWUJuz/zcVLcPl96elyBgJL4pIUQWJi7/4jTUK4JGrGo8aVDK2 +cqqA544bzg7Tlt8iEK5TDPInYfgdIkuHRZm0r9uUtZan/C4yiKk+RJyK99iEj/FN +pEzbDDhcld9uzGNnHLe9/nmHg3hM1NuKMmfpGuRWix+mBYqA49Y19wJFhGArZ9Zl +t9p8nkLA/VgFmWk1cAB3aMyH/Z+MkALZTfc67BgewSxxXIIUxPSOHpOLuG1uHV7r +OVq5TU0ZPD2oPGlO/59yBJBGJhx4kTTG12o75zQ9iv3k9UrZn2FxAgMBAAGjggKA +MIICfDAdBgNVHQ4EFgQUKrMcHrr0YIf9z9lXIDA1LJllrEEwDAYDVR0TAQH/BAIw +ADAfBgNVHSMEGDAWgBSIJxcJqbYYYIvs67r2R1nFUlSjtzCCARwGA1UdIASCARMw +ggEPMIIBCwYJKoZIhvdjZAUBMIH9MIHDBggrBgEFBQcCAjCBtgyBs1JlbGlhbmNl +IG9uIHRoaXMgY2VydGlmaWNhdGUgYnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0 +YW5jZSBvZiB0aGUgdGhlbiBhcHBsaWNhYmxlIHN0YW5kYXJkIHRlcm1zIGFuZCBj +b25kaXRpb25zIG9mIHVzZSwgY2VydGlmaWNhdGUgcG9saWN5IGFuZCBjZXJ0aWZp +Y2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudHMuMDUGCCsGAQUFBwIBFilodHRwOi8v +d3d3LmFwcGxlLmNvbS9jZXJ0aWZpY2F0ZWF1dGhvcml0eTAwBgNVHR8EKTAnMCWg +I6Ahhh9odHRwOi8vY3JsLmFwcGxlLmNvbS93d2RyY2EuY3JsMA4GA1UdDwEB/wQE +AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAjAQBgoqhkiG92NkBgMBBAIFADAQBgoq +hkiG92NkBgMCBAIFADCBkAYKKoZIhvdjZAYDBgSBgTB/DBhjb20uc2Nhc3Mucmpz +bi5EaWFyeUxpc3QwBQwDYXBwDB1jb20uc2Nhc3Mucmpzbi5EaWFyeUxpc3Qudm9p +cDAGDAR2b2lwDCVjb20uc2Nhc3Mucmpzbi5EaWFyeUxpc3QuY29tcGxpY2F0aW9u +MA4MDGNvbXBsaWNhdGlvbjANBgkqhkiG9w0BAQsFAAOCAQEAntQIiUYzC3aG67rO +iaFysUS3oCd13i0VQQpxHDS7AhBrPWwBMqLHRrwJsFGR6hFWw7Hfm8d50dow5TE+ +y9cuf3p9Cba4838dSvbs7MWaZMSbIwZArwdvnjWBu+CSl6kl5wD1ily2M4BHbpyX +iWJxmHYeSy2s1UoSMImARX9wIgIFaM8WYAW15dIWmXursFH6rgmLYjLMmLIENcs0 +9RQOLbfpXpcFcnmZw3GMBAbb1JLgD8CJXpPkueQAkAtWzWmZ3CXg43aGm0A/glyd +0450LfN6eUkRxomHdQ6xpQI2RyRGSCjxSwWAhHzG7y4ugfUB2vbDiZjwBiWgMtwu +4PWxKw== +-----END CERTIFICATE----- +Bag Attributes + friendlyName: Yi Lu + localKeyID: 2A B3 1C 1E BA F4 60 87 FD CF D9 57 20 30 35 2C 99 65 AC 41 +Key Attributes: +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEAtJz6qNxDyT9EU0hbH+Gmy5wRmWfRfZjWwKRjTuQcKedjk8V6 +FlCbs/83FS3D5fenpcgYCS+KSFEFiYu/+I01CuCRqxqPGlQytnKqgOeOG84O05bf +IhCuUwzyJ2H4HSJLh0WZtK/blLWWp/wuMoipPkScivfYhI/xTaRM2ww4XJXfbsxj +Zxy3vf55h4N4TNTbijJn6RrkVosfpgWKgOPWNfcCRYRgK2fWZbfafJ5CwP1YBZlp +NXAAd2jMh/2fjJAC2U33OuwYHsEscVyCFMT0jh6Ti7htbh1e6zlauU1NGTw9qDxp +Tv+fcgSQRiYceJE0xtdqO+c0PYr95PVK2Z9hcQIDAQABAoIBAEtvNRHJzVYEYpkW +I1kRegSYTpFv1wNKDoevIPsWMt0dk21okTE4wY9QDMV/s84cvZx0EfXkMTE7BcEI +6Uj6USkV2kFIenRYrkWdZrEoBSZ/zZl57f/gT67IPWtNc79XT4xT+XqJ6IAXx7Cp +lvHsOiOTrH4uPfQ/2ly/PopOdEvWaD4LUaEjezSLcOde16Cy5+WN2VnlBussO3k3 +rQDRJ/2LmwR1wVy1/ynYdpKN2z6CsPEghg8QYo29l76AhcbgdN3O0+IfDrIKOI8v +ehDrqOIi+9vy35I4/ThcRmlXSIb1HETle+ufXVcoTq8KBbwBe6nY+wa0ASrmoB2H +D+j5WjECgYEA7rOXx3/3dWKUee0+nBF9LyUyj9k1slVWv8wx2zd2ZY9FSxQCZMWi +detIhynwhsbZS4UvmSsaTv8StNuFzNTS3F+LwIgzCb1UOA9zxSv6f0U10/lrtcSK +RZ62JdDh6Iky+9f/3CdlQTYENtDvlWeqdByD8xaHB+vEYdLKdijyiK8CgYEAwbO6 +PgkkK8xedmRc4x6f+3nbraQX6pYRofqk03VKMRpVdMByLYEpVsDFJChTcimr5DZT +rFrIJ3r0I063Ab+S/bbj55p9pAMkgOune3mEEneGHZgSn5jiYHp53ZOhqHEVFgY9 +qoL3UvzWSGegWspaPewDSVvHk7Hio6nzCdAM/98CgYEA3DERFvhFpqQcQOkH82Hy +r5XJsYZ2ER7F2kGb0BO2hPMHwb0ghCMHvW0gR4b5mOo/snmWsd1f9HU5pVpHb+72 +4FDHEwDQy/A5i0k9yynJdrO6duLDaDZ4Msa4UeQBMMe3HzhejpBMyD3y3zoXeCPb +yiYv1gL25uinDHItT5hwOoMCgYEAvAAsqzlEGh5pMI+IeAepTvKe/JFfhRfSVVxn +zbTxJWdhucdvCitqbAD9VnKtSwiXBRCVdZtG2MrFWd90UAYYLJft60RO3XkPXPFb +xMPUI/hN+zs2GCDS1sEItr4rEMlwpce44l3qnmk3sV6ijHwJyj/fkLu7oOXuCttQ +QB3mABECgYEA5NZpkYjN81qrW7oLoKYLZFzzuCX50tj6cqqEnZCfaelp3MHYqbT0 +A85lKVrq6WTDu8bCxOM9KtYxfzkmpQp9VGdgHn+99Enh+E13UoBZhwhQch7dhsJ5 +PJl8KpxwPMsfdPu1L6rX96IvQvXgVussFGoNaWzg/Xlktk61wxspf7E= +-----END RSA PRIVATE KEY----- +Bag Attributes + friendlyName: Yi Lu + localKeyID: 2A B3 1C 1E BA F4 60 87 FD CF D9 57 20 30 35 2C 99 65 AC 41 +Key Attributes: +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEAtJz6qNxDyT9EU0hbH+Gmy5wRmWfRfZjWwKRjTuQcKedjk8V6 +FlCbs/83FS3D5fenpcgYCS+KSFEFiYu/+I01CuCRqxqPGlQytnKqgOeOG84O05bf +IhCuUwzyJ2H4HSJLh0WZtK/blLWWp/wuMoipPkScivfYhI/xTaRM2ww4XJXfbsxj +Zxy3vf55h4N4TNTbijJn6RrkVosfpgWKgOPWNfcCRYRgK2fWZbfafJ5CwP1YBZlp +NXAAd2jMh/2fjJAC2U33OuwYHsEscVyCFMT0jh6Ti7htbh1e6zlauU1NGTw9qDxp +Tv+fcgSQRiYceJE0xtdqO+c0PYr95PVK2Z9hcQIDAQABAoIBAEtvNRHJzVYEYpkW +I1kRegSYTpFv1wNKDoevIPsWMt0dk21okTE4wY9QDMV/s84cvZx0EfXkMTE7BcEI +6Uj6USkV2kFIenRYrkWdZrEoBSZ/zZl57f/gT67IPWtNc79XT4xT+XqJ6IAXx7Cp +lvHsOiOTrH4uPfQ/2ly/PopOdEvWaD4LUaEjezSLcOde16Cy5+WN2VnlBussO3k3 +rQDRJ/2LmwR1wVy1/ynYdpKN2z6CsPEghg8QYo29l76AhcbgdN3O0+IfDrIKOI8v +ehDrqOIi+9vy35I4/ThcRmlXSIb1HETle+ufXVcoTq8KBbwBe6nY+wa0ASrmoB2H +D+j5WjECgYEA7rOXx3/3dWKUee0+nBF9LyUyj9k1slVWv8wx2zd2ZY9FSxQCZMWi +detIhynwhsbZS4UvmSsaTv8StNuFzNTS3F+LwIgzCb1UOA9zxSv6f0U10/lrtcSK +RZ62JdDh6Iky+9f/3CdlQTYENtDvlWeqdByD8xaHB+vEYdLKdijyiK8CgYEAwbO6 +PgkkK8xedmRc4x6f+3nbraQX6pYRofqk03VKMRpVdMByLYEpVsDFJChTcimr5DZT +rFrIJ3r0I063Ab+S/bbj55p9pAMkgOune3mEEneGHZgSn5jiYHp53ZOhqHEVFgY9 +qoL3UvzWSGegWspaPewDSVvHk7Hio6nzCdAM/98CgYEA3DERFvhFpqQcQOkH82Hy +r5XJsYZ2ER7F2kGb0BO2hPMHwb0ghCMHvW0gR4b5mOo/snmWsd1f9HU5pVpHb+72 +4FDHEwDQy/A5i0k9yynJdrO6duLDaDZ4Msa4UeQBMMe3HzhejpBMyD3y3zoXeCPb +yiYv1gL25uinDHItT5hwOoMCgYEAvAAsqzlEGh5pMI+IeAepTvKe/JFfhRfSVVxn +zbTxJWdhucdvCitqbAD9VnKtSwiXBRCVdZtG2MrFWd90UAYYLJft60RO3XkPXPFb +xMPUI/hN+zs2GCDS1sEItr4rEMlwpce44l3qnmk3sV6ijHwJyj/fkLu7oOXuCttQ +QB3mABECgYEA5NZpkYjN81qrW7oLoKYLZFzzuCX50tj6cqqEnZCfaelp3MHYqbT0 +A85lKVrq6WTDu8bCxOM9KtYxfzkmpQp9VGdgHn+99Enh+E13UoBZhwhQch7dhsJ5 +PJl8KpxwPMsfdPu1L6rX96IvQvXgVussFGoNaWzg/Xlktk61wxspf7E= +-----END RSA PRIVATE KEY----- diff --git a/server-side-rails-app/config/database.yml b/server-side-rails-app/config/database.yml new file mode 100644 index 0000000..918be36 --- /dev/null +++ b/server-side-rails-app/config/database.yml @@ -0,0 +1,84 @@ +# PostgreSQL. Versions 8.2 and up are supported. +# +# Install the pg driver: +# gem install pg +# On OS X with Homebrew: +# gem install pg -- --with-pg-config=/usr/local/bin/pg_config +# On OS X with MacPorts: +# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config +# On Windows: +# gem install pg +# Choose the win32 build. +# Install PostgreSQL and put its /bin directory on your path. +# +# Configure Using Gemfile +# gem 'pg' +# +default: &default + adapter: postgresql + encoding: unicode + host: localhost + # For details on connection pooling, see rails configuration guide + # http://guides.rubyonrails.org/configuring.html#database-pooling + pool: 5 + +development: + <<: *default + database: get_moving_rails_development + + # The specified database role being used to connect to postgres. + # To create additional roles in postgres see `$ createuser --help`. + # When left blank, postgres will use the default role. This is + # the same name as the operating system user that initialized the database. + #username: get_moving_rails + + # The password associated with the postgres role (username). + #password: + + # Connect on a TCP socket. Omitted by default since the client uses a + # domain socket that doesn't need configuration. Windows does not have + # domain sockets, so uncomment these lines. + #host: localhost + + # The TCP port the server listens on. Defaults to 5432. + # If your server runs on a different port number, change accordingly. + #port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # Defaults to warning. + #min_messages: notice + +# 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: get_moving_rails_test + +# As with config/secrets.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password as a unix environment variable when you boot +# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full rundown on how to provide these environment variables in a +# production deployment. +# +# On Heroku and other platform providers, you may have a full connection URL +# available as an environment variable. For example: +# +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" +# +# You can use this database configuration with: +# +# production: +# url: <%= ENV['DATABASE_URL'] %> +# +production: + <<: *default + database: get_moving_rails_production diff --git a/server-side-rails-app/config/deploy.rb b/server-side-rails-app/config/deploy.rb new file mode 100644 index 0000000..5c9bd19 --- /dev/null +++ b/server-side-rails-app/config/deploy.rb @@ -0,0 +1,84 @@ +# Change these +server 'rng2', port: 22, roles: [:web, :app, :db], primary: true + +set :repo_url, 'git@github.com:nyc-chorus-frogs-2016/get-moving-rails.git' +set :application, 'get-moving-rails' +set :user, 'rng2' +set :puma_threads, [4, 16] +set :puma_workers, 0 + +# Don't change these unless you know what you're doing +set :pty, true +set :use_sudo, false +set :stage, :production +set :deploy_via, :remote_cache +set :deploy_to, "/home/#{fetch(:user)}/apps/#{fetch(:application)}" +set :puma_bind, "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock" +set :puma_state, "#{shared_path}/tmp/pids/puma.state" +set :puma_pid, "#{shared_path}/tmp/pids/puma.pid" +set :puma_access_log, "#{release_path}/log/puma.error.log" +set :puma_error_log, "#{release_path}/log/puma.access.log" +set :ssh_options, { forward_agent: true, user: fetch(:user), keys: %w(~/.ssh/id_rsa.pub) } +set :puma_preload_app, true +set :puma_worker_timeout, nil +set :puma_init_active_record, true # Change to false when not using ActiveRecord + +## Defaults: +# set :scm, :git +# set :branch, :master +# set :format, :pretty +# set :log_level, :debug +# set :keep_releases, 5 + +## Linked Files & Directories (Default None): +# set :linked_files, %w{config/database.yml} +# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system} + +namespace :puma do + desc 'Create Directories for Puma Pids and Socket' + task :make_dirs do + on roles(:app) do + execute "mkdir #{shared_path}/tmp/sockets -p" + execute "mkdir #{shared_path}/tmp/pids -p" + end + end + + before :start, :make_dirs +end + +namespace :deploy do + desc "Make sure local git is in sync with remote." + task :check_revision do + on roles(:app) do + unless `git rev-parse HEAD` == `git rev-parse origin/master` + puts "WARNING: HEAD is not the same as origin/master" + puts "Run `git push` to sync changes." + exit + end + end + end + + desc 'Initial Deploy' + task :initial do + on roles(:app) do + before 'deploy:restart', 'puma:start' + invoke 'deploy' + end + end + + desc 'Restart application' + task :restart do + on roles(:app), in: :sequence, wait: 5 do + invoke 'puma:restart' + end + end + + before :starting, :check_revision + after :finishing, :compile_assets + after :finishing, :cleanup + after :finishing, :restart +end + +# ps aux | grep puma # Get puma pid +# kill -s SIGUSR2 pid # Restart puma +# kill -s SIGTERM pid # Stop puma \ No newline at end of file diff --git a/server-side-rails-app/config/deploy/production.rb b/server-side-rails-app/config/deploy/production.rb new file mode 100644 index 0000000..4fc06fa --- /dev/null +++ b/server-side-rails-app/config/deploy/production.rb @@ -0,0 +1,61 @@ +# server-based syntax +# ====================== +# Defines a single server with a list of roles and multiple properties. +# You can define all roles on a single server, or split them: + +# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value +# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value +# server 'db.example.com', user: 'deploy', roles: %w{db} + + + +# role-based syntax +# ================== + +# Defines a role with one or multiple servers. The primary server in each +# group is considered to be the first unless any hosts have the primary +# property set. Specify the username and a domain or IP for the server. +# Don't use `:all`, it's a meta role. + +# role :app, %w{deploy@example.com}, my_property: :my_value +# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value +# role :db, %w{deploy@example.com} + + + +# Configuration +# ============= +# You can set any configuration variable like in config/deploy.rb +# These variables are then only loaded and set in this stage. +# For available Capistrano configuration variables see the documentation page. +# http://capistranorb.com/documentation/getting-started/configuration/ +# Feel free to add new variables to customise your setup. + + + +# Custom SSH Options +# ================== +# You may pass any option but keep in mind that net/ssh understands a +# limited set of options, consult the Net::SSH documentation. +# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start +# +# Global options +# -------------- +# set :ssh_options, { +# keys: %w(/home/rlisowski/.ssh/id_rsa), +# forward_agent: false, +# auth_methods: %w(password) +# } +# +# The server-based syntax can be used to override options: +# ------------------------------------ +# server 'example.com', +# user: 'user_name', +# roles: %w{web app}, +# ssh_options: { +# user: 'user_name', # overrides user setting above +# keys: %w(/home/user_name/.ssh/id_rsa), +# forward_agent: false, +# auth_methods: %w(publickey password) +# # password: 'please use keys' +# } diff --git a/server-side-rails-app/config/deploy/staging.rb b/server-side-rails-app/config/deploy/staging.rb new file mode 100644 index 0000000..4fc06fa --- /dev/null +++ b/server-side-rails-app/config/deploy/staging.rb @@ -0,0 +1,61 @@ +# server-based syntax +# ====================== +# Defines a single server with a list of roles and multiple properties. +# You can define all roles on a single server, or split them: + +# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value +# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value +# server 'db.example.com', user: 'deploy', roles: %w{db} + + + +# role-based syntax +# ================== + +# Defines a role with one or multiple servers. The primary server in each +# group is considered to be the first unless any hosts have the primary +# property set. Specify the username and a domain or IP for the server. +# Don't use `:all`, it's a meta role. + +# role :app, %w{deploy@example.com}, my_property: :my_value +# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value +# role :db, %w{deploy@example.com} + + + +# Configuration +# ============= +# You can set any configuration variable like in config/deploy.rb +# These variables are then only loaded and set in this stage. +# For available Capistrano configuration variables see the documentation page. +# http://capistranorb.com/documentation/getting-started/configuration/ +# Feel free to add new variables to customise your setup. + + + +# Custom SSH Options +# ================== +# You may pass any option but keep in mind that net/ssh understands a +# limited set of options, consult the Net::SSH documentation. +# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start +# +# Global options +# -------------- +# set :ssh_options, { +# keys: %w(/home/rlisowski/.ssh/id_rsa), +# forward_agent: false, +# auth_methods: %w(password) +# } +# +# The server-based syntax can be used to override options: +# ------------------------------------ +# server 'example.com', +# user: 'user_name', +# roles: %w{web app}, +# ssh_options: { +# user: 'user_name', # overrides user setting above +# keys: %w(/home/user_name/.ssh/id_rsa), +# forward_agent: false, +# auth_methods: %w(publickey password) +# # password: 'please use keys' +# } diff --git a/server-side-rails-app/config/environment.rb b/server-side-rails-app/config/environment.rb new file mode 100644 index 0000000..ee8d90d --- /dev/null +++ b/server-side-rails-app/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/server-side-rails-app/config/environments/development.rb b/server-side-rails-app/config/environments/development.rb new file mode 100644 index 0000000..b55e214 --- /dev/null +++ b/server-side-rails-app/config/environments/development.rb @@ -0,0 +1,41 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # 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 + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = 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 + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/server-side-rails-app/config/environments/production.rb b/server-side-rails-app/config/environments/production.rb new file mode 100644 index 0000000..5c1b32e --- /dev/null +++ b/server-side-rails-app/config/environments/production.rb @@ -0,0 +1,79 @@ +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 + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # 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 + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # 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 + + # 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 = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # 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 + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/server-side-rails-app/config/environments/test.rb b/server-side-rails-app/config/environments/test.rb new file mode 100644 index 0000000..1c19f08 --- /dev/null +++ b/server-side-rails-app/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 static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_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 + + # 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 + + # Randomize the order test cases are executed. + config.active_support.test_order = :random + + # 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/server-side-rails-app/config/initializers/apns.rb b/server-side-rails-app/config/initializers/apns.rb new file mode 100644 index 0000000..2848812 --- /dev/null +++ b/server-side-rails-app/config/initializers/apns.rb @@ -0,0 +1 @@ +APNS.pem = File.join(Rails.root, 'config', 'cert.pem') diff --git a/server-side-rails-app/config/initializers/assets.rb b/server-side-rails-app/config/initializers/assets.rb new file mode 100644 index 0000000..01ef3e6 --- /dev/null +++ b/server-side-rails-app/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/server-side-rails-app/config/initializers/backtrace_silencers.rb b/server-side-rails-app/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/server-side-rails-app/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/server-side-rails-app/config/initializers/cookies_serializer.rb b/server-side-rails-app/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7f70458 --- /dev/null +++ b/server-side-rails-app/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/server-side-rails-app/config/initializers/filter_parameter_logging.rb b/server-side-rails-app/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/server-side-rails-app/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/server-side-rails-app/config/initializers/inflections.rb b/server-side-rails-app/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/server-side-rails-app/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/server-side-rails-app/config/initializers/mime_types.rb b/server-side-rails-app/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/server-side-rails-app/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/server-side-rails-app/config/initializers/session_store.rb b/server-side-rails-app/config/initializers/session_store.rb new file mode 100644 index 0000000..dc43fb3 --- /dev/null +++ b/server-side-rails-app/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: '_get_moving_rails_session' diff --git a/server-side-rails-app/config/initializers/wrap_parameters.rb b/server-side-rails-app/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..33725e9 --- /dev/null +++ b/server-side-rails-app/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] if respond_to?(:wrap_parameters) +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/server-side-rails-app/config/locales/en.yml b/server-side-rails-app/config/locales/en.yml new file mode 100644 index 0000000..0653957 --- /dev/null +++ b/server-side-rails-app/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/server-side-rails-app/config/nginx.conf b/server-side-rails-app/config/nginx.conf new file mode 100644 index 0000000..4bf5d20 --- /dev/null +++ b/server-side-rails-app/config/nginx.conf @@ -0,0 +1,31 @@ +upstream puma { + server unix:///home/rng2/apps/get-moving-rails/shared/tmp/sockets/get-moving-rails-puma.sock; +} + +server { + listen 80 default_server deferred; + # server_name example.com; + + root /home/rng2/apps/get-moving-rails/current/public; + access_log /home/rng2/apps/get-moving-rails/current/log/nginx.access.log; + error_log /home/rng2/apps/get-moving-rails/current/log/nginx.error.log info; + + location ^~ /assets/ { + gzip_static on; + expires max; + add_header Cache-Control public; + } + + try_files $uri/index.html $uri @puma; + location @puma { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_redirect off; + + proxy_pass http://puma; + } + + error_page 500 502 503 504 /500.html; + client_max_body_size 10M; + keepalive_timeout 10; +} \ No newline at end of file diff --git a/server-side-rails-app/config/routes.rb b/server-side-rails-app/config/routes.rb new file mode 100644 index 0000000..2a883aa --- /dev/null +++ b/server-side-rails-app/config/routes.rb @@ -0,0 +1,58 @@ +Rails.application.routes.draw do + resources :events, only: [:index, :create] + root 'events#index' + # The priority is based upon order of creation: first created -> highest priority. + # See how all your routes lay out with "rake routes". + + # You can have the root of your site routed with "root" + # root 'welcome#index' + + # Example of regular route: + # get 'products/:id' => 'catalog#view' + + # Example of named route that can be invoked with purchase_url(id: product.id) + # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase + + # Example resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Example resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Example resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Example resource route with more complex sub-resources: + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', on: :collection + # end + # end + + # Example resource route with concerns: + # concern :toggleable do + # post 'toggle' + # end + # resources :posts, concerns: :toggleable + # resources :photos, concerns: :toggleable + + # Example resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end +end diff --git a/server-side-rails-app/config/secrets.yml b/server-side-rails-app/config/secrets.yml new file mode 100644 index 0000000..5c1c0cb --- /dev/null +++ b/server-side-rails-app/config/secrets.yml @@ -0,0 +1,22 @@ +# 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 `rake 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: efe32b15c75e3919adb74347b7155920efba3c66d303cf4b8b3c785066bdd1350eb1f097bf56eb69fe12ced5ee33fefbc11b8f846ba6ca42f4182a6fa55e5f26 + +test: + secret_key_base: 062d43e8538facd30000848d347ed0106e0acafa42c83aa1823c34d01b6bbe6e34439a80b394e134ab4db77722881b36bf0e7551a0c72094f5461d20b1a58302 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/server-side-rails-app/db/migrate/20160221003045_create_events.rb b/server-side-rails-app/db/migrate/20160221003045_create_events.rb new file mode 100644 index 0000000..8cbe867 --- /dev/null +++ b/server-side-rails-app/db/migrate/20160221003045_create_events.rb @@ -0,0 +1,21 @@ +class CreateEvents < ActiveRecord::Migration + def change + create_table :events do |t| + t.string :name + t.string :address + t.string :user_email + t.datetime :start_time + t.datetime :departure_time + t.boolean :is_latest, default: true + t.boolean :has_notified, default: false + t.string :device_token, null:false + t.float :event_lng + t.float :event_lat + t.float :user_lng + t.float :user_lat + + t.timestamps null: false + end + end +end + diff --git a/server-side-rails-app/db/migrate/20160224234247_add_google_event_id.rb b/server-side-rails-app/db/migrate/20160224234247_add_google_event_id.rb new file mode 100644 index 0000000..cbf70bd --- /dev/null +++ b/server-side-rails-app/db/migrate/20160224234247_add_google_event_id.rb @@ -0,0 +1,5 @@ +class AddGoogleEventId < ActiveRecord::Migration + def change + add_column :events, :google_event_id, :string + end +end diff --git a/server-side-rails-app/db/schema.rb b/server-side-rails-app/db/schema.rb new file mode 100644 index 0000000..f6d0a9f --- /dev/null +++ b/server-side-rails-app/db/schema.rb @@ -0,0 +1,37 @@ +# encoding: UTF-8 +# 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: 20160224234247) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "events", force: :cascade do |t| + t.string "name" + t.string "address" + t.string "user_email" + t.datetime "start_time" + t.datetime "departure_time" + t.boolean "is_latest", default: true + t.boolean "has_notified", default: false + t.string "device_token", null: false + t.float "event_lng" + t.float "event_lat" + t.float "user_lng" + t.float "user_lat" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "google_event_id" + end + +end diff --git a/server-side-rails-app/db/seeds.rb b/server-side-rails-app/db/seeds.rb new file mode 100644 index 0000000..d27ef3e --- /dev/null +++ b/server-side-rails-app/db/seeds.rb @@ -0,0 +1,215 @@ +# 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 rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) +# Mayor.create(name: 'Emanuel', city: cities.first) + +Event.create!(name: "Go to my apartment1", + address: "647 Flatbush Ave, Brooklyn, NY 11225", + user_email: "getmovingfinalproject@gmail.com", + start_time: "2016-02-25T20:40:30+00:00", + departure_time: "2016-02-25T20:40:30+00:00", + is_latest: true, + has_notified: false, + device_token: "267b5fe45204bd566743af4804f1de427b081dcfe519659593", + event_lng: -73.95998, + event_lat: 40.65764, + user_lng: -74.0093456027814, + user_lat: 40.7063627314525, + created_at: "2016-02-25 00:31:05", + updated_at: "2016-02-25 00:31:05", + google_event_id: "1") + +Event.create!(name: "Go to my apartment2", + address: "647 Flatbush Ave, Brooklyn, NY 11225", + user_email: "getmovingfinalproject@gmail.com", + start_time: "2016-02-25T20:40:30+00:00", + departure_time: "2016-02-25T20:40:30+00:00", + is_latest: true, + has_notified: false, + device_token: "267b5fe45204bd566743af4804f1de427b081dcfe519659593", + event_lng: -73.95998, + event_lat: 40.65764, + user_lng: -74.0093456027814, + user_lat: 40.7063627314525, + created_at: "2016-02-25 00:31:05", + updated_at: "2016-02-25 00:31:05", + google_event_id: "1") + +Event.create!(name: "Go to my apartment3", + address: "647 Flatbush Ave, Brooklyn, NY 11225", + user_email: "getmovingfinalproject@gmail.com", + start_time: "2016-02-25T20:40:30+00:00", + departure_time: "2016-02-25T20:40:30+00:00", + is_latest: true, + has_notified: false, + device_token: "267b5fe45204bd566743af4804f1de427b081dcfe519659593", + event_lng: -73.95998, + event_lat: 40.65764, + user_lng: -74.0093456027814, + user_lat: 40.7063627314525, + created_at: "2016-02-25 00:31:05", + updated_at: "2016-02-25 00:31:05", + google_event_id: "1") + +Event.create!(name: "Go to my parents house1", + address: "10 Daffodil Lane, Cos Cob, CT. 06807", + user_email: "getmovingfinalproject@gmail.com", + start_time: "2016-02-25T20:50:30+00:00", + departure_time: "2016-02-25T20:50:30+00:00", + is_latest: true, + has_notified: false, + device_token: "267b5fe45204bd566743af4804f1de427b081dcfe519659593", + event_lng: -73.587387, + event_lat: 41.085815, + user_lng: -74.0093456027814, + user_lat: 40.7063627314525, + created_at: "2016-02-25 00:31:05", + updated_at: "2016-02-25 00:31:05", + google_event_id: "2") + +Event.create!(name: "Go to my parents house2", + address: "10 Daffodil Lane, Cos Cob, CT. 06807", + user_email: "getmovingfinalproject@gmail.com", + start_time: "2016-02-25T20:50:30+00:00", + departure_time: "2016-02-25T20:50:30+00:00", + is_latest: true, + has_notified: false, + device_token: "267b5fe45204bd566743af4804f1de427b081dcfe519659593", + event_lng: -73.587387, + event_lat: 41.085815, + user_lng: -74.0093456027814, + user_lat: 40.7063627314525, + created_at: "2016-02-25 00:31:05", + updated_at: "2016-02-25 00:31:05", + google_event_id: "2") + +Event.create!(name: "Go to my parents house3", + address: "10 Daffodil Lane, Cos Cob, CT. 06807", + user_email: "getmovingfinalproject@gmail.com", + start_time: "2016-02-25T20:50:30+00:00", + departure_time: "2016-02-25T20:50:30+00:00", + is_latest: true, + has_notified: false, + device_token: "267b5fe45204bd566743af4804f1de427b081dcfe519659593", + event_lng: -73.587387, + event_lat: 41.085815, + user_lng: -74.0093456027814, + user_lat: 40.7063627314525, + created_at: "2016-02-25 00:31:05", + updated_at: "2016-02-25 00:31:05", + google_event_id: "2") + + +# ____________________________________________________________________ +# Event.create!(name: 'Job Interview at Apple', +# address: '1 Infinite Loop, Cupertino, California 95014', +# user_email: 'getmovingfinalproject@gmail.com', +# start_time: DateTime.parse('2016-02-23T22:32:57+00:00'), +# departure_time: DateTime.parse('2016-02-23T22:22:57+00:00'), +# device_token: "1234556575478768632456458674", +# user_lat: '40.7332578', +# user_lng: '-74.0252455', +# event_lat: '40.758740', +# event_lng: '-73.978674' +# ) + +# Event.create!(name: 'Job Interview at Google', +# address: '1600 Amphitheatre Parkway in Mountain View, Santa Clara County, California', +# user_email: 'getmovingfinalproject@gmail.com', +# start_time: DateTime.parse('2016-02-23T22:32:57+00:00'), +# departure_time: DateTime.parse('2016-02-23T22:22:57+00:00'), +# device_token: "123455657547876213576458674", +# user_lat: '40.7332578', +# user_lng: '-74.0252455', +# event_lat: '40.758740', +# event_lng: '-73.978674' +# ) + +# Event.create!(name: 'Job Interview at Facebook', +# address: '1 Hacker Way, Palo Alto, California 12345', +# user_email: 'getmovingfinalproject@gmail.com', +# start_time: DateTime.parse('2016-02-23T22:32:57+00:00'), +# departure_time: DateTime.parse('2016-02-23T22:22:57+00:00'), +# device_token: "123455657547876868576478974", +# user_lat: '40.7332578', +# user_lng: '-74.0252455', +# event_lat: '40.758740', +# event_lng: '-73.978674' +# ) + +# Event.create!(name: 'Job Interview at Duane Reade', +# address: '60 Wall street', +# user_email: 'getmovingfinalproject@gmail.com', +# start_time: DateTime.parse('2016-02-23T22:32:57+00:00'), +# departure_time: DateTime.parse('2016-02-23T22:22:57+00:00'), +# device_token: "123455654257876868576458674", +# user_lat: '40.7332578', +# user_lng: '-74.0252455', +# event_lat: '40.758740', +# event_lng: '-73.978674' +# ) + +# Event.create!(name: 'Job Interview at CVS', +# address: '60 Wall street', +# user_email: 'getmovingfinalproject@gmail.com', +# start_time: DateTime.parse('2016-02-23T22:32:57+00:00'), +# departure_time: DateTime.parse('2016-02-23T22:22:57+00:00'), +# device_token: "123455657547878968576458674", +# user_lat: '40.7332578', +# user_lng: '-74.0252455', +# event_lat: '40.758740', +# event_lng: '-73.978674' +# ) + +# Event.create!(name: 'Job Interview at Toys R Us', +# address: '60 Wall street', +# user_email: 'getmovingfinalproject@gmail.com', +# start_time: DateTime.parse('2016-02-23T22:32:57+00:00'), +# departure_time: DateTime.parse('2016-02-23T22:22:57+00:00'), +# device_token: "123455564547876868576458674", +# user_lat: '40.7332578', +# user_lng: '-74.0252455', +# event_lat: '40.758740', +# event_lng: '-73.978674' +# ) + +# Event.create!(name: 'Job Interview at Whole Foods', +# address: '60 Wall street', +# user_email: 'getmovingapp1@gmail.com', +# start_time: DateTime.parse('2016-02-23T22:32:57+00:00'), +# departure_time: DateTime.parse('2016-02-23T22:22:57+00:00'), +# device_token: "123452357547876868576458674", +# has_notified: true, +# user_lat: '40.7332578', +# user_lng: '-74.0252455', +# event_lat: '40.758740', +# event_lng: '-73.978674' +# ) + +# Event.create!(name: 'Job Interview at PlanetFitness', +# address: '60 Wall street', +# user_email: 'getmovingapp1@gmail.com', +# start_time: DateTime.parse('2016-02-23T22:32:57+00:00'), +# departure_time: DateTime.parse('2016-02-23T22:22:57+00:00'), +# device_token: "123455657543476834576458674", +# user_lat: '40.7332578', +# user_lng: '-74.0252455', +# event_lat: '40.758740', +# event_lng: '-73.978674' +# ) + +# Event.create!(name: 'Job Interview at Twitter', +# address: '60 Wall street', +# user_email: 'getmovingapp1@gmail.com', +# start_time: DateTime.parse('2016-02-23T22:32:57+00:00'), +# departure_time: DateTime.parse('2016-02-23T22:22:57+00:00'), +# device_token: "123455657547876834576458674", +# user_lat: '40.7332578', +# user_lng: '-74.0252455', +# event_lat: '40.758740', +# event_lng: '-73.978674' +# ) + diff --git a/server-side-rails-app/lib/assets/.keep b/server-side-rails-app/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/server-side-rails-app/lib/tasks/.keep b/server-side-rails-app/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/server-side-rails-app/lib/tasks/initiate_alert.rake b/server-side-rails-app/lib/tasks/initiate_alert.rake new file mode 100644 index 0000000..0ffdb92 --- /dev/null +++ b/server-side-rails-app/lib/tasks/initiate_alert.rake @@ -0,0 +1,38 @@ +APNS.pem = File.join(Rails.root, 'config', 'cert.pem') + +task :find_upcoming => :environment do + key = ENV["GOOGLE_MAPS_KEY"] + events = Event.where("has_notified = ? AND is_latest = ? AND start_time > ?", false, true, Time.now) + events.each do |event| + url = "https://maps.googleapis.com/maps/api/distancematrix/json?origins=" + event.user_lat.to_s + "," + event.user_lng.to_s + "&destinations=" + event.event_lat.to_s + "," + event.event_lng.to_s + "&key=#{key}" + + response = HTTParty.get(url) + puts response.body + + seconds_to_destination = response["rows"][0]["elements"][0]["duration"]["value"] + new_departure_time = event.start_time - seconds_to_destination + event.update_columns(departure_time: new_departure_time) + + end + + if Event.where("departure_time < ? AND has_notified = ? AND is_latest = ? AND start_time > ?", Time.now + 600, false, true, Time.now).empty? + puts "You have no events in the next 10 minutes, go relax for a bit" + else + events_to_alert = Event.where("departure_time < ? AND has_notified = ? AND is_latest = ? AND start_time > ?", Time.now + 600, false, true, Time.now) + events_to_alert.each do |event| + if (event.departure_time - Time.now) < 0 + puts "You should have left for #{event.name} " + (((event.departure_time - Time.now)/60)*(-1)).round.to_s + " minutes ago, Get Moving!" + puts "Send a push notification for '#{event.name}' to Apple." + else + puts "You need to leave for #{event.name} in" + (((event.departure_time - Time.now)/60)).round.to_s + " minutes, Get Moving!" + puts "Send a push notification for '#{event.name}' to Apple." + end + if (event.departure_time - Time.now) < 0 + APNS.send_notification(event.device_token, alert:"You should have left for #{event.name} " + (((event.departure_time - Time.now)/60)*(-1)).round.to_s + " minutes ago, Get Moving!", badge: 1, sound: 'default') + else + APNS.send_notification(event.device_token, alert:"You need to leave for #{event.name} in " + (((event.departure_time - Time.now)/60)).round.to_s + " minutes, Get Moving!", badge: 1, sound: 'default') + event.update_attributes(has_notified: true) + end + end + end +end diff --git a/server-side-rails-app/log.log b/server-side-rails-app/log.log new file mode 100644 index 0000000..27a5038 --- /dev/null +++ b/server-side-rails-app/log.log @@ -0,0 +1,159 @@ +* cac3109 : Edit seed data and test rake task manually, all functions working +* 220df49 : Merge pull request #28 from nyc-chorus-frogs-2016/da-final-wed +|\ +| * b015843 : Add notes +|/ +* 49633cd : Add comment about problems with pn's +* d1c7ba5 : Fix typo in user_email +* 237fbc2 : Prevent notification of stale events +* 903cb60 : Merge pull request #27 from nyc-chorus-frogs-2016/da-add-transport-to-event-model +|\ +| * 6018888 : Add google event id to events +|/ +* fd19af8 : Merge pull request #26 from nyc-chorus-frogs-2016/da-fix-rake-task-update-column +|\ +| * d12de1e : Fix rake test to query only latest events, pn's working +|/ +* fb6086d : Merge pull request #25 from nyc-chorus-frogs-2016/da-rails-testing +|\ +| * 463faec : Add google maps key and filter for event directions +|/ +* d816056 : Remove username from production db +* 7c48087 : Don't send password on production db +* f092047 : Update server name +* 0255052 : Update deploy.rb port +* d225bcb : Merge pull request #24 from nyc-chorus-frogs-2016/capistrano +|\ +| * aeed6ea : Add nginx configuration +| * d37a30f : Add capistrano deploy files +| * 072a5db : Add capistrano gems +|/ +* 55b6ef8 : Merge pull request #23 from nyc-chorus-frogs-2016/da-ms-test-ruby-coords +|\ +| * 88426ec : Replace index +| * 3e79277 : remove index +| * dfe1523 : Change if statemtent +* | 4f2bc25 : Merge pull request #22 from nyc-chorus-frogs-2016/da-ms-test-ruby-coords +|\ \ +| |/ +| * c7e3fc4 : Add if statement for previous events without coords to output in index.html.erb +|/ +* 3893830 : Merge pull request #21 from nyc-chorus-frogs-2016/do-deploy +|\ +| * e819936 : Edit typo in scheduled_jobs +* | 2b5361c : Merge pull request #20 from nyc-chorus-frogs-2016/do-deploy +|\ \ +| |/ +| * 2c46025 : Update seeds with lat and lng coords to test departure time calc in rails +| * eb7492d : Add scheduled jobs task +| * 72b544f : Add rake task to calculate directions in Ruby +* | beb8153 : Merge pull request #19 from nyc-chorus-frogs-2016/da-heroku-testing-22 +|\ \ +| |/ +| * 8fc81ce : Add working MVP version with single alert for a future event that hasnt started, with departure time any time prior to 10 minutes from now. Next step is to move some of the calulations over to ruby so they run more reliably via the server rather than only when the app is open. +| * 3d6ceb3 : Fix where query for events you should have already left for, remove past events from alerts +| * 4dfa162 : Add is_latest filters to rake task +* | 9765f7d : Merge pull request #18 from nyc-chorus-frogs-2016/da-heroku-testing-22 +|\ \ +| |/ +| * aa1c013 : Change rake task to alert for events with departure time in the past +| * 5314e3a : Add new islatest +* | cef20b6 : Merge pull request #17 from nyc-chorus-frogs-2016/da-heroku-testing-22 +|\ \ +| |/ +| * 4e6e2cb : Edit styling to heroku server, push notifications TESTED and Working +* | 299fc90 : Merge pull request #16 from nyc-chorus-frogs-2016/da-heroku-testing-22 +|\ \ +| |/ +| * e26f9e1 : Edit output of rake task to heroku +| * 989443a : Change seed file +| * 3add8f9 : update event.devicetoken in rake task +|/ +* f556ca8 : Merge pull request #15 from nyc-chorus-frogs-2016/da-23-heroku-scheduler-2 +|\ +| * fe4fa78 : Update departure time for heroku test +* | ccc4f1f : Merge pull request #14 from nyc-chorus-frogs-2016/da-23-heroku-scheduler-2 +|\ \ +| |/ +| * fb37316 : Fix merge conflict seed data +| |\ +| |/ +|/| +* | fd8979f : Merge pull request #12 from nyc-chorus-frogs-2016/da-23-heroku-scheduler +|\ \ +| * | 3aa53e9 : fix comma in event create route +* | | 8be613c : Merge pull request #11 from nyc-chorus-frogs-2016/da-23-heroku-scheduler +|\ \ \ +| |/ / +| * | 346c280 : Add departure time to event create route +| * | e336122 : Add device token to output heroku +* | | 3395b52 : Merge pull request #10 from nyc-chorus-frogs-2016/da-23-heroku-scheduler +|\ \ \ +| |/ / +| * | db8da25 : Re-add the device token field after heroku reset +| * | 1b6dd21 : remove device token +| * | 35309c1 : Reset db to test heroku +|/ / +| * 9f54529 : Change departure time to test heroku scheduler +|/ +* e139c15 : Merge pull request #9 from nyc-chorus-frogs-2016/da-add-token-validation +|\ +| * 558b76e : Add valdiation for device token to event model +|/ +* 3ee34c9 : Catch up master to current +|\ +| * 210c3f0 : Merge pull request #7 from nyc-chorus-frogs-2016/da-push-notifications-rails +| |\ +| | * 60a9b8e : Add device token to table, model and add send_notifications to rake task +| |/ +* | 35add98 : Merge branch 'jpoz-apns' +|\ \ +| |/ +|/| +| * 51f4b1e : Merge branch 'master' into jpoz-apns +| |\ +| |/ +|/| +* | 42e5085 : Merge pull request #6 from nyc-chorus-frogs-2016/da-add-hr +|\ \ +| * \ 392df0e : Merge branch 'master' of https://github.com/nyc-chorus-frogs-2016/get-moving-rails +| |\ \ +| |/ / +|/| | +* | | 14e98f0 : Merge pull request #5 from nyc-chorus-frogs-2016/r12factor +|\ \ \ +| * | | 0af031b : Edit params in events controller +| | * | 4a7efc4 : Add hr to test update to heroku +| |/ / +|/| | +| | * cb1df94 : Steven's version +| |/ +|/| +* | e427fa0 : Merge pull request #4 from nyc-chorus-frogs-2016/r12factor +|\ \ +| |/ +| * 8b7e6a3 : Fix ordering events desc +| * eed8ae8 : Order events by post descending +| * 2eafbc7 : Add styling to index page on heroku +| * e344361 : Add index root to routes file +| * e91343e : Add index route and vie for events on heroku server +| * 1bf8c8e : Delete comments in event model +| * f6fb909 : Add 12factor gem +* | 4d69705 : Merge pull request #3 from nyc-chorus-frogs-2016/da-initial-commit-heroku +|\ \ +| * | b63b68d : Specify ruby version +* | | f9692ee : Merge pull request #2 from nyc-chorus-frogs-2016/da-initial-commit-heroku +|\ \ \ +| |/ / +| | / +| |/ +|/| +| * 793424a : Add tested rake file to heroku server +* | 3c9374c : Merge pull request #1 from nyc-chorus-frogs-2016/da-initial-commit-heroku +|\ \ +| |/ +| * 9642a0c : Add files to new heroku repo +| * 9042567 : Add working rake task to get next event, needs if statement for empty collection +|/ +* e18b8c4 : Add rspec, faker gems, install rspec +* 4256109 : Initial commit. get_moving rails server skeleton \ No newline at end of file diff --git a/server-side-rails-app/log/.keep b/server-side-rails-app/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/server-side-rails-app/public/404.html b/server-side-rails-app/public/404.html new file mode 100644 index 0000000..b612547 --- /dev/null +++ b/server-side-rails-app/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/server-side-rails-app/public/422.html b/server-side-rails-app/public/422.html new file mode 100644 index 0000000..a21f82b --- /dev/null +++ b/server-side-rails-app/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/server-side-rails-app/public/500.html b/server-side-rails-app/public/500.html new file mode 100644 index 0000000..061abc5 --- /dev/null +++ b/server-side-rails-app/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.

+
+ + diff --git a/server-side-rails-app/public/favicon.ico b/server-side-rails-app/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/server-side-rails-app/public/robots.txt b/server-side-rails-app/public/robots.txt new file mode 100644 index 0000000..3c9c7c0 --- /dev/null +++ b/server-side-rails-app/public/robots.txt @@ -0,0 +1,5 @@ +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +# User-agent: * +# Disallow: / diff --git a/server-side-rails-app/spec/rails_helper.rb b/server-side-rails-app/spec/rails_helper.rb new file mode 100644 index 0000000..6f1ab14 --- /dev/null +++ b/server-side-rails-app/spec/rails_helper.rb @@ -0,0 +1,57 @@ +# This file is copied to spec/ when you run 'rails generate rspec:install' +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../../config/environment', __FILE__) +# Prevent database truncation if the environment is production +abort("The Rails environment is running in production mode!") if Rails.env.production? +require 'spec_helper' +require 'rspec/rails' +# Add additional requires below this line. Rails is not loaded until this point! + +# Requires supporting ruby files with custom matchers and macros, etc, in +# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are +# run as spec files by default. This means that files in spec/support that end +# in _spec.rb will both be required and run as specs, causing the specs to be +# run twice. It is recommended that you do not name files matching this glob to +# end with _spec.rb. You can configure this pattern with the --pattern +# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. +# +# The following line is provided for convenience purposes. It has the downside +# of increasing the boot-up time by auto-requiring all files in the support +# directory. Alternatively, in the individual `*_spec.rb` files, manually +# require only the support files necessary. +# +# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } + +# Checks for pending migration and applies them before tests are run. +# If you are not using ActiveRecord, you can remove this line. +ActiveRecord::Migration.maintain_test_schema! + +RSpec.configure do |config| + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures + config.fixture_path = "#{::Rails.root}/spec/fixtures" + + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, remove the following line or assign false + # instead of true. + config.use_transactional_fixtures = true + + # RSpec Rails can automatically mix in different behaviours to your tests + # based on their file location, for example enabling you to call `get` and + # `post` in specs under `spec/controllers`. + # + # You can disable this behaviour by removing the line below, and instead + # explicitly tag your specs with their type, e.g.: + # + # RSpec.describe UsersController, :type => :controller do + # # ... + # end + # + # The different available types are documented in the features, such as in + # https://relishapp.com/rspec/rspec-rails/docs + config.infer_spec_type_from_file_location! + + # Filter lines from Rails gems in backtraces. + config.filter_rails_from_backtrace! + # arbitrary gems may also be filtered via: + # config.filter_gems_from_backtrace("gem name") +end diff --git a/server-side-rails-app/spec/spec_helper.rb b/server-side-rails-app/spec/spec_helper.rb new file mode 100644 index 0000000..61e2738 --- /dev/null +++ b/server-side-rails-app/spec/spec_helper.rb @@ -0,0 +1,92 @@ +# This file was generated by the `rails generate rspec:install` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # These two settings work together to allow you to limit a spec run + # to individual examples or groups you care about by tagging them with + # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # get run. + config.filter_run :focus + config.run_all_when_everything_filtered = true + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end diff --git a/server-side-rails-app/vendor/assets/javascripts/.keep b/server-side-rails-app/vendor/assets/javascripts/.keep new file mode 100644 index 0000000..e69de29 diff --git a/server-side-rails-app/vendor/assets/stylesheets/.keep b/server-side-rails-app/vendor/assets/stylesheets/.keep new file mode 100644 index 0000000..e69de29