cortex 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.babelrc +18 -0
- data/.codeclimate.yml +43 -0
- data/.csslintrc +2 -0
- data/.editorconfig +9 -0
- data/.eslintignore +1 -0
- data/.eslintrc.yml +277 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +47 -0
- data/.gitignore +82 -0
- data/.npmignore +34 -0
- data/.postcssrc.yml +3 -0
- data/.rspec +3 -0
- data/.rubocop.yml +1156 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/CONTRIBUTING.md +58 -0
- data/Gemfile +101 -0
- data/Gemfile.lock +604 -0
- data/Guardfile +23 -0
- data/LICENSE.md +201 -0
- data/README.md +239 -0
- data/Rakefile +22 -0
- data/app/assets/config/cortex_manifest.js +4 -0
- data/app/assets/fonts/cortex/Montserrat-Light.otf +0 -0
- data/app/assets/fonts/cortex/Montserrat-Medium.otf +0 -0
- data/app/assets/fonts/cortex/Montserrat-Regular.otf +0 -0
- data/app/assets/fonts/cortex/Montserrat-SemiBold.otf +0 -0
- data/app/assets/images/cortex/favicon.ico +0 -0
- data/app/assets/images/cortex/icons/add.svg +59 -0
- data/app/assets/images/cortex/icons/blog.png +0 -0
- data/app/assets/images/cortex/icons/media.png +0 -0
- data/app/assets/images/cortex/logo.svg +43 -0
- data/app/assets/javascripts/cortex/application.js +17 -0
- data/app/assets/javascripts/cortex/authentication.js +6 -0
- data/app/assets/javascripts/cortex/base.js +6 -0
- data/app/assets/javascripts/cortex/datepicker_init.js +29 -0
- data/app/assets/javascripts/cortex/flash.js +7 -0
- data/app/assets/javascripts/cortex/form.js +6 -0
- data/app/assets/javascripts/cortex/media_dialogs.js +40 -0
- data/app/assets/javascripts/cortex/quick_links.js +13 -0
- data/app/assets/stylesheets/cortex/application.scss +34 -0
- data/app/assets/stylesheets/cortex/authentication.scss +34 -0
- data/app/assets/stylesheets/cortex/base.scss +4 -0
- data/app/assets/stylesheets/cortex/bootstrap-namespaced.scss +57 -0
- data/app/assets/stylesheets/cortex/components/card.scss +9 -0
- data/app/assets/stylesheets/cortex/components/dialog.scss +67 -0
- data/app/assets/stylesheets/cortex/components/flash.scss +60 -0
- data/app/assets/stylesheets/cortex/components/form.scss +45 -0
- data/app/assets/stylesheets/cortex/components/header.scss +53 -0
- data/app/assets/stylesheets/cortex/components/index.scss +28 -0
- data/app/assets/stylesheets/cortex/components/jumbo-button.scss +41 -0
- data/app/assets/stylesheets/cortex/components/loaders.scss +76 -0
- data/app/assets/stylesheets/cortex/components/notes.scss +26 -0
- data/app/assets/stylesheets/cortex/components/sidebar.scss +120 -0
- data/app/assets/stylesheets/cortex/components/table.scss +7 -0
- data/app/assets/stylesheets/cortex/components/tenant-switcher.scss +209 -0
- data/app/assets/stylesheets/cortex/components/ui.scss +119 -0
- data/app/assets/stylesheets/cortex/demo.scss +140 -0
- data/app/assets/stylesheets/cortex/directives/aspect-ratio.scss +9 -0
- data/app/assets/stylesheets/cortex/helpers.scss +1701 -0
- data/app/assets/stylesheets/cortex/layout.scss +21 -0
- data/app/assets/stylesheets/cortex/material-icons.scss +13 -0
- data/app/assets/stylesheets/cortex/variables/_colors.scss +46 -0
- data/app/assets/stylesheets/cortex/variables/_material-overrides.scss +1 -0
- data/app/assets/stylesheets/cortex/variables/_typography.scss +114 -0
- data/app/cells/cortex/application_cell.rb +8 -0
- data/app/cells/cortex/content_type/nav.haml +5 -0
- data/app/cells/cortex/content_type_cell.rb +10 -0
- data/app/cells/cortex/field_cell.rb +35 -0
- data/app/cells/cortex/index/content_item/column.haml +4 -0
- data/app/cells/cortex/index/content_item_cell.rb +37 -0
- data/app/cells/cortex/index/index.haml +5 -0
- data/app/cells/cortex/index/table_body.haml +11 -0
- data/app/cells/cortex/index/table_headers.haml +5 -0
- data/app/cells/cortex/index_cell.rb +53 -0
- data/app/cells/cortex/wizard/column/show.haml +10 -0
- data/app/cells/cortex/wizard/column_cell.rb +21 -0
- data/app/cells/cortex/wizard/field/show.haml +30 -0
- data/app/cells/cortex/wizard/field_cell.rb +29 -0
- data/app/cells/cortex/wizard/plugin/show.haml +1 -0
- data/app/cells/cortex/wizard/plugin_cell.rb +28 -0
- data/app/cells/cortex/wizard/show.haml +1 -0
- data/app/cells/cortex/wizard/step/show.haml +2 -0
- data/app/cells/cortex/wizard/step_cell.rb +17 -0
- data/app/cells/cortex/wizard_cell.rb +15 -0
- data/app/containers/cortex/transaction_container.rb +23 -0
- data/app/controllers/concerns/cortex/decoratable.rb +16 -0
- data/app/controllers/cortex/admin_controller.rb +7 -0
- data/app/controllers/cortex/application_controller.rb +19 -0
- data/app/controllers/cortex/authentication/passwords_controller.rb +3 -0
- data/app/controllers/cortex/authentication/sessions_controller.rb +3 -0
- data/app/controllers/cortex/content_items_controller.rb +75 -0
- data/app/controllers/cortex/content_types_controller.rb +19 -0
- data/app/controllers/cortex/dashboards_controller.rb +7 -0
- data/app/controllers/cortex/graphql_controller.rb +40 -0
- data/app/controllers/cortex/tenants_controller.rb +12 -0
- data/app/devise/cortex/authentication_failure.rb +12 -0
- data/app/graphql/cortex/cortex_schema.rb +8 -0
- data/app/graphql/cortex/interfaces/.keep +0 -0
- data/app/graphql/cortex/mutations/.keep +0 -0
- data/app/graphql/cortex/types/content_item_type.rb +31 -0
- data/app/graphql/cortex/types/content_type_type.rb +23 -0
- data/app/graphql/cortex/types/contract_type.rb +10 -0
- data/app/graphql/cortex/types/date_time_type.rb +8 -0
- data/app/graphql/cortex/types/field_item_type.rb +15 -0
- data/app/graphql/cortex/types/field_type.rb +18 -0
- data/app/graphql/cortex/types/mutation_type.rb +5 -0
- data/app/graphql/cortex/types/query_type.rb +45 -0
- data/app/graphql/cortex/types/tenant_type.rb +19 -0
- data/app/graphql/cortex/types/user_type.rb +20 -0
- data/app/helpers/cortex/application_helper.rb +75 -0
- data/app/helpers/cortex/cells/association_helper.rb +25 -0
- data/app/helpers/cortex/content_item_helper.rb +106 -0
- data/app/helpers/cortex/dashboard_helper.rb +19 -0
- data/app/helpers/cortex/popup_helper.rb +27 -0
- data/app/jobs/cortex/application_job.rb +4 -0
- data/app/mailers/cortex/application_mailer.rb +6 -0
- data/app/mailers/cortex/password_reset_mailer.rb +13 -0
- data/app/models/concerns/cortex/belongs_to_tenant.rb +13 -0
- data/app/models/concerns/cortex/has_firstname_lastname.rb +11 -0
- data/app/models/concerns/cortex/has_gravatar.rb +18 -0
- data/app/models/concerns/cortex/searchable.rb +11 -0
- data/app/models/concerns/cortex/searchable_content_item.rb +31 -0
- data/app/models/concerns/cortex/searchable_content_item_for_content_type.rb +52 -0
- data/app/models/concerns/cortex/searchable_content_type.rb +11 -0
- data/app/models/cortex/application_record.rb +17 -0
- data/app/models/cortex/content_item.rb +71 -0
- data/app/models/cortex/content_type.rb +27 -0
- data/app/models/cortex/contentable_decorator.rb +8 -0
- data/app/models/cortex/contract.rb +12 -0
- data/app/models/cortex/decorator.rb +13 -0
- data/app/models/cortex/field.rb +36 -0
- data/app/models/cortex/field_item.rb +54 -0
- data/app/models/cortex/field_type.rb +44 -0
- data/app/models/cortex/permission.rb +11 -0
- data/app/models/cortex/role.rb +12 -0
- data/app/models/cortex/tenant.rb +41 -0
- data/app/models/cortex/user.rb +77 -0
- data/app/operations/cortex/database_transact_operation.rb +17 -0
- data/app/operations/cortex/execute_content_item_state_change_operation.rb +16 -0
- data/app/operations/cortex/parse_content_item_field_items_operation.rb +18 -0
- data/app/operations/cortex/persist_content_item_operation.rb +12 -0
- data/app/policies/cortex/application_policy.rb +55 -0
- data/app/policies/cortex/content_item_policy.rb +49 -0
- data/app/policies/cortex/content_type_policy.rb +38 -0
- data/app/transactions/concerns/cortex/content_itemable.rb +15 -0
- data/app/transactions/concerns/cortex/field_item_transactor.rb +28 -0
- data/app/transactions/concerns/cortex/widget_parsable.rb +19 -0
- data/app/transactions/cortex/application_transaction.rb +5 -0
- data/app/transactions/cortex/create_content_item_transaction.rb +35 -0
- data/app/transactions/cortex/get_content_item_transaction.rb +4 -0
- data/app/transactions/cortex/get_content_items_for_content_type_transaction.rb +34 -0
- data/app/transactions/cortex/get_publish_state_transaction.rb +28 -0
- data/app/transactions/cortex/new_field_item_transaction.rb +16 -0
- data/app/transactions/cortex/update_content_item_transaction.rb +45 -0
- data/app/transactions/cortex/update_field_item_transaction.rb +23 -0
- data/app/types/cortex/application_types.rb +21 -0
- data/app/types/cortex/content_item_transaction_type.rb +10 -0
- data/app/types/cortex/core_types.rb +5 -0
- data/app/types/cortex/transaction_type.rb +5 -0
- data/app/views/cortex/authentication/passwords/new.html.haml +13 -0
- data/app/views/cortex/authentication/sessions/new.html.haml +20 -0
- data/app/views/cortex/authentication/shared/_links.html.haml +19 -0
- data/app/views/cortex/content_items/_form.html.haml +13 -0
- data/app/views/cortex/content_items/_grid.html.haml +1 -0
- data/app/views/cortex/content_items/edit.html.haml +2 -0
- data/app/views/cortex/content_items/index.html.haml +4 -0
- data/app/views/cortex/content_items/new.html.haml +2 -0
- data/app/views/cortex/content_types/index.html.haml +2 -0
- data/app/views/cortex/content_types/new.html.haml +0 -0
- data/app/views/cortex/dashboards/index.html.haml +6 -0
- data/app/views/cortex/graphql/ide.haml +1 -0
- data/app/views/cortex/partials/_breadcrumb.html.haml +2 -0
- data/app/views/cortex/partials/_cortex_redux_state.html.haml +1 -0
- data/app/views/cortex/partials/_flash.html.haml +25 -0
- data/app/views/cortex/partials/_media_dialogs.html.haml +13 -0
- data/app/views/cortex/partials/_navigation.html.haml +15 -0
- data/app/views/cortex/partials/_notes.html.haml +17 -0
- data/app/views/cortex/partials/_quick_links.html.haml +22 -0
- data/app/views/cortex/partials/_sidebar.html.haml +7 -0
- data/app/views/cortex/partials/_topbar.html.haml +5 -0
- data/app/views/cortex/partials/_user_control.html.haml +7 -0
- data/app/views/cortex/partials/authentication/_header.html.haml +4 -0
- data/app/views/cortex/partials/trackers/_google_analytics.html.haml +10 -0
- data/app/views/cortex/partials/trackers/_qualtrics.html.haml +10 -0
- data/app/views/cortex/password_reset_mailer/send_password_reset.html.erb +5 -0
- data/app/views/cortex/password_reset_mailer/send_password_reset.text.erb +5 -0
- data/app/views/layouts/cortex/application.html.haml +30 -0
- data/app/views/layouts/cortex/devise.html.haml +19 -0
- data/app/views/layouts/cortex/mailer.html.erb +13 -0
- data/app/views/layouts/cortex/mailer.text.erb +1 -0
- data/bin/rails +25 -0
- data/config/config.yml +22 -0
- data/config/initializers/devise.rb +35 -0
- data/config/initializers/elasticsearch.rb +3 -0
- data/config/initializers/filter_parameter_logging.rb +4 -0
- data/config/initializers/flipper.rb +16 -0
- data/config/initializers/graphiql.rb +51 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/load_config.rb +16 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/plugins.rb +17 -0
- data/config/initializers/react_on_rails.rb +15 -0
- data/config/initializers/rolify.rb +9 -0
- data/config/initializers/tag_parsers.rb +5 -0
- data/config/locales/devise.en.yml +64 -0
- data/config/routes.rb +41 -0
- data/cortex.gemspec +84 -0
- data/db/migrate/0_enable_pgcrypto_extension.rb +5 -0
- data/db/migrate/10_create_fields.rb +15 -0
- data/db/migrate/11_create_content_items.rb +14 -0
- data/db/migrate/12_create_field_items.rb +12 -0
- data/db/migrate/13_create_field_types.rb +5 -0
- data/db/migrate/1_create_users.rb +14 -0
- data/db/migrate/2_create_tenants.rb +26 -0
- data/db/migrate/3_add_devise_to_users.rb +49 -0
- data/db/migrate/4_create_roles.rb +15 -0
- data/db/migrate/5_create_permissions.rb +16 -0
- data/db/migrate/6_create_flipper_tables.rb +20 -0
- data/db/migrate/7_create_contracts.rb +11 -0
- data/db/migrate/8_create_decorators.rb +21 -0
- data/db/migrate/9_create_content_types.rb +17 -0
- data/db/seeds.rb +40 -0
- data/db/seeds.yml +33 -0
- data/lib/assets/.keep +0 -0
- data/lib/breadcrumbs/title_builder.rb +12 -0
- data/lib/cortex.rb +4 -0
- data/lib/cortex/engine.rb +41 -0
- data/lib/cortex/version.rb +3 -0
- data/lib/helpers/utility_helper.rb +7 -0
- data/lib/tasks/cortex_tasks.rake +13 -0
- data/lib/tasks/elasticsearch_tasks.rake +1 -0
- data/node_package/.babelrc +26 -0
- data/node_package/src/components/side_bar/environment_flag.jsx +21 -0
- data/node_package/src/components/side_bar/tenant_list.jsx +65 -0
- data/node_package/src/components/wizard/column.jsx +29 -0
- data/node_package/src/components/wizard/field.jsx +22 -0
- data/node_package/src/components/wizard/step.jsx +20 -0
- data/node_package/src/constants/tenant_switcher.jsx +17 -0
- data/node_package/src/constants/type_constants.jsx +12 -0
- data/node_package/src/constants/wizard.jsx +9 -0
- data/node_package/src/containers/layout.jsx +33 -0
- data/node_package/src/containers/tenant_switcher_container.jsx +115 -0
- data/node_package/src/containers/wizard_container.jsx +28 -0
- data/node_package/src/elements/loaders.jsx +7 -0
- data/node_package/src/helpers/formatting.jsx +5 -0
- data/node_package/src/helpers/tenant_ancestry.jsx +14 -0
- data/node_package/src/helpers/tenant_lookup.jsx +23 -0
- data/node_package/src/index.jsx +21 -0
- data/node_package/src/reducers/index.jsx +13 -0
- data/node_package/src/reducers/rails_context_reducer.jsx +5 -0
- data/node_package/src/reducers/tenant_switcher_reducer.jsx +74 -0
- data/node_package/src/reducers/wizard_reducer.jsx +32 -0
- data/node_package/src/services/rails_api_service.jsx +13 -0
- data/node_package/src/store/store.jsx +15 -0
- data/package.json +66 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/config/manifest.js +4 -0
- data/spec/dummy/app/assets/javascripts/application.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.scss +2 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/javascript/packs/application.js +8 -0
- data/spec/dummy/app/javascript/packs/cortex.jsx +1 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/views/layouts/application.html.haml +11 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +105 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/rspec +17 -0
- data/spec/dummy/bin/setup +38 -0
- data/spec/dummy/bin/update +29 -0
- data/spec/dummy/bin/webpack +29 -0
- data/spec/dummy/bin/webpack-dev-server +29 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +7 -0
- data/spec/dummy/config/apollo_engine_proxy.yml +23 -0
- data/spec/dummy/config/application.rb +21 -0
- data/spec/dummy/config/boot.rb +11 -0
- data/spec/dummy/config/cable.yml +9 -0
- data/spec/dummy/config/config.yml +22 -0
- data/spec/dummy/config/database.yml +22 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +74 -0
- data/spec/dummy/config/environments/production.rb +103 -0
- data/spec/dummy/config/environments/staging.rb +103 -0
- data/spec/dummy/config/environments/test.rb +65 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/load_config.rb +9 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/react_on_rails.rb +41 -0
- data/spec/dummy/config/initializers/secret_token.rb +12 -0
- data/spec/dummy/config/initializers/sentry.rb +6 -0
- data/spec/dummy/config/initializers/session_store.rb +7 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +8 -0
- data/spec/dummy/config/newrelic.yml +224 -0
- data/spec/dummy/config/puma.rb +47 -0
- data/spec/dummy/config/routes.rb +5 -0
- data/spec/dummy/config/secrets.yml +32 -0
- data/spec/dummy/config/sidekiq.yml +9 -0
- data/spec/dummy/config/webpack/development.js +3 -0
- data/spec/dummy/config/webpack/environment.js +3 -0
- data/spec/dummy/config/webpack/production.js +3 -0
- data/spec/dummy/config/webpack/test.js +3 -0
- data/spec/dummy/config/webpacker.yml +66 -0
- data/spec/dummy/db/migrate/20180118233001_enable_pgcrypto_extension.cortex.rb +6 -0
- data/spec/dummy/db/migrate/20180118233002_create_users.cortex.rb +15 -0
- data/spec/dummy/db/migrate/20180118233003_create_tenants.cortex.rb +27 -0
- data/spec/dummy/db/migrate/20180118233004_add_devise_to_users.cortex.rb +50 -0
- data/spec/dummy/db/migrate/20180118233005_create_roles.cortex.rb +16 -0
- data/spec/dummy/db/migrate/20180118233006_create_permissions.cortex.rb +17 -0
- data/spec/dummy/db/migrate/20180118233007_create_flipper_tables.cortex.rb +21 -0
- data/spec/dummy/db/migrate/20180118233008_create_contracts.cortex.rb +12 -0
- data/spec/dummy/db/migrate/20180118233009_create_decorators.cortex.rb +22 -0
- data/spec/dummy/db/migrate/20180118233010_create_content_types.cortex.rb +18 -0
- data/spec/dummy/db/migrate/20180118233011_create_fields.cortex.rb +16 -0
- data/spec/dummy/db/migrate/20180118233012_create_content_items.cortex.rb +15 -0
- data/spec/dummy/db/migrate/20180118233013_create_field_items.cortex.rb +13 -0
- data/spec/dummy/db/migrate/20180118233014_create_field_types.cortex.rb +6 -0
- data/spec/dummy/db/schema.rb +258 -0
- data/spec/dummy/db/seeds.rb +1 -0
- data/spec/dummy/lib/tasks/content_types_tasks.rake +31 -0
- data/spec/dummy/lib/tasks/employer/blog_tasks.rake +345 -0
- data/spec/dummy/package.json +28 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/robots.txt +5 -0
- data/spec/dummy/spec/javascripts/support/jasmine.yml +50 -0
- data/spec/dummy/yarn.lock +6615 -0
- data/spec/rails_helper.rb +57 -0
- data/spec/spec_helper.rb +96 -0
- data/yarn.lock +6032 -0
- metadata +1061 -0
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'rspec' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require "pathname"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require "rubygems"
|
15
|
+
require "bundler/setup"
|
16
|
+
|
17
|
+
load Gem.bin_path("rspec-core", "rspec")
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
require 'fileutils'
|
4
|
+
include FileUtils
|
5
|
+
|
6
|
+
# path to your application root.
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
8
|
+
|
9
|
+
def system!(*args)
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
chdir APP_ROOT do
|
14
|
+
# This script is a starting point to setup your application.
|
15
|
+
# Add necessary setup steps to this file.
|
16
|
+
|
17
|
+
puts '== Installing dependencies =='
|
18
|
+
system! 'gem install bundler --conservative'
|
19
|
+
system('bundle check') || system!('bundle install')
|
20
|
+
|
21
|
+
# Install JavaScript dependencies if using Yarn
|
22
|
+
# system('bin/yarn')
|
23
|
+
|
24
|
+
|
25
|
+
# puts "\n== Copying sample files =="
|
26
|
+
# unless File.exist?('config/database.yml')
|
27
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
28
|
+
# end
|
29
|
+
|
30
|
+
puts "\n== Preparing database =="
|
31
|
+
system! 'bin/rails db:setup'
|
32
|
+
|
33
|
+
puts "\n== Removing old logs and tempfiles =="
|
34
|
+
system! 'bin/rails log:clear tmp:clear'
|
35
|
+
|
36
|
+
puts "\n== Restarting application server =="
|
37
|
+
system! 'bin/rails restart'
|
38
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
require 'fileutils'
|
4
|
+
include FileUtils
|
5
|
+
|
6
|
+
# path to your application root.
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
8
|
+
|
9
|
+
def system!(*args)
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
chdir APP_ROOT do
|
14
|
+
# This script is a way to update your development environment automatically.
|
15
|
+
# Add necessary update steps to this file.
|
16
|
+
|
17
|
+
puts '== Installing dependencies =='
|
18
|
+
system! 'gem install bundler --conservative'
|
19
|
+
system('bundle check') || system!('bundle install')
|
20
|
+
|
21
|
+
puts "\n== Updating database =="
|
22
|
+
system! 'bin/rails db:migrate'
|
23
|
+
|
24
|
+
puts "\n== Removing old logs and tempfiles =="
|
25
|
+
system! 'bin/rails log:clear tmp:clear'
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system! 'bin/rails restart'
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'webpack' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("webpacker", "webpack")
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'webpack-dev-server' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("webpacker", "webpack-dev-server")
|
data/spec/dummy/bin/yarn
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
VENDOR_PATH = File.expand_path('..', __dir__)
|
3
|
+
Dir.chdir(VENDOR_PATH) do
|
4
|
+
begin
|
5
|
+
exec "yarnpkg #{ARGV.join(" ")}"
|
6
|
+
rescue Errno::ENOENT
|
7
|
+
$stderr.puts "Yarn executable was not detected in the system."
|
8
|
+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
9
|
+
exit 1
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
defaults: &defaults
|
2
|
+
apiKey: <%= ENV['APOLLO_ENGINE_PROXY_API_KEY'] %>
|
3
|
+
logging:
|
4
|
+
level: <%= ENV['APOLLO_ENGINE_PROXY_LOGGING_LEVEL'] %>
|
5
|
+
origins:
|
6
|
+
- http:
|
7
|
+
url: <%= ENV['APOLLO_ENGINE_PROXY_ORIGIN_HTTP_URL'] %>
|
8
|
+
frontends:
|
9
|
+
- host: <%= ENV['APOLLO_ENGINE_PROXY_FRONTEND_HOST'] %>
|
10
|
+
port: <%= ENV['APOLLO_ENGINE_PROXY_FRONTEND_PORT'] %>
|
11
|
+
endpoint: <%= ENV['APOLLO_ENGINE_PROXY_FRONTEND_ENDPOINT'] %>
|
12
|
+
|
13
|
+
development:
|
14
|
+
<<: *defaults
|
15
|
+
|
16
|
+
test:
|
17
|
+
<<: *defaults
|
18
|
+
|
19
|
+
staging:
|
20
|
+
<<: *defaults
|
21
|
+
|
22
|
+
production:
|
23
|
+
<<: *defaults
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'boot'
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
Bundler.require(*Rails.groups)
|
6
|
+
|
7
|
+
module CortexStarter
|
8
|
+
class Application < Rails::Application
|
9
|
+
config.load_defaults 5.1
|
10
|
+
|
11
|
+
config.i18n.enforce_available_locales = true
|
12
|
+
|
13
|
+
config.active_record.default_timezone = :utc
|
14
|
+
config.active_job.queue_adapter = :sidekiq
|
15
|
+
|
16
|
+
# Generators should use UUID PKs by default
|
17
|
+
config.generators do |generator|
|
18
|
+
generator.orm :active_record, primary_key_type: :uuid
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
|
5
|
+
# Cache requires
|
6
|
+
begin
|
7
|
+
puts 'Initializing bootscale..'
|
8
|
+
require 'bootscale/setup'
|
9
|
+
rescue LoadError
|
10
|
+
puts 'Skipping bootscale initialization - not loaded.'
|
11
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
defaults: &defaults
|
2
|
+
cortex:
|
3
|
+
news_feed:
|
4
|
+
tenant: <%= ENV['CORTEX_NEWS_FEED_TENANT'] %>
|
5
|
+
extra:
|
6
|
+
google_analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
|
7
|
+
qualtrics_id: <%= ENV['QUALTRICS_ID'] %>
|
8
|
+
cors:
|
9
|
+
allowed_origins: <%= ENV['CORS_ALLOWED_ORIGINS'] %>
|
10
|
+
allowed_origins_regex: <%= ENV['CORS_ALLOWED_ORIGINS_REGEX'] %>
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *defaults
|
14
|
+
|
15
|
+
test:
|
16
|
+
<<: *defaults
|
17
|
+
|
18
|
+
staging:
|
19
|
+
<<: *defaults
|
20
|
+
|
21
|
+
production:
|
22
|
+
<<: *defaults
|
@@ -0,0 +1,22 @@
|
|
1
|
+
defaults: &defaults
|
2
|
+
adapter: postgresql
|
3
|
+
encoding: unicode
|
4
|
+
database: <%= ENV['DATABASE_NAME'] || 'cortex_starter_dev' %>
|
5
|
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
6
|
+
username: <%= ENV['DATABASE_USERNAME'] || '' %>
|
7
|
+
password: <%= ENV['DATABASE_PASSWORD'] || '' %>
|
8
|
+
host: <%= ENV['DATABASE_HOST'] || '' %>
|
9
|
+
port: <%= ENV['DATABASE_PORT'] || '' %>
|
10
|
+
|
11
|
+
test:
|
12
|
+
<<: *defaults
|
13
|
+
database: <%= ENV['TEST_DATABASE_NAME'] || 'cortex_starter_test' %>
|
14
|
+
|
15
|
+
development:
|
16
|
+
<<: *defaults
|
17
|
+
|
18
|
+
staging:
|
19
|
+
<<: *defaults
|
20
|
+
|
21
|
+
production:
|
22
|
+
<<: *defaults
|
@@ -0,0 +1,74 @@
|
|
1
|
+
CortexStarter::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
|
15
|
+
# Enable/disable caching. By default caching is disabled.
|
16
|
+
if Rails.root.join('tmp/caching-dev.txt').exist?
|
17
|
+
config.action_controller.perform_caching = true
|
18
|
+
|
19
|
+
config.cache_store = :memory_store
|
20
|
+
config.public_file_server.headers = {
|
21
|
+
'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
|
22
|
+
}
|
23
|
+
else
|
24
|
+
config.action_controller.perform_caching = false
|
25
|
+
|
26
|
+
config.cache_store = :null_store
|
27
|
+
end
|
28
|
+
|
29
|
+
# Print deprecation notices to the Rails logger.
|
30
|
+
config.active_support.deprecation = :log
|
31
|
+
|
32
|
+
# Raise an error on page load if there are pending migrations
|
33
|
+
config.active_record.migration_error = :page_load
|
34
|
+
|
35
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
36
|
+
# This option may cause significant delays in view rendering with a large
|
37
|
+
# number of complex assets.
|
38
|
+
config.assets.debug = true
|
39
|
+
|
40
|
+
# Suppress logger output for asset requests.
|
41
|
+
config.assets.quiet = true
|
42
|
+
|
43
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
44
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
45
|
+
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
46
|
+
|
47
|
+
if ENV['DEPLOYED']
|
48
|
+
config.cache_store = :redis_store, ENV['CACHE_URL']
|
49
|
+
else
|
50
|
+
config.cache_store = :redis_store, ENV['CACHE_URL'], { :namespace => ENV['REDIS_NAMESPACE'] || 'cortex_starter_dev' }
|
51
|
+
end
|
52
|
+
|
53
|
+
Sidekiq.configure_server do |config|
|
54
|
+
config.redis = { :namespace => ENV['REDIS_NAMESPACE'] || 'cortex_starter_dev' } unless ENV['DEPLOYED']
|
55
|
+
end
|
56
|
+
|
57
|
+
Sidekiq.configure_client do |config|
|
58
|
+
config.redis = { :namespace => ENV['REDIS_NAMESPACE'] || 'cortex_starter_dev' } unless ENV['DEPLOYED']
|
59
|
+
end
|
60
|
+
|
61
|
+
config.action_mailer.default_url_options = {:host => ENV['HOST']}
|
62
|
+
config.action_mailer.perform_caching = false
|
63
|
+
config.action_mailer.delivery_method = :smtp
|
64
|
+
config.action_mailer.smtp_settings = {
|
65
|
+
:authentication => :login,
|
66
|
+
:address => ENV['SMTP_ADDRESS'],
|
67
|
+
:port => ENV['SMTP_PORT'],
|
68
|
+
:domain => ENV['SMTP_SENDER_DOMAIN'],
|
69
|
+
:user_name => ENV['SMTP_USERNAME'],
|
70
|
+
:password => ENV['SMTP_PASSWORD'],
|
71
|
+
:enable_starttls_auto => ENV['SMTP_STARTTLS']
|
72
|
+
}
|
73
|
+
ActionMailer::Base.default from: ENV['SMTP_SENDER_ADDRESS']
|
74
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
CortexStarter::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both thread web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Attempt to read encrypted secrets from `config/secrets.yml.enc`.
|
18
|
+
# Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
|
19
|
+
# `config/secrets.yml.key`.
|
20
|
+
config.read_encrypted_secrets = true
|
21
|
+
|
22
|
+
# Disable serving static files from the `/public` folder by default since
|
23
|
+
# Apache or NGINX already handles this.
|
24
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
25
|
+
|
26
|
+
# Compress JavaScripts and CSS.
|
27
|
+
config.assets.js_compressor = :uglifier
|
28
|
+
# config.assets.css_compressor = :sass
|
29
|
+
|
30
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
31
|
+
config.assets.compile = false
|
32
|
+
|
33
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
34
|
+
|
35
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
36
|
+
if ENV['ASSET_HOST_URL']
|
37
|
+
config.action_controller.asset_host = ENV['ASSET_HOST_URL']
|
38
|
+
end
|
39
|
+
|
40
|
+
# Specifies the header that your server uses for sending files.
|
41
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
42
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
43
|
+
|
44
|
+
# Mount Action Cable outside main process or domain
|
45
|
+
# config.action_cable.mount_path = nil
|
46
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
47
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
48
|
+
|
49
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
50
|
+
# config.force_ssl = true
|
51
|
+
|
52
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
53
|
+
# when problems arise.
|
54
|
+
config.log_level = :debug
|
55
|
+
|
56
|
+
# Prepend all log lines with the following tags.
|
57
|
+
config.log_tags = [ :request_id ]
|
58
|
+
|
59
|
+
# Use a different cache store in production.
|
60
|
+
config.cache_store = :redis_store, ENV['CACHE_URL']
|
61
|
+
|
62
|
+
# Use a real queuing backend for Active Job (and separate queues per environment)
|
63
|
+
# config.active_job.queue_adapter = :resque
|
64
|
+
# config.active_job.queue_name_prefix = "cool_#{Rails.env}"
|
65
|
+
config.action_mailer.perform_caching = false
|
66
|
+
|
67
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
68
|
+
# the I18n.default_locale when a translation can not be found).
|
69
|
+
config.i18n.fallbacks = true
|
70
|
+
|
71
|
+
# Send deprecation notices to registered listeners.
|
72
|
+
config.active_support.deprecation = :notify
|
73
|
+
|
74
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
75
|
+
config.log_formatter = ::Logger::Formatter.new
|
76
|
+
|
77
|
+
# Use a different logger for distributed setups.
|
78
|
+
# require 'syslog/logger'
|
79
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
80
|
+
|
81
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
82
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
83
|
+
logger.formatter = config.log_formatter
|
84
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Do not dump schema after migrations.
|
88
|
+
config.active_record.dump_schema_after_migration = false
|
89
|
+
|
90
|
+
config.action_mailer.raise_delivery_errors = true
|
91
|
+
config.action_mailer.default_url_options = {:host => ENV['HOST']}
|
92
|
+
config.action_mailer.delivery_method = :smtp
|
93
|
+
config.action_mailer.smtp_settings = {
|
94
|
+
:authentication => :login,
|
95
|
+
:address => ENV['SMTP_ADDRESS'],
|
96
|
+
:port => ENV['SMTP_PORT'],
|
97
|
+
:domain => ENV['SMTP_SENDER_DOMAIN'],
|
98
|
+
:user_name => ENV['SMTP_USERNAME'],
|
99
|
+
:password => ENV['SMTP_PASSWORD'],
|
100
|
+
:enable_starttls_auto => ENV['SMTP_STARTTLS']
|
101
|
+
}
|
102
|
+
ActionMailer::Base.default from: ENV['SMTP_SENDER_ADDRESS']
|
103
|
+
end
|