├── log
└── .keep
├── storage
└── .keep
├── tmp
└── .keep
├── vendor
└── .keep
├── lib
├── assets
│ └── .keep
├── tasks
│ └── .keep
└── generators
│ └── component_generator.rb
├── public
├── favicon.ico
├── apple-touch-icon.png
├── apple-touch-icon-precomposed.png
├── robots.txt
├── 500.html
├── 422.html
└── 404.html
├── .browserslistrc
├── .ruby-version
├── app
├── models
│ ├── concerns
│ │ └── .keep
│ └── application_record.rb
├── controllers
│ ├── concerns
│ │ └── .keep
│ ├── static_controller.rb
│ └── application_controller.rb
├── views
│ ├── layouts
│ │ ├── mailer.text.erb
│ │ ├── application.html.erb
│ │ └── mailer.html.erb
│ └── static
│ │ └── index.html.erb
├── jobs
│ └── application_job.rb
├── mailers
│ └── application_mailer.rb
└── helpers
│ └── application_helper.rb
├── frontend
├── components
│ ├── footer
│ │ ├── _footer.html.erb
│ │ ├── footer.css
│ │ └── footer.js
│ ├── header
│ │ ├── header.css
│ │ ├── header.js
│ │ └── _header.html.erb
│ ├── container
│ │ ├── container.css
│ │ ├── container.js
│ │ └── _container.html.erb
│ ├── tail
│ │ └── _tail.html.erb
│ └── head
│ │ └── _head.html.erb
├── init
│ ├── index.js
│ └── index.css
└── packs
│ └── application.js
├── Procfile
├── Procfile.dev
├── config
├── routes.rb
├── spring.rb
├── environment.rb
├── webpack
│ ├── test.js
│ ├── development.js
│ ├── production.js
│ └── environment.js
├── initializers
│ ├── mime_types.rb
│ ├── filter_parameter_logging.rb
│ ├── application_controller_renderer.rb
│ ├── cookies_serializer.rb
│ ├── backtrace_silencers.rb
│ ├── wrap_parameters.rb
│ ├── inflections.rb
│ └── content_security_policy.rb
├── boot.rb
├── database.yml
├── locales
│ └── en.yml
├── application.rb
├── storage.yml
├── puma.rb
├── environments
│ ├── test.rb
│ ├── development.rb
│ └── production.rb
└── webpacker.yml
├── stylelint.config.js
├── bin
├── bundle
├── rake
├── rails
├── yarn
├── webpack
├── webpack-dev-server
├── spring
├── update
└── setup
├── config.ru
├── Rakefile
├── lefthook.yml
├── db
├── seeds.rb
└── schema.rb
├── postcss.config.js
├── .eslintrc.js
├── .gitignore
├── Gemfile
├── README.md
├── package.json
├── babel.config.js
└── Gemfile.lock
/log/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/storage/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tmp/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/assets/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/tasks/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.browserslistrc:
--------------------------------------------------------------------------------
1 | defaults
2 |
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | ruby-2.7.1
2 |
--------------------------------------------------------------------------------
/app/models/concerns/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/components/footer/_footer.html.erb:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | server: bin/rails server -p 3000
2 |
--------------------------------------------------------------------------------
/frontend/init/index.js:
--------------------------------------------------------------------------------
1 | import "./index.css";
2 |
--------------------------------------------------------------------------------
/app/views/layouts/mailer.text.erb:
--------------------------------------------------------------------------------
1 | <%= yield %>
2 |
--------------------------------------------------------------------------------
/app/views/static/index.html.erb:
--------------------------------------------------------------------------------
1 | <%= c("container") %>
2 |
--------------------------------------------------------------------------------
/frontend/components/footer/footer.css:
--------------------------------------------------------------------------------
1 | /* Commented out */
2 |
--------------------------------------------------------------------------------
/frontend/components/footer/footer.js:
--------------------------------------------------------------------------------
1 | import "./footer.css";
2 |
--------------------------------------------------------------------------------
/frontend/components/header/header.css:
--------------------------------------------------------------------------------
1 | /* Commented out */
2 |
--------------------------------------------------------------------------------
/frontend/components/header/header.js:
--------------------------------------------------------------------------------
1 | import "./header.css";
2 |
--------------------------------------------------------------------------------
/frontend/components/container/container.css:
--------------------------------------------------------------------------------
1 | /* Commented out */
2 |
--------------------------------------------------------------------------------
/frontend/components/container/container.js:
--------------------------------------------------------------------------------
1 | import "./container.css";
2 |
--------------------------------------------------------------------------------
/Procfile.dev:
--------------------------------------------------------------------------------
1 | server: bin/rails server
2 | assets: bin/webpack-dev-server
3 |
--------------------------------------------------------------------------------
/app/jobs/application_job.rb:
--------------------------------------------------------------------------------
1 | class ApplicationJob < ActiveJob::Base
2 | end
3 |
--------------------------------------------------------------------------------
/frontend/components/tail/_tail.html.erb:
--------------------------------------------------------------------------------
1 | <%= javascript_pack_tag 'application' %>
2 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 |
3 | root 'static#index'
4 | end
5 |
--------------------------------------------------------------------------------
/frontend/components/container/_container.html.erb:
--------------------------------------------------------------------------------
1 | <%= c("header") %>
2 | <%= yield %>
3 | <%= c("footer") %>
4 |
--------------------------------------------------------------------------------
/app/controllers/static_controller.rb:
--------------------------------------------------------------------------------
1 | class StaticController < ApplicationController
2 | def index
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | class ApplicationRecord < ActiveRecord::Base
2 | self.abstract_class = true
3 | end
4 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 |
--------------------------------------------------------------------------------
/stylelint.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: ["stylelint-config-standard", "stylelint-prettier/recommended"],
3 | };
4 |
--------------------------------------------------------------------------------
/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: 'from@example.com'
3 | layout 'mailer'
4 | end
5 |
--------------------------------------------------------------------------------
/config/spring.rb:
--------------------------------------------------------------------------------
1 | %w[
2 | .ruby-version
3 | .rbenv-vars
4 | tmp/restart.txt
5 | tmp/caching-dev.txt
6 | ].each { |path| Spring.watch(path) }
7 |
--------------------------------------------------------------------------------
/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | prepend_view_path Rails.root.join("frontend")
3 | end
4 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require_relative 'config/environment'
4 |
5 | run Rails.application
6 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative 'application'
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/frontend/packs/application.js:
--------------------------------------------------------------------------------
1 | // Entry point
2 | import "init";
3 |
4 | import "components/header/header";
5 | import "components/footer/footer";
6 | import "components/container/container";
7 |
--------------------------------------------------------------------------------
/config/webpack/test.js:
--------------------------------------------------------------------------------
1 | process.env.NODE_ENV = process.env.NODE_ENV || "development";
2 |
3 | const environment = require("./environment");
4 |
5 | module.exports = environment.toWebpackConfig();
6 |
--------------------------------------------------------------------------------
/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
--------------------------------------------------------------------------------
/config/webpack/development.js:
--------------------------------------------------------------------------------
1 | process.env.NODE_ENV = process.env.NODE_ENV || "development";
2 |
3 | const environment = require("./environment");
4 |
5 | module.exports = environment.toWebpackConfig();
6 |
--------------------------------------------------------------------------------
/config/webpack/production.js:
--------------------------------------------------------------------------------
1 | process.env.NODE_ENV = process.env.NODE_ENV || "production";
2 |
3 | const environment = require("./environment");
4 |
5 | module.exports = environment.toWebpackConfig();
6 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2 |
3 | require 'bundler/setup' # Set up gems listed in the Gemfile.
4 | require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
5 |
--------------------------------------------------------------------------------
/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += [:password]
5 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require_relative 'config/application'
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Template
5 | <%= c("head") %>
6 |
7 |
8 |
9 | <%= yield %>
10 |
11 | <%= c("tail") %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path('../spring', __FILE__)
4 | rescue LoadError => e
5 | raise unless e.message.include?('spring')
6 | end
7 | require_relative '../config/boot'
8 | require 'rake'
9 | Rake.application.run
10 |
--------------------------------------------------------------------------------
/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | def component(component_name, locals = {}, &block)
3 | name = component_name.split("_").first
4 | render("components/#{name}/#{component_name}", locals, &block)
5 | end
6 |
7 | alias c component
8 | end
9 |
--------------------------------------------------------------------------------
/frontend/init/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #f2f2f2;
3 | font-family: "Montserrat", sans-serif;
4 | color: #000 !important;
5 | }
6 |
7 | h1 {
8 | font-weight: 900;
9 | font-size: 26px;
10 | }
11 |
12 | .text-dark {
13 | color: #000 !important;
14 | }
15 |
--------------------------------------------------------------------------------
/config/initializers/application_controller_renderer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # ActiveSupport::Reloader.to_prepare do
4 | # ApplicationController.renderer.defaults.merge!(
5 | # http_host: 'example.org',
6 | # https: false
7 | # )
8 | # end
9 |
--------------------------------------------------------------------------------
/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Specify a serializer for the signed and encrypted cookie jars.
4 | # Valid options are :json, :marshal, and :hybrid.
5 | Rails.application.config.action_dispatch.cookies_serializer = :json
6 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path('../spring', __FILE__)
4 | rescue LoadError => e
5 | raise unless e.message.include?('spring')
6 | end
7 | APP_PATH = File.expand_path('../config/application', __dir__)
8 | require_relative '../config/boot'
9 | require 'rails/commands'
10 |
--------------------------------------------------------------------------------
/frontend/components/head/_head.html.erb:
--------------------------------------------------------------------------------
1 | <%= csrf_meta_tags %>
2 | <%= csp_meta_tag %>
3 |
4 | <%= stylesheet_pack_tag 'application' %>
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/views/layouts/mailer.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/config/webpack/environment.js:
--------------------------------------------------------------------------------
1 | const { environment } = require("@rails/webpacker");
2 |
3 | ["css", "moduleCss"].forEach((loaderName) => {
4 | const loader = environment.loaders.get(loaderName);
5 |
6 | loader.test = /\.(p?css)$/i;
7 |
8 | environment.loaders.insert(loaderName, loader);
9 | });
10 |
11 | module.exports = environment;
12 |
--------------------------------------------------------------------------------
/bin/yarn:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_ROOT = File.expand_path('..', __dir__)
3 | Dir.chdir(APP_ROOT) do
4 | begin
5 | exec "yarnpkg", *ARGV
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
12 |
--------------------------------------------------------------------------------
/lefthook.yml:
--------------------------------------------------------------------------------
1 | pre-commit:
2 | parallel: true
3 | commands:
4 | js:
5 | glob: "*.js"
6 | run: "yarn prettier --write {staged_files} && yarn eslint {staged_files} && git add {staged_files}"
7 | css:
8 | glob: "*.{css,pcss}"
9 | run: "yarn prettier --write {staged_files} && yarn stylelint --fix {staged_files} && git add {staged_files}"
10 |
--------------------------------------------------------------------------------
/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # This file should contain all the record creation needed to seed the database with its default values.
2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
3 | #
4 | # Examples:
5 | #
6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
7 | # Character.create(name: 'Luke', movie: movies.first)
8 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | /* eslint global-require: off, import/no-extraneous-dependencies: off */
2 |
3 | module.exports = {
4 | plugins: [
5 | require("postcss-import"),
6 | require("postcss-inline-svg"),
7 | require("postcss-flexbugs-fixes"),
8 | require("postcss-preset-env")({
9 | autoprefixer: {
10 | flexbox: "no-2009"
11 | },
12 | stage: 3
13 | }),
14 | require("postcss-nested")
15 | ]
16 | };
17 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: ["eslint-config-airbnb-base", "plugin:prettier/recommended"],
3 |
4 | env: {
5 | browser: true,
6 | },
7 |
8 | parser: "babel-eslint",
9 |
10 | settings: {
11 | "import/resolver": {
12 | webpack: {
13 | config: {
14 | resolve: {
15 | modules: ["frontend", "node_modules"],
16 | },
17 | },
18 | },
19 | },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/config/database.yml:
--------------------------------------------------------------------------------
1 | default: &default
2 | adapter: postgresql
3 | encoding: unicode
4 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
5 |
6 | development:
7 | <<: *default
8 | database: template_development
9 |
10 | test:
11 | <<: *default
12 | database: template_test
13 |
14 | production:
15 | <<: *default
16 | database: template_production
17 | username: template
18 | password: <%= ENV['TEMPLATE_DATABASE_PASSWORD'] %>
19 |
--------------------------------------------------------------------------------
/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/bin/webpack:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
4 | ENV["NODE_ENV"] ||= "development"
5 |
6 | require "pathname"
7 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
8 | Pathname.new(__FILE__).realpath)
9 |
10 | require "bundler/setup"
11 |
12 | require "webpacker"
13 | require "webpacker/webpack_runner"
14 |
15 | APP_ROOT = File.expand_path("..", __dir__)
16 | Dir.chdir(APP_ROOT) do
17 | Webpacker::WebpackRunner.run(ARGV)
18 | end
19 |
--------------------------------------------------------------------------------
/bin/webpack-dev-server:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
4 | ENV["NODE_ENV"] ||= "development"
5 |
6 | require "pathname"
7 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
8 | Pathname.new(__FILE__).realpath)
9 |
10 | require "bundler/setup"
11 |
12 | require "webpacker"
13 | require "webpacker/dev_server_runner"
14 |
15 | APP_ROOT = File.expand_path("..", __dir__)
16 | Dir.chdir(APP_ROOT) do
17 | Webpacker::DevServerRunner.run(ARGV)
18 | end
19 |
--------------------------------------------------------------------------------
/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json]
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/bin/spring:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | # This file loads Spring without using Bundler, in order to be fast.
4 | # It gets overwritten when you run the `spring binstub` command.
5 |
6 | unless defined?(Spring)
7 | require 'rubygems'
8 | require 'bundler'
9 |
10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11 | spring = lockfile.specs.detect { |spec| spec.name == 'spring' }
12 | if spring
13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
14 | gem 'spring', spring.version
15 | require 'spring/binstub'
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, '\1en'
8 | # inflect.singular /^(ox)en/i, '\1'
9 | # inflect.irregular 'person', 'people'
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym 'RESTful'
16 | # end
17 |
--------------------------------------------------------------------------------
/frontend/components/header/_header.html.erb:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2 | #
3 | # If you find yourself ignoring temporary files generated by your text editor
4 | # or operating system, you probably want to add a global ignore instead:
5 | # git config --global core.excludesfile '~/.gitignore_global'
6 |
7 | # Ignore bundler config.
8 | /.bundle
9 |
10 | # Ignore all logfiles and tempfiles.
11 | /log/*
12 | /tmp/*
13 | !/log/.keep
14 | !/tmp/.keep
15 |
16 | # Ignore uploaded files in development
17 | /storage/*
18 | !/storage/.keep
19 |
20 | /node_modules
21 | /yarn-error.log
22 |
23 | /public/assets
24 | .byebug_history
25 |
26 | # Ignore master key for decrypting credentials and more.
27 | /config/master.key
28 |
29 | /public/packs
30 | /public/packs-test
31 | /node_modules
32 | /yarn-error.log
33 | yarn-debug.log*
34 | .yarn-integrity
35 |
--------------------------------------------------------------------------------
/db/schema.rb:
--------------------------------------------------------------------------------
1 | # This file is auto-generated from the current state of the database. Instead
2 | # of editing this file, please use the migrations feature of Active Record to
3 | # incrementally modify your database, and then regenerate this schema definition.
4 | #
5 | # This file is the source Rails uses to define your schema when running `rails
6 | # db:schema:load`. When creating a new database, `rails db:schema:load` tends to
7 | # be faster and is potentially less error prone than running all of your
8 | # migrations from scratch. Old migrations may fail to apply correctly if those
9 | # migrations use external dependencies or application code.
10 | #
11 | # It's strongly recommended that you check this file into your version control system.
12 |
13 | ActiveRecord::Schema.define(version: 0) do
14 |
15 | # These are extensions that must be enabled in order to support this database
16 | enable_extension "plpgsql"
17 |
18 | end
19 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3 |
4 | ruby '2.7.1'
5 |
6 | # Webserver/DB
7 | gem 'rails'
8 | gem 'pg'
9 | gem 'puma'
10 |
11 | # Frontend
12 | gem 'webpacker'
13 |
14 | # Use Redis adapter to run Action Cable in production
15 | # gem 'redis', '~> 4.0'
16 | # Use ActiveModel has_secure_password
17 | # gem 'bcrypt', '~> 3.1.7'
18 |
19 | # Use ActiveStorage variant
20 | # gem 'mini_magick', '~> 4.8'
21 |
22 | # Use Capistrano for deployment
23 | # gem 'capistrano-rails', group: :development
24 |
25 | # Reduces boot times through caching; required in config/boot.rb
26 | gem 'bootsnap', require: false
27 |
28 | group :development, :test do
29 | gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
30 | gem 'rspec-rails'
31 | gem 'factory_bot'
32 | end
33 |
34 | group :development do
35 | gem 'listen'
36 | gem 'spring'
37 | gem 'spring-watcher-listen'
38 | end
39 |
--------------------------------------------------------------------------------
/bin/update:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'fileutils'
3 | include FileUtils
4 |
5 | # path to your application root.
6 | APP_ROOT = File.expand_path('..', __dir__)
7 |
8 | def system!(*args)
9 | system(*args) || abort("\n== Command #{args} failed ==")
10 | end
11 |
12 | chdir APP_ROOT do
13 | # This script is a way to update your development environment automatically.
14 | # Add necessary update steps to this file.
15 |
16 | puts '== Installing dependencies =='
17 | system! 'gem install bundler --conservative'
18 | system('bundle check') || system!('bundle install')
19 |
20 | # Install JavaScript dependencies if using Yarn
21 | # system('bin/yarn')
22 |
23 | puts "\n== Updating database =="
24 | system! 'bin/rails db:migrate'
25 |
26 | puts "\n== Removing old logs and tempfiles =="
27 | system! 'bin/rails log:clear tmp:clear'
28 |
29 | puts "\n== Restarting application server =="
30 | system! 'bin/rails restart'
31 | end
32 |
--------------------------------------------------------------------------------
/lib/generators/component_generator.rb:
--------------------------------------------------------------------------------
1 | class ComponentGenerator < Rails::Generators::Base
2 | argument :component_name, required: true, desc: "Component name, e.g: 'post' | 'author'"
3 |
4 | def create_view_file
5 | create_file "#{component_path}/_#{component_name}.html.erb"
6 | end
7 |
8 | def create_scss_file
9 | create_file "#{component_path}/#{component_name}.css"
10 | end
11 |
12 | def create_js_file
13 | create_file "#{component_path}/#{component_name}.js" do
14 | # require component's CSS inside JS automatically
15 | "import \"./#{component_name}.css\";\n"
16 | end
17 | end
18 |
19 | def append_to_packs
20 | append_to_file(packs_path) do
21 | "import \"components/#{component_name}/#{component_name}\";\n"
22 | end
23 | end
24 |
25 | protected
26 |
27 | def component_path
28 | "frontend/components/#{component_name}"
29 | end
30 |
31 | def packs_path
32 | "frontend/packs/application.js"
33 | end
34 | end
35 |
--------------------------------------------------------------------------------
/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t 'hello'
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t('hello') %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # The following keys must be escaped otherwise they will not be retrieved by
20 | # the default I18n backend:
21 | #
22 | # true, false, on, off, yes, no
23 | #
24 | # Instead, surround them with single quotes.
25 | #
26 | # en:
27 | # 'true': 'foo'
28 | #
29 | # To learn more, please read the Rails Internationalization guide
30 | # available at http://guides.rubyonrails.org/i18n.html.
31 |
32 | en:
33 | hello: "Hello world"
34 |
--------------------------------------------------------------------------------
/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'fileutils'
3 | include FileUtils
4 |
5 | # path to your application root.
6 | APP_ROOT = File.expand_path('..', __dir__)
7 |
8 | def system!(*args)
9 | system(*args) || abort("\n== Command #{args} failed ==")
10 | end
11 |
12 | chdir APP_ROOT do
13 | # This script is a starting point to setup your application.
14 | # Add necessary setup steps to this file.
15 |
16 | puts '== Installing dependencies =='
17 | system! 'gem install bundler --conservative'
18 | system('bundle check') || system!('bundle install')
19 |
20 | # Install JavaScript dependencies if using Yarn
21 | # system('bin/yarn')
22 |
23 | # puts "\n== Copying sample files =="
24 | # unless File.exist?('config/database.yml')
25 | # cp 'config/database.yml.sample', 'config/database.yml'
26 | # end
27 |
28 | puts "\n== Preparing database =="
29 | system! 'bin/rails db:setup'
30 |
31 | puts "\n== Removing old logs and tempfiles =="
32 | system! 'bin/rails log:clear tmp:clear'
33 |
34 | puts "\n== Restarting application server =="
35 | system! 'bin/rails restart'
36 | end
37 |
--------------------------------------------------------------------------------
/config/application.rb:
--------------------------------------------------------------------------------
1 | require_relative 'boot'
2 |
3 | require "rails"
4 |
5 | # Pick the frameworks you want:
6 | require "active_model/railtie"
7 | require "active_job/railtie"
8 | require "active_record/railtie"
9 | require "active_storage/engine"
10 | require "action_controller/railtie"
11 | require "action_mailer/railtie"
12 | require "action_view/railtie"
13 | # require "action_cable/engine"
14 | # require "sprockets/railtie"
15 | # require "rails/test_unit/railtie"
16 |
17 | # Require the gems listed in Gemfile, including any gems
18 | # you've limited to :test, :development, or :production.
19 | Bundler.require(*Rails.groups)
20 |
21 | module Template
22 | class Application < Rails::Application
23 | # Initialize configuration defaults for originally generated Rails version.
24 | config.load_defaults 5.2
25 |
26 | # Don't auto generate default files.
27 | # config.generators.system_tests = nil
28 |
29 | config.generators do |g|
30 | g.assets = nil
31 |
32 | g.test_framework = nil
33 | g.helper = nil
34 |
35 | g.channel assets: false
36 | end
37 | end
38 | end
39 |
--------------------------------------------------------------------------------
/config/initializers/content_security_policy.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Define an application-wide content security policy
4 | # For further information see the following documentation
5 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6 |
7 | # Rails.application.config.content_security_policy do |policy|
8 | # policy.default_src :self, :https
9 | # policy.font_src :self, :https, :data
10 | # policy.img_src :self, :https, :data
11 | # policy.object_src :none
12 | # policy.script_src :self, :https
13 | # policy.style_src :self, :https
14 |
15 | # # Specify URI for violation reports
16 | # # policy.report_uri "/csp-violation-report-endpoint"
17 | # end
18 |
19 | # If you are using UJS then enable automatic nonce generation
20 | # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
21 |
22 | # Report CSP violations to a specified URI
23 | # For further information see the following documentation:
24 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
25 | # Rails.application.config.content_security_policy_report_only = true
26 |
--------------------------------------------------------------------------------
/config/storage.yml:
--------------------------------------------------------------------------------
1 | test:
2 | service: Disk
3 | root: <%= Rails.root.join("tmp/storage") %>
4 |
5 | local:
6 | service: Disk
7 | root: <%= Rails.root.join("storage") %>
8 |
9 | # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10 | # amazon:
11 | # service: S3
12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14 | # region: us-east-1
15 | # bucket: your_own_bucket
16 |
17 | # Remember not to checkin your GCS keyfile to a repository
18 | # google:
19 | # service: GCS
20 | # project: your_project
21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22 | # bucket: your_own_bucket
23 |
24 | # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25 | # microsoft:
26 | # service: AzureStorage
27 | # storage_account_name: your_account_name
28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29 | # container: your_container_name
30 |
31 | # mirror:
32 | # service: Mirror
33 | # primary: local
34 | # mirrors: [ amazon, google, microsoft ]
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Fullstack
2 |
3 | Inspired by [evilmartians' frontend](https://evilmartians.com/chronicles/evil-front-part-1) approach, fullstack is my own template for spinning fullstack apps quickly.
4 |
5 |
6 | ## What?
7 | This is a base `rails 6` template, based on view components for easier fullstack development.
8 |
9 | ## Ah, What's inside?
10 |
11 | ### FE
12 | It's shipped with the essential tools/files to set you up quickly chceck [packages.json](/package.json) for hints.
13 |
14 | ### BE
15 | Rails 6, postgresql and puma. It also depends on `ruby 2.7.1`.
16 |
17 | #### Usage of the `component` generator command
18 | You can do it like this:
19 |
20 | ```
21 | → rails g component article-body
22 |
23 | Running via Spring preloader in process 53004
24 | create frontend/components/article-body/_article-body.html.erb
25 | create frontend/components/article-body/article-body.css
26 | create frontend/components/article-body/article-body.js
27 | append frontend/packs/application.js
28 | ```
29 |
30 | # I want to change my App name
31 | `/config/application.rb` then change the `module Template` to `module MyNewFancyApp` and you are good to go.
32 |
33 | # Easily installing templates
34 | By using [Rails Bytes](https://railsbytes.com/public/templates) you can easily charge up your app
35 |
36 | # Is it up to date?
37 | To the day: `June 21, 2020` Yes, it's for now up to date.
38 |
39 | # Thanks?
40 | You are welcome bruh.
41 |
--------------------------------------------------------------------------------
/config/puma.rb:
--------------------------------------------------------------------------------
1 | # Puma can serve each request in a thread from an internal thread pool.
2 | # The `threads` method setting takes two numbers: a minimum and maximum.
3 | # Any libraries that use thread pools should be configured to match
4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum
5 | # and maximum; this matches the default thread size of Active Record.
6 | #
7 | threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8 | threads threads_count, threads_count
9 |
10 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
11 | #
12 | port ENV.fetch("PORT") { 3000 }
13 |
14 | # Specifies the `environment` that Puma will run in.
15 | #
16 | environment ENV.fetch("RAILS_ENV") { "development" }
17 |
18 | # Specifies the number of `workers` to boot in clustered mode.
19 | # Workers are forked webserver processes. If using threads and workers together
20 | # the concurrency of the application would be max `threads` * `workers`.
21 | # Workers do not work on JRuby or Windows (both of which do not support
22 | # processes).
23 | #
24 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
25 |
26 | # Use the `preload_app!` method when specifying a `workers` number.
27 | # This directive tells Puma to first boot the application and load code
28 | # before forking the application. This takes advantage of Copy On Write
29 | # process behavior so workers use less memory.
30 | #
31 | # preload_app!
32 |
33 | # Allow puma to be restarted by `rails restart` command.
34 | plugin :tmp_restart
35 |
--------------------------------------------------------------------------------
/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | We're sorry, but something went wrong (500)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
We're sorry, but something went wrong.
62 |
63 |
If you are the application owner check the logs for more information.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "template",
3 | "private": true,
4 | "dependencies": {
5 | "@rails/webpacker": "5.4.0",
6 | "normalize.css": "^8.0.1",
7 | "ssri": "^8.0.1",
8 | "yarn": "^1.22.4"
9 | },
10 | "scripts": {
11 | "lint-staged": "$(yarn bin)/lint-staged"
12 | },
13 | "lint-staged": {
14 | "config/webpack/**/*.js": [
15 | "prettier --write",
16 | "eslint",
17 | "git add"
18 | ],
19 | "frontend/**/*.js": [
20 | "prettier --write",
21 | "eslint",
22 | "git add"
23 | ],
24 | "frontend/**/*.css": [
25 | "prettier --write",
26 | "stylelint --fix",
27 | "git add"
28 | ]
29 | },
30 | "pre-commit": [
31 | "lint-staged"
32 | ],
33 | "devDependencies": {
34 | "@arkweid/lefthook": "^0.7.1",
35 | "autoprefixer": "^10.3.1",
36 | "babel-core": "^6.26.3",
37 | "babel-eslint": "^10.1.0",
38 | "babel-loader": "^8.0.5",
39 | "babel-preset-env": "^1.7.0",
40 | "babel-preset-es2015": "^6.24.1",
41 | "cssnano": "^5.0.7",
42 | "eslint": "^7.0.0",
43 | "eslint-config-airbnb-base": "^14.1.0",
44 | "eslint-config-prettier": "^8.3.0",
45 | "eslint-import-resolver-webpack": "^0.13.1",
46 | "eslint-plugin-import": "^2.20.2",
47 | "eslint-plugin-prettier": "^3.1.3",
48 | "html-loader": "^2.1.2",
49 | "lint-staged": "^11.1.2",
50 | "postcss-cssnext": "^3.1.0",
51 | "postcss-import": "^14.0.2",
52 | "postcss-inline-svg": "^5.0.0",
53 | "postcss-loader": "^6.1.1",
54 | "postcss-nested": "^5.0.6",
55 | "pre-commit": "^1.2.2",
56 | "prettier": "^2.0.5",
57 | "stylelint": "^13.3.3",
58 | "stylelint-config-prettier": "^8.0.1",
59 | "stylelint-config-standard": "^22.0.0",
60 | "stylelint-prettier": "^1.1.2",
61 | "sugarss": "^4.0.1",
62 | "ts-loader": "^9.2.5",
63 | "typescript": "^4.3.5",
64 | "webpack-dev-server": "^3.11.3"
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The change you wanted was rejected (422)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The change you wanted was rejected.
62 |
Maybe you tried to change something you didn't have access to.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The page you were looking for doesn't exist.
62 |
You may have mistyped the address or the page may have moved.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Do not eager load code on boot. This avoids loading your whole application
11 | # just for the purpose of running a single test. If you are using a tool that
12 | # preloads Rails for running tests, you may have to set it to true.
13 | config.eager_load = false
14 |
15 | # Configure public file server for tests with Cache-Control for performance.
16 | config.public_file_server.enabled = true
17 | config.public_file_server.headers = {
18 | 'Cache-Control' => "public, max-age=#{1.hour.to_i}"
19 | }
20 |
21 | # Show full error reports and disable caching.
22 | config.consider_all_requests_local = true
23 | config.action_controller.perform_caching = false
24 |
25 | # Raise exceptions instead of rendering exception templates.
26 | config.action_dispatch.show_exceptions = false
27 |
28 | # Disable request forgery protection in test environment.
29 | config.action_controller.allow_forgery_protection = false
30 |
31 | # Store uploaded files on the local file system in a temporary directory
32 | config.active_storage.service = :test
33 |
34 | config.action_mailer.perform_caching = false
35 |
36 | # Tell Action Mailer not to deliver emails to the real world.
37 | # The :test delivery method accumulates sent emails in the
38 | # ActionMailer::Base.deliveries array.
39 | config.action_mailer.delivery_method = :test
40 |
41 | # Print deprecation notices to the stderr.
42 | config.active_support.deprecation = :stderr
43 |
44 | # Raises error for missing translations
45 | # config.action_view.raise_on_missing_translations = true
46 | end
47 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | Rails.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 | # Run rails dev:cache to toggle caching.
17 | if Rails.root.join('tmp', 'caching-dev.txt').exist?
18 | config.action_controller.perform_caching = true
19 |
20 | config.cache_store = :memory_store
21 | config.public_file_server.headers = {
22 | 'Cache-Control' => "public, max-age=#{2.days.to_i}"
23 | }
24 | else
25 | config.action_controller.perform_caching = false
26 |
27 | config.cache_store = :null_store
28 | end
29 |
30 | # Store uploaded files on the local file system (see config/storage.yml for options)
31 | config.active_storage.service = :local
32 |
33 | # Don't care if the mailer can't send.
34 | config.action_mailer.raise_delivery_errors = false
35 |
36 | config.action_mailer.perform_caching = false
37 |
38 | # Print deprecation notices to the Rails logger.
39 | config.active_support.deprecation = :log
40 |
41 | # Raise an error on page load if there are pending migrations.
42 | config.active_record.migration_error = :page_load
43 |
44 | # Highlight code that triggered database queries in logs.
45 | config.active_record.verbose_query_logs = true
46 |
47 |
48 | # Raises error for missing translations
49 | # config.action_view.raise_on_missing_translations = true
50 |
51 | # Use an evented file watcher to asynchronously detect changes in source code,
52 | # routes, locales, etc. This feature depends on the listen gem.
53 | config.file_watcher = ActiveSupport::EventedFileUpdateChecker
54 | end
55 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = function(api) {
2 | var validEnv = ['development', 'test', 'production']
3 | var currentEnv = api.env()
4 | var isDevelopmentEnv = api.env('development')
5 | var isProductionEnv = api.env('production')
6 | var isTestEnv = api.env('test')
7 |
8 | if (!validEnv.includes(currentEnv)) {
9 | throw new Error(
10 | 'Please specify a valid `NODE_ENV` or ' +
11 | '`BABEL_ENV` environment variables. Valid values are "development", ' +
12 | '"test", and "production". Instead, received: ' +
13 | JSON.stringify(currentEnv) +
14 | '.'
15 | )
16 | }
17 |
18 | return {
19 | presets: [
20 | isTestEnv && [
21 | require('@babel/preset-env').default,
22 | {
23 | targets: {
24 | node: 'current'
25 | }
26 | }
27 | ],
28 | (isProductionEnv || isDevelopmentEnv) && [
29 | require('@babel/preset-env').default,
30 | {
31 | forceAllTransforms: true,
32 | useBuiltIns: 'entry',
33 | corejs: 3,
34 | modules: false,
35 | exclude: ['transform-typeof-symbol']
36 | }
37 | ]
38 | ].filter(Boolean),
39 | plugins: [
40 | require('babel-plugin-macros'),
41 | require('@babel/plugin-syntax-dynamic-import').default,
42 | isTestEnv && require('babel-plugin-dynamic-import-node'),
43 | require('@babel/plugin-transform-destructuring').default,
44 | [
45 | require('@babel/plugin-proposal-class-properties').default,
46 | {
47 | loose: true
48 | }
49 | ],
50 | [
51 | require('@babel/plugin-proposal-object-rest-spread').default,
52 | {
53 | useBuiltIns: true
54 | }
55 | ],
56 | [
57 | require('@babel/plugin-transform-runtime').default,
58 | {
59 | helpers: false,
60 | regenerator: true,
61 | corejs: false
62 | }
63 | ],
64 | [
65 | require('@babel/plugin-transform-regenerator').default,
66 | {
67 | async: false
68 | }
69 | ]
70 | ].filter(Boolean)
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/config/webpacker.yml:
--------------------------------------------------------------------------------
1 | # Note: You must restart bin/webpack-dev-server for changes to take effect
2 |
3 | default: &default
4 | source_path: frontend
5 | source_entry_path: packs
6 | public_root_path: public
7 | public_output_path: packs
8 | cache_path: tmp/cache/webpacker
9 | check_yarn_integrity: false
10 | webpack_compile_output: false
11 |
12 | # Additional paths webpack should lookup modules
13 | # ['app/assets', 'engine/foo/app/assets']
14 | resolved_paths: []
15 |
16 | # Reload manifest.json on all requests so we reload latest compiled packs
17 | cache_manifest: false
18 |
19 | # Extract and emit a css file
20 | extract_css: false
21 |
22 | static_assets_extensions:
23 | - .jpg
24 | - .jpeg
25 | - .png
26 | - .gif
27 | - .tiff
28 | - .ico
29 | - .svg
30 | - .eot
31 | - .otf
32 | - .ttf
33 | - .woff
34 | - .woff2
35 |
36 | extensions:
37 | - .mjs
38 | - .js
39 | - .sass
40 | - .scss
41 | - .css
42 | - .module.sass
43 | - .module.scss
44 | - .module.css
45 | - .png
46 | - .svg
47 | - .gif
48 | - .jpeg
49 | - .jpg
50 |
51 | development:
52 | <<: *default
53 | compile: true
54 |
55 | # Reference: https://webpack.js.org/configuration/dev-server/
56 | dev_server:
57 | https: false
58 | host: localhost
59 | port: 3035
60 | public: localhost:3035
61 | hmr: false
62 | # Inline should be set to true if using HMR
63 | inline: true
64 | overlay: true
65 | compress: true
66 | disable_host_check: true
67 | use_local_ip: false
68 | quiet: false
69 | pretty: false
70 | headers:
71 | 'Access-Control-Allow-Origin': '*'
72 | watch_options:
73 | ignored: '**/node_modules/**'
74 |
75 |
76 | test:
77 | <<: *default
78 | compile: true
79 |
80 | # Compile test packs to a separate directory
81 | public_output_path: packs-test
82 |
83 | production:
84 | <<: *default
85 |
86 | # Production depends on precompilation of packs prior to booting for performance.
87 | compile: false
88 |
89 | # Extract and emit a css file
90 | extract_css: true
91 |
92 | # Cache manifest.json for performance
93 | cache_manifest: true
94 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | Rails.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 threaded 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 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
18 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
19 | # config.require_master_key = true
20 |
21 | # Disable serving static files from the `/public` folder by default since
22 | # Apache or NGINX already handles this.
23 | config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
24 |
25 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
26 | # config.action_controller.asset_host = 'http://assets.example.com'
27 |
28 | # Specifies the header that your server uses for sending files.
29 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
30 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
31 |
32 | # Store uploaded files on the local file system (see config/storage.yml for options)
33 | config.active_storage.service = :local
34 |
35 | # Mount Action Cable outside main process or domain
36 | # config.action_cable.mount_path = nil
37 | # config.action_cable.url = 'wss://example.com/cable'
38 | # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
39 |
40 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
41 | # config.force_ssl = true
42 |
43 | # Use the lowest log level to ensure availability of diagnostic information
44 | # when problems arise.
45 | config.log_level = :debug
46 |
47 | # Prepend all log lines with the following tags.
48 | config.log_tags = [ :request_id ]
49 |
50 | # Use a different cache store in production.
51 | # config.cache_store = :mem_cache_store
52 |
53 | # Use a real queuing backend for Active Job (and separate queues per environment)
54 | # config.active_job.queue_adapter = :resque
55 | # config.active_job.queue_name_prefix = "template_#{Rails.env}"
56 |
57 | config.action_mailer.perform_caching = false
58 |
59 | # Ignore bad email addresses and do not raise email delivery errors.
60 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
61 | # config.action_mailer.raise_delivery_errors = false
62 |
63 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
64 | # the I18n.default_locale when a translation cannot be found).
65 | config.i18n.fallbacks = true
66 |
67 | # Send deprecation notices to registered listeners.
68 | config.active_support.deprecation = :notify
69 |
70 | # Use default logging formatter so that PID and timestamp are not suppressed.
71 | config.log_formatter = ::Logger::Formatter.new
72 |
73 | # Use a different logger for distributed setups.
74 | # require 'syslog/logger'
75 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
76 |
77 | if ENV["RAILS_LOG_TO_STDOUT"].present?
78 | logger = ActiveSupport::Logger.new(STDOUT)
79 | logger.formatter = config.log_formatter
80 | config.logger = ActiveSupport::TaggedLogging.new(logger)
81 | end
82 |
83 | # Do not dump schema after migrations.
84 | config.active_record.dump_schema_after_migration = false
85 | end
86 |
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | actioncable (6.1.4)
5 | actionpack (= 6.1.4)
6 | activesupport (= 6.1.4)
7 | nio4r (~> 2.0)
8 | websocket-driver (>= 0.6.1)
9 | actionmailbox (6.1.4)
10 | actionpack (= 6.1.4)
11 | activejob (= 6.1.4)
12 | activerecord (= 6.1.4)
13 | activestorage (= 6.1.4)
14 | activesupport (= 6.1.4)
15 | mail (>= 2.7.1)
16 | actionmailer (6.1.4)
17 | actionpack (= 6.1.4)
18 | actionview (= 6.1.4)
19 | activejob (= 6.1.4)
20 | activesupport (= 6.1.4)
21 | mail (~> 2.5, >= 2.5.4)
22 | rails-dom-testing (~> 2.0)
23 | actionpack (6.1.4)
24 | actionview (= 6.1.4)
25 | activesupport (= 6.1.4)
26 | rack (~> 2.0, >= 2.0.9)
27 | rack-test (>= 0.6.3)
28 | rails-dom-testing (~> 2.0)
29 | rails-html-sanitizer (~> 1.0, >= 1.2.0)
30 | actiontext (6.1.4)
31 | actionpack (= 6.1.4)
32 | activerecord (= 6.1.4)
33 | activestorage (= 6.1.4)
34 | activesupport (= 6.1.4)
35 | nokogiri (>= 1.8.5)
36 | actionview (6.1.4)
37 | activesupport (= 6.1.4)
38 | builder (~> 3.1)
39 | erubi (~> 1.4)
40 | rails-dom-testing (~> 2.0)
41 | rails-html-sanitizer (~> 1.1, >= 1.2.0)
42 | activejob (6.1.4)
43 | activesupport (= 6.1.4)
44 | globalid (>= 0.3.6)
45 | activemodel (6.1.4)
46 | activesupport (= 6.1.4)
47 | activerecord (6.1.4)
48 | activemodel (= 6.1.4)
49 | activesupport (= 6.1.4)
50 | activestorage (6.1.4)
51 | actionpack (= 6.1.4)
52 | activejob (= 6.1.4)
53 | activerecord (= 6.1.4)
54 | activesupport (= 6.1.4)
55 | marcel (~> 1.0.0)
56 | mini_mime (>= 1.1.0)
57 | activesupport (6.1.4)
58 | concurrent-ruby (~> 1.0, >= 1.0.2)
59 | i18n (>= 1.6, < 2)
60 | minitest (>= 5.1)
61 | tzinfo (~> 2.0)
62 | zeitwerk (~> 2.3)
63 | bootsnap (1.7.7)
64 | msgpack (~> 1.0)
65 | builder (3.2.4)
66 | byebug (11.1.3)
67 | concurrent-ruby (1.1.9)
68 | crass (1.0.6)
69 | diff-lcs (1.4.4)
70 | erubi (1.10.0)
71 | factory_bot (6.2.0)
72 | activesupport (>= 5.0.0)
73 | ffi (1.15.3)
74 | globalid (0.5.2)
75 | activesupport (>= 5.0)
76 | i18n (1.8.10)
77 | concurrent-ruby (~> 1.0)
78 | listen (3.6.0)
79 | rb-fsevent (~> 0.10, >= 0.10.3)
80 | rb-inotify (~> 0.9, >= 0.9.10)
81 | loofah (2.18.0)
82 | crass (~> 1.0.2)
83 | nokogiri (>= 1.5.9)
84 | mail (2.7.1)
85 | mini_mime (>= 0.1.1)
86 | marcel (1.0.1)
87 | method_source (1.0.0)
88 | mini_mime (1.1.0)
89 | mini_portile2 (2.8.0)
90 | minitest (5.14.4)
91 | msgpack (1.4.2)
92 | nio4r (2.5.8)
93 | nokogiri (1.13.9)
94 | mini_portile2 (~> 2.8.0)
95 | racc (~> 1.4)
96 | pg (1.2.3)
97 | puma (5.6.4)
98 | nio4r (~> 2.0)
99 | racc (1.6.0)
100 | rack (2.2.3.1)
101 | rack-proxy (0.7.0)
102 | rack
103 | rack-test (1.1.0)
104 | rack (>= 1.0, < 3)
105 | rails (6.1.4)
106 | actioncable (= 6.1.4)
107 | actionmailbox (= 6.1.4)
108 | actionmailer (= 6.1.4)
109 | actionpack (= 6.1.4)
110 | actiontext (= 6.1.4)
111 | actionview (= 6.1.4)
112 | activejob (= 6.1.4)
113 | activemodel (= 6.1.4)
114 | activerecord (= 6.1.4)
115 | activestorage (= 6.1.4)
116 | activesupport (= 6.1.4)
117 | bundler (>= 1.15.0)
118 | railties (= 6.1.4)
119 | sprockets-rails (>= 2.0.0)
120 | rails-dom-testing (2.0.3)
121 | activesupport (>= 4.2.0)
122 | nokogiri (>= 1.6)
123 | rails-html-sanitizer (1.4.3)
124 | loofah (~> 2.3)
125 | railties (6.1.4)
126 | actionpack (= 6.1.4)
127 | activesupport (= 6.1.4)
128 | method_source
129 | rake (>= 0.13)
130 | thor (~> 1.0)
131 | rake (13.0.6)
132 | rb-fsevent (0.11.0)
133 | rb-inotify (0.10.1)
134 | ffi (~> 1.0)
135 | rspec-core (3.10.1)
136 | rspec-support (~> 3.10.0)
137 | rspec-expectations (3.10.1)
138 | diff-lcs (>= 1.2.0, < 2.0)
139 | rspec-support (~> 3.10.0)
140 | rspec-mocks (3.10.2)
141 | diff-lcs (>= 1.2.0, < 2.0)
142 | rspec-support (~> 3.10.0)
143 | rspec-rails (5.0.1)
144 | actionpack (>= 5.2)
145 | activesupport (>= 5.2)
146 | railties (>= 5.2)
147 | rspec-core (~> 3.10)
148 | rspec-expectations (~> 3.10)
149 | rspec-mocks (~> 3.10)
150 | rspec-support (~> 3.10)
151 | rspec-support (3.10.2)
152 | semantic_range (3.0.0)
153 | spring (2.1.1)
154 | spring-watcher-listen (2.0.1)
155 | listen (>= 2.7, < 4.0)
156 | spring (>= 1.2, < 3.0)
157 | sprockets (4.0.2)
158 | concurrent-ruby (~> 1.0)
159 | rack (> 1, < 3)
160 | sprockets-rails (3.2.2)
161 | actionpack (>= 4.0)
162 | activesupport (>= 4.0)
163 | sprockets (>= 3.0.0)
164 | thor (1.1.0)
165 | tzinfo (2.0.4)
166 | concurrent-ruby (~> 1.0)
167 | webpacker (5.4.0)
168 | activesupport (>= 5.2)
169 | rack-proxy (>= 0.6.1)
170 | railties (>= 5.2)
171 | semantic_range (>= 2.3.0)
172 | websocket-driver (0.7.5)
173 | websocket-extensions (>= 0.1.0)
174 | websocket-extensions (0.1.5)
175 | zeitwerk (2.4.2)
176 |
177 | PLATFORMS
178 | ruby
179 |
180 | DEPENDENCIES
181 | bootsnap
182 | byebug
183 | factory_bot
184 | listen
185 | pg
186 | puma
187 | rails
188 | rspec-rails
189 | spring
190 | spring-watcher-listen
191 | webpacker
192 |
193 | RUBY VERSION
194 | ruby 2.7.1p83
195 |
196 | BUNDLED WITH
197 | 2.1.4
198 |
--------------------------------------------------------------------------------