Repository: ohbarye/rails-react-typescript-docker-example
Branch: main
Commit: 0d4325119354
Files: 99
Total size: 54.6 KB
Directory structure:
gitextract_vbzc0pcq/
├── .gitattributes
├── .github/
│ ├── dependabot.yml
│ └── workflows/
│ ├── backend_test.yml
│ └── frontend_test.yml
├── .gitignore
├── README.md
├── backend/
│ ├── .gitignore
│ ├── .ruby-version
│ ├── Dockerfile
│ ├── Gemfile
│ ├── LICENSE
│ ├── README.md
│ ├── Rakefile
│ ├── app/
│ │ ├── assets/
│ │ │ ├── config/
│ │ │ │ └── manifest.js
│ │ │ ├── images/
│ │ │ │ └── .keep
│ │ │ ├── javascripts/
│ │ │ │ ├── application.js
│ │ │ │ ├── cable.js
│ │ │ │ └── channels/
│ │ │ │ └── .keep
│ │ │ └── stylesheets/
│ │ │ └── application.css
│ │ ├── channels/
│ │ │ └── application_cable/
│ │ │ ├── channel.rb
│ │ │ └── connection.rb
│ │ ├── controllers/
│ │ │ ├── application_controller.rb
│ │ │ ├── concerns/
│ │ │ │ └── .keep
│ │ │ └── greetings_controller.rb
│ │ ├── helpers/
│ │ │ └── application_helper.rb
│ │ ├── jobs/
│ │ │ └── application_job.rb
│ │ ├── mailers/
│ │ │ └── application_mailer.rb
│ │ ├── models/
│ │ │ ├── application_record.rb
│ │ │ └── concerns/
│ │ │ └── .keep
│ │ └── views/
│ │ └── layouts/
│ │ ├── application.html.erb
│ │ ├── mailer.html.erb
│ │ └── mailer.text.erb
│ ├── bin/
│ │ ├── bundle
│ │ ├── rails
│ │ ├── rake
│ │ ├── setup
│ │ ├── spring
│ │ ├── update
│ │ └── yarn
│ ├── config/
│ │ ├── application.rb
│ │ ├── boot.rb
│ │ ├── cable.yml
│ │ ├── credentials.yml.enc
│ │ ├── database.yml
│ │ ├── environment.rb
│ │ ├── environments/
│ │ │ ├── development.rb
│ │ │ ├── production.rb
│ │ │ └── test.rb
│ │ ├── initializers/
│ │ │ ├── application_controller_renderer.rb
│ │ │ ├── assets.rb
│ │ │ ├── backtrace_silencers.rb
│ │ │ ├── content_security_policy.rb
│ │ │ ├── cookies_serializer.rb
│ │ │ ├── filter_parameter_logging.rb
│ │ │ ├── inflections.rb
│ │ │ ├── mime_types.rb
│ │ │ ├── new_framework_defaults_6_0.rb
│ │ │ └── wrap_parameters.rb
│ │ ├── locales/
│ │ │ └── en.yml
│ │ ├── puma.rb
│ │ ├── routes.rb
│ │ ├── spring.rb
│ │ └── storage.yml
│ ├── config.ru
│ ├── db/
│ │ ├── schema.rb
│ │ └── seeds.rb
│ ├── lib/
│ │ ├── assets/
│ │ │ └── .keep
│ │ └── tasks/
│ │ └── .keep
│ ├── log/
│ │ └── .keep
│ ├── prehook
│ ├── public/
│ │ ├── 404.html
│ │ ├── 422.html
│ │ ├── 500.html
│ │ └── robots.txt
│ ├── test/
│ │ ├── application_system_test_case.rb
│ │ ├── controllers/
│ │ │ └── .keep
│ │ ├── fixtures/
│ │ │ ├── .keep
│ │ │ └── files/
│ │ │ └── .keep
│ │ ├── helpers/
│ │ │ └── .keep
│ │ ├── integration/
│ │ │ └── .keep
│ │ ├── mailers/
│ │ │ └── .keep
│ │ ├── models/
│ │ │ └── .keep
│ │ ├── routing/
│ │ │ └── routing_test.rb
│ │ ├── system/
│ │ │ └── .keep
│ │ └── test_helper.rb
│ └── vendor/
│ └── .keep
├── docker-compose.yml
└── frontend/
├── .gitignore
├── jest.config.js
├── package.json
├── src/
│ ├── App.css
│ ├── App.tsx
│ ├── __tests__/
│ │ ├── App.test.tsx
│ │ └── styleMock.js
│ ├── index.css
│ ├── index.html
│ └── index.tsx
├── tsconfig.json
└── webpack.config.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
backend/bin/* eol=lf
prehook eol=lf
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: bundler
directory: "/backend"
schedule:
interval: daily
time: "20:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: rails
versions:
- 6.1.2
- 6.1.2.1
- dependency-name: puma
versions:
- 5.2.1
- dependency-name: bootsnap
versions:
- 1.6.0
- package-ecosystem: npm
directory: "/frontend"
schedule:
interval: daily
time: "20:00"
open-pull-requests-limit: 10
================================================
FILE: .github/workflows/backend_test.yml
================================================
name: Backend Test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
services:
postgres:
image: postgres:11
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: test
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
RAILS_ENV: test
RAILS_DATABASE_HOST: 127.0.0.1
RAILS_DATABASE_USER: postgres
RAILS_DATABASE_PASSWORD: password
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.1
bundler-cache: true
working-directory: ./backend
- name: Migration
run: |
bundle exec rails db:create
bundle exec rake db:schema:load
- name: Run rspec
run: bundle exec rake test
================================================
FILE: .github/workflows/frontend_test.yml
================================================
name: Frontend Test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
- name: Install dependencies
run: yarn install
- name: Check TypeScript compiler works well
run: yarn typecheck
- name: Run test
run: yarn test
================================================
FILE: .gitignore
================================================
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
*/tmp/*
!/log/.keep
!/tmp/.keep
# Ignore uploaded files in development
/storage/*
/node_modules
/yarn-error.log
/public/assets
.byebug_history
# Ignore master key for decrypting credentials and more.
/config/master.key
================================================
FILE: README.md
================================================
# Rails-React-TypeScript-Docker Example  
## TL;DR
**Here is an example application with the following modern web technology stacks. With this boilerplate, you can easily start to build your own app.**
- [Ruby](https://www.ruby-lang.org/en/) 3.3.1
- [Rails](https://rubyonrails.org/) 6.1.4
- [React.js](https://reactjs.org/) 17.0.1
- [TypeScript](https://www.typescriptlang.org/) 4.3.5
- [Docker](https://docs.docker.com/)
- [PostgreSQL](https://www.postgresql.org/) 11
- [GitHub Actions](https://github.com/features/actions)
## Usage
```shell
$ git clone https://github.com/ohbarye/rails-react-typescript-docker-example.git && cd rails-react-typescript-docker-example
# Setup
$ docker-compose run frontend yarn
$ docker-compose run backend bin/rails db:create db:migrate
# Start
$ docker-compose up -d
# Open frontend
$ open http://localhost:80 # You'll see yaichi page, then click any app
# Check backend API
$ curl -H 'Host: backend.localhost' http://localhost/greetings/hello
```
## Motivation
Nowadays, I feel like **we need a wide range acknowledgment on web development even if we call ourselves "backend developer" or "frontend developer".**
As for my experience, I've been a Rails engineer, I'm but recently working like kinda frontend developer because I spend all of my working time for building an SPA (single page application) built with React + TypeScript.
The SPA, Of course, has a backend API, Ruby on Rails connecting PostgreSQL in my case. I use Docker Compose for defining and running multi-container Docker applications because it's not much simple to bootstrap all of applications and middlewares.
**Learning each technology itself is not a burden. I rather like learning. But I've thought I'd like to pursue my playground whose tech stacks are virtually same as ones I develop in work.**
## Further Details
### Backend
The combination, Rails + PostgreSQL + Docker Compose, is just a result I followed [Docker Compose's official instruction](https://docs.docker.com/compose/rails/).
### Frontend
It consist of very thin webpack settings, TypeScript config, and Jest.
================================================
FILE: backend/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep
# Ignore uploaded files in development
/storage/*
/node_modules
/yarn-error.log
/public/assets
.byebug_history
# Ignore master key for decrypting credentials and more.
/config/master.key
================================================
FILE: backend/.ruby-version
================================================
3.3.1
================================================
FILE: backend/Dockerfile
================================================
FROM --platform=linux/amd64 ruby:3.3.1
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir -p /myapp/backend
WORKDIR /myapp/backend
COPY Gemfile /myapp/backend/Gemfile
COPY Gemfile.lock /myapp/backend/Gemfile.lock
RUN bundle install
COPY . /myapp/backend
ENV ENTRYKIT_VERSION 0.4.0
RUN wget https://github.com/progrium/entrykit/releases/download/v${ENTRYKIT_VERSION}/entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \
&& tar -xvzf entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \
&& rm entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \
&& mv entrykit /bin/entrykit \
&& chmod +x /bin/entrykit \
&& entrykit --symlink
ENTRYPOINT [ \
"prehook", "ruby -v", "--", \
"prehook", "/myapp/backend/prehook", "--"]
================================================
FILE: backend/Gemfile
================================================
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '3.3.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.1.6'
# gem 'rails', '~> 6.0.3'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 5.6'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.11'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 4.1.0'
# Display performance information such as SQL time and flame graphs for each request in your browser.
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
gem 'rack-mini-profiler', '~> 3.0'
gem 'listen', '~> 3.7'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 3.26'
gem 'selenium-webdriver'
# Automate routing spec
gem 'route_mechanic'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'rack-cors', require: 'rack/cors'
================================================
FILE: backend/LICENSE
================================================
MIT License
Copyright (c) 2018 Masato Ohba
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: backend/README.md
================================================
# README
This README would normally document whatever steps are necessary to get the
application up and running.
Things you may want to cover:
* Ruby version
* System dependencies
* Configuration
* Database creation
* Database initialization
* How to run the test suite
* Services (job queues, cache servers, search engines, etc.)
* Deployment instructions
* ...
================================================
FILE: backend/Rakefile
================================================
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require_relative 'config/application'
Rails.application.load_tasks
================================================
FILE: backend/app/assets/config/manifest.js
================================================
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
================================================
FILE: backend/app/assets/images/.keep
================================================
================================================
FILE: backend/app/assets/javascripts/application.js
================================================
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
// vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require rails-ujs
//= require activestorage
//= require turbolinks
//= require_tree .
================================================
FILE: backend/app/assets/javascripts/cable.js
================================================
// Action Cable provides the framework to deal with WebSockets in Rails.
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
//
//= require action_cable
//= require_self
//= require_tree ./channels
(function() {
this.App || (this.App = {});
App.cable = ActionCable.createConsumer();
}).call(this);
================================================
FILE: backend/app/assets/javascripts/channels/.keep
================================================
================================================
FILE: backend/app/assets/stylesheets/application.css
================================================
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
* vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/
================================================
FILE: backend/app/channels/application_cable/channel.rb
================================================
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end
================================================
FILE: backend/app/channels/application_cable/connection.rb
================================================
module ApplicationCable
class Connection < ActionCable::Connection::Base
end
end
================================================
FILE: backend/app/controllers/application_controller.rb
================================================
class ApplicationController < ActionController::Base
end
================================================
FILE: backend/app/controllers/concerns/.keep
================================================
================================================
FILE: backend/app/controllers/greetings_controller.rb
================================================
class GreetingsController < ApplicationController
def hello
render json: { content: 'Hello from Rails' }
end
end
================================================
FILE: backend/app/helpers/application_helper.rb
================================================
module ApplicationHelper
end
================================================
FILE: backend/app/jobs/application_job.rb
================================================
class ApplicationJob < ActiveJob::Base
end
================================================
FILE: backend/app/mailers/application_mailer.rb
================================================
class ApplicationMailer < ActionMailer::Base
default from: 'from@example.com'
layout 'mailer'
end
================================================
FILE: backend/app/models/application_record.rb
================================================
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
================================================
FILE: backend/app/models/concerns/.keep
================================================
================================================
FILE: backend/app/views/layouts/application.html.erb
================================================
<!DOCTYPE html>
<html>
<head>
<title>Myapp</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
<body>
<%= yield %>
</body>
</html>
================================================
FILE: backend/app/views/layouts/mailer.html.erb
================================================
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
/* Email styles need to be inline */
</style>
</head>
<body>
<%= yield %>
</body>
</html>
================================================
FILE: backend/app/views/layouts/mailer.text.erb
================================================
<%= yield %>
================================================
FILE: backend/bin/bundle
================================================
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
load Gem.bin_path('bundler', 'bundle')
================================================
FILE: backend/bin/rails
================================================
#!/usr/bin/env ruby
load File.expand_path("spring", __dir__)
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative "../config/boot"
require "rails/commands"
================================================
FILE: backend/bin/rake
================================================
#!/usr/bin/env ruby
load File.expand_path("spring", __dir__)
require_relative "../config/boot"
require "rake"
Rake.application.run
================================================
FILE: backend/bin/setup
================================================
#!/usr/bin/env ruby
require "fileutils"
# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
FileUtils.chdir APP_ROOT do
# This script is a way to set up or update your development environment automatically.
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
# Install JavaScript dependencies
system! 'bin/yarn'
# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
# end
puts "\n== Preparing database =="
system! 'bin/rails db:prepare'
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
puts "\n== Restarting application server =="
system! 'bin/rails restart'
end
================================================
FILE: backend/bin/spring
================================================
#!/usr/bin/env ruby
if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"])
gem "bundler"
require "bundler"
# Load Spring without loading other gems in the Gemfile, for speed.
Bundler.locked_gems.specs.find { |spec| spec.name == "spring" }&.tap do |spring|
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
gem "spring", spring.version
require "spring/binstub"
rescue Gem::LoadError
# Ignore when Spring is not installed.
end
end
================================================
FILE: backend/bin/update
================================================
#!/usr/bin/env ruby
require 'fileutils'
include FileUtils
# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
chdir APP_ROOT do
# This script is a way to update your development environment automatically.
# Add necessary update steps to this file.
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
# Install JavaScript dependencies if using Yarn
# system('bin/yarn')
puts "\n== Updating database =="
system! 'bin/rails db:migrate'
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
puts "\n== Restarting application server =="
system! 'bin/rails restart'
end
================================================
FILE: backend/bin/yarn
================================================
#!/usr/bin/env ruby
APP_ROOT = File.expand_path('..', __dir__)
Dir.chdir(APP_ROOT) do
yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
select { |dir| File.expand_path(dir) != __dir__ }.
product(["yarn", "yarn.exe"]).
map { |dir, file| File.expand_path(file, dir) }.
find { |file| File.executable?(file) }
if yarn
exec yarn, *ARGV
else
$stderr.puts "Yarn executable was not detected in the system."
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
exit 1
end
end
================================================
FILE: backend/config/application.rb
================================================
require_relative "boot"
require "rails/all"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Myapp
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0
# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
# in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
config.middleware.insert_before 0, Rack::Cors do
allow do
origins '*'
resource '*', headers: :any, methods: [:get, :post, :options]
end
end
end
end
================================================
FILE: backend/config/boot.rb
================================================
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup" # Speed up boot time by caching expensive operations.
================================================
FILE: backend/config/cable.yml
================================================
development:
adapter: async
test:
adapter: test
production:
adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
channel_prefix: myapp_production
================================================
FILE: backend/config/credentials.yml.enc
================================================
MhFYHHqzWPtI+D4H1TUKngSXfC1tnHJ3ELcJPi5hDCoAQSkwNsBRJBsOfQpHmHpBP7FZscShFFJBzZhu5WI20K7eeQzIKKoID4hnT5Xxkczib1MEWaAKfEkyRfkW6ui5kUwXDzLlZqb2Vz5gw54h+Wc2AHRys4ixR5kIH6mQrFyXM6TJeEZMowRil0f+a035BOrk4lNjmFQc6qe//DyCPAic7waY8iPrp51R00j/OB2I3LuU8MQILyOlkqVi7kinHYs6ATMElw2BpQR3zl7YU7hWgrMkVJY0Ivq0LGKxbTDh1+stIixppM6ycCkmdRdnunvqAFqoHf62AEh/F7aByyLVuT9pbEvjC0baC2k/KHHq2T/BSMeHxoiiE2/9nRw8tyq2pK1ABdW7BkUOJd7JfqSyoV8Uaf+c0jCV--UuHo79qD2WhbY77G--jzfM8cZ45rAvAU5O5X4QhQ==
================================================
FILE: backend/config/database.yml
================================================
# PostgreSQL. Versions 9.1 and up are supported.
#
# Install the pg driver:
# gem install pg
# On OS X with Homebrew:
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
# On OS X with MacPorts:
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
# On Windows:
# gem install pg
# Choose the win32 build.
# Install PostgreSQL and put its /bin directory on your path.
#
# Configure Using Gemfile
# gem 'pg'
#
default: &default
adapter: postgresql
encoding: unicode
host: <%= ENV.fetch("RAILS_DATABASE_HOST") { 'postgres' } %>
username: <%= ENV.fetch("RAILS_DATABASE_USER") { 'postgres' } %>
password: <%= ENV.fetch("RAILS_DATABASE_PASSWORD") { 'password' } %>
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
<<: *default
database: myapp_development
# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
# When left blank, postgres will use the default role. This is
# the same name as the operating system user that initialized the database.
#username: myapp
# The password associated with the postgres role (username).
#password:
# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. Windows does not have
# domain sockets, so uncomment these lines.
#host: localhost
# The TCP port the server listens on. Defaults to 5432.
# If your server runs on a different port number, change accordingly.
#port: 5432
# Schema search path. The server defaults to $user,public
#schema_search_path: myapp,sharedapp,public
# Minimum log levels, in increasing order:
# debug5, debug4, debug3, debug2, debug1,
# log, notice, warning, error, fatal, and panic
# Defaults to warning.
#min_messages: notice
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: <%= ENV.fetch("POSTGRES_DB") { 'myapp_test' } %>
# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password as a unix environment variable when you boot
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full rundown on how to provide these environment variables in a
# production deployment.
#
# On Heroku and other platform providers, you may have a full connection URL
# available as an environment variable. For example:
#
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
#
# You can use this database configuration with:
#
# production:
# url: <%= ENV['DATABASE_URL'] %>
#
production:
<<: *default
database: myapp_production
username: myapp
password: <%= ENV['MYAPP_DATABASE_PASSWORD'] %>
================================================
FILE: backend/config/environment.rb
================================================
# Load the Rails application.
require_relative "application"
# Initialize the Rails application.
Rails.application.initialize!
================================================
FILE: backend/config/environments/development.rb
================================================
require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports.
config.consider_all_requests_local = true
# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true
config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{2.days.to_i}"
}
else
config.action_controller.perform_caching = false
config.cache_store = :null_store
end
# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_caching = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise exceptions for disallowed deprecations.
config.active_support.disallowed_deprecation = :raise
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# Suppress logger output for asset requests.
config.assets.quiet = true
# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
end
================================================
FILE: backend/config/environments/production.rb
================================================
require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
# config.require_master_key = true
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress CSS using a preprocessor.
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.asset_host = 'http://assets.example.com'
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
# Mount Action Cable outside main process or domain.
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# Include generic and useful information about system operation, but avoid logging too much
# information to avoid inadvertent exposure of personally identifiable information (PII).
config.log_level = :info
# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Use a real queuing backend for Active Job (and separate queues per environment).
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "myapp_production"
config.action_mailer.perform_caching = false
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Log disallowed deprecations.
config.active_support.disallowed_deprecation = :log
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Use a different logger for distributed setups.
# require "syslog/logger"
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
# Inserts middleware to perform automatic connection switching.
# The `database_selector` hash is used to pass options to the DatabaseSelector
# middleware. The `delay` is used to determine how long to wait after a write
# to send a subsequent read to the primary.
#
# The `database_resolver` class is used by the middleware to determine which
# database is appropriate to use based on the time delay.
#
# The `database_resolver_context` class is used by the middleware to set
# timestamps for the last write to the primary. The resolver uses the context
# class timestamps to determine how long to wait before reading from the
# replica.
#
# By default Rails will store a last write timestamp in the session. The
# DatabaseSelector middleware is designed as such you can define your own
# strategy for connection switching and pass that into the middleware through
# these configuration options.
# config.active_record.database_selector = { delay: 2.seconds }
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
end
================================================
FILE: backend/config/environments/test.rb
================================================
require "active_support/core_ext/integer/time"
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
config.cache_classes = false
config.action_view.cache_template_loading = true
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
}
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.cache_store = :null_store
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
# Store uploaded files on the local file system in a temporary directory.
config.active_storage.service = :test
config.action_mailer.perform_caching = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
# Raise exceptions for disallowed deprecations.
config.active_support.disallowed_deprecation = :raise
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
end
================================================
FILE: backend/config/initializers/application_controller_renderer.rb
================================================
# Be sure to restart your server when you modify this file.
# ActiveSupport::Reloader.to_prepare do
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
# end
================================================
FILE: backend/config/initializers/assets.rb
================================================
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_modules folder to the asset load path.
Rails.application.config.assets.paths << Rails.root.join('node_modules')
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
================================================
FILE: backend/config/initializers/backtrace_silencers.rb
================================================
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code
# by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'".
Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"]
================================================
FILE: backend/config/initializers/content_security_policy.rb
================================================
# Be sure to restart your server when you modify this file.
# Define an application-wide content security policy
# For further information see the following documentation
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
# Rails.application.config.content_security_policy do |policy|
# policy.default_src :self, :https
# policy.font_src :self, :https, :data
# policy.img_src :self, :https, :data
# policy.object_src :none
# policy.script_src :self, :https
# policy.style_src :self, :https
# # If you are using webpack-dev-server then specify webpack-dev-server host
# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
# # Specify URI for violation reports
# # policy.report_uri "/csp-violation-report-endpoint"
# end
# If you are using UJS then enable automatic nonce generation
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
# Set the nonce only to specific directives
# Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
# Report CSP violations to a specified URI
# For further information see the following documentation:
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
# Rails.application.config.content_security_policy_report_only = true
================================================
FILE: backend/config/initializers/cookies_serializer.rb
================================================
# Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.
# Valid options are :json, :marshal, and :hybrid.
Rails.application.config.action_dispatch.cookies_serializer = :json
================================================
FILE: backend/config/initializers/filter_parameter_logging.rb
================================================
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
]
================================================
FILE: backend/config/initializers/inflections.rb
================================================
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
# These inflection rules are supported but not enabled by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.acronym 'RESTful'
# end
================================================
FILE: backend/config/initializers/mime_types.rb
================================================
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
================================================
FILE: backend/config/initializers/new_framework_defaults_6_0.rb
================================================
# Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 6.0 upgrade.
#
# Once upgraded flip defaults one by one to migrate to the new default.
#
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
# Don't force requests from old versions of IE to be UTF-8 encoded.
# Rails.application.config.action_view.default_enforce_utf8 = false
# Embed purpose and expiry metadata inside signed and encrypted
# cookies for increased security.
#
# This option is not backwards compatible with earlier Rails versions.
# It's best enabled when your entire app is migrated and stable on 6.0.
# Rails.application.config.action_dispatch.use_cookies_with_metadata = true
# Change the return value of `ActionDispatch::Response#content_type` to Content-Type header without modification.
# Rails.application.config.action_dispatch.return_only_media_type_on_content_type = false
# Return false instead of self when enqueuing is aborted from a callback.
# Rails.application.config.active_job.return_false_on_aborted_enqueue = true
# Send Active Storage analysis and purge jobs to dedicated queues.
# Rails.application.config.active_storage.queues.analysis = :active_storage_analysis
# Rails.application.config.active_storage.queues.purge = :active_storage_purge
# When assigning to a collection of attachments declared via `has_many_attached`, replace existing
# attachments instead of appending. Use #attach to add new attachments without replacing existing ones.
# Rails.application.config.active_storage.replace_on_assign_to_many = true
# Use ActionMailer::MailDeliveryJob for sending parameterized and normal mail.
#
# The default delivery jobs (ActionMailer::Parameterized::DeliveryJob, ActionMailer::DeliveryJob),
# will be removed in Rails 6.1. This setting is not backwards compatible with earlier Rails versions.
# If you send mail in the background, job workers need to have a copy of
# MailDeliveryJob to ensure all delivery jobs are processed properly.
# Make sure your entire app is migrated and stable on 6.0 before using this setting.
# Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob"
# Enable the same cache key to be reused when the object being cached of type
# `ActiveRecord::Relation` changes by moving the volatile information (max updated at and count)
# of the relation's cache key into the cache version to support recycling cache key.
# Rails.application.config.active_record.collection_cache_versioning = true
================================================
FILE: backend/config/initializers/wrap_parameters.rb
================================================
# Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json]
end
# To enable root element in JSON for ActiveRecord objects.
# ActiveSupport.on_load(:active_record) do
# self.include_root_in_json = true
# end
================================================
FILE: backend/config/locales/en.yml
================================================
# Files in the config/locales directory are used for internationalization
# and are automatically loaded by Rails. If you want to use locales other
# than English, add the necessary files in this directory.
#
# To use the locales, use `I18n.t`:
#
# I18n.t 'hello'
#
# In views, this is aliased to just `t`:
#
# <%= t('hello') %>
#
# To use a different locale, set it with `I18n.locale`:
#
# I18n.locale = :es
#
# This would use the information in config/locales/es.yml.
#
# The following keys must be escaped otherwise they will not be retrieved by
# the default I18n backend:
#
# true, false, on, off, yes, no
#
# Instead, surround them with single quotes.
#
# en:
# 'true': 'foo'
#
# To learn more, please read the Rails Internationalization guide
# available at https://guides.rubyonrails.org/i18n.html.
en:
hello: "Hello world"
================================================
FILE: backend/config/puma.rb
================================================
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
threads min_threads_count, max_threads_count
# Specifies the `worker_timeout` threshold that Puma will use to wait before
# terminating a worker in development environments.
#
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
#
port ENV.fetch("PORT") { 3000 }
# Specifies the `environment` that Puma will run in.
#
environment ENV.fetch("RAILS_ENV") { "development" }
# Specifies the `pidfile` that Puma will use.
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked web server processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory.
#
# preload_app!
# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart
================================================
FILE: backend/config/routes.rb
================================================
Rails.application.routes.draw do
get 'greetings/hello'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
================================================
FILE: backend/config/spring.rb
================================================
Spring.watch(
".ruby-version",
".rbenv-vars",
"tmp/restart.txt",
"tmp/caching-dev.txt"
)
================================================
FILE: backend/config/storage.yml
================================================
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>
local:
service: Disk
root: <%= Rails.root.join("storage") %>
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
# amazon:
# service: S3
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
# region: us-east-1
# bucket: your_own_bucket
# Remember not to checkin your GCS keyfile to a repository
# google:
# service: GCS
# project: your_project
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
# bucket: your_own_bucket
# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
# microsoft:
# service: AzureStorage
# storage_account_name: your_account_name
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
# container: your_container_name
# mirror:
# service: Mirror
# primary: local
# mirrors: [ amazon, google, microsoft ]
================================================
FILE: backend/config.ru
================================================
# This file is used by Rack-based servers to start the application.
require_relative "config/environment"
run Rails.application
Rails.application.load_server
================================================
FILE: backend/db/schema.rb
================================================
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 0) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
end
================================================
FILE: backend/db/seeds.rb
================================================
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Character.create(name: 'Luke', movie: movies.first)
================================================
FILE: backend/lib/assets/.keep
================================================
================================================
FILE: backend/lib/tasks/.keep
================================================
================================================
FILE: backend/log/.keep
================================================
================================================
FILE: backend/prehook
================================================
#!/usr/bin/env bash
if [ -e Gemfile ]; then
bundle check || bundle install
fi
if [ -e tmp/pids/server.pid ]; then
rm tmp/pids/server.pid
fi
================================================
FILE: backend/public/404.html
================================================
<!DOCTYPE html>
<html>
<head>
<title>The page you were looking for doesn't exist (404)</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
.rails-default-error-page {
background-color: #EFEFEF;
color: #2E2F30;
text-align: center;
font-family: arial, sans-serif;
margin: 0;
}
.rails-default-error-page div.dialog {
width: 95%;
max-width: 33em;
margin: 4em auto 0;
}
.rails-default-error-page div.dialog > div {
border: 1px solid #CCC;
border-right-color: #999;
border-left-color: #999;
border-bottom-color: #BBB;
border-top: #B00100 solid 4px;
border-top-left-radius: 9px;
border-top-right-radius: 9px;
background-color: white;
padding: 7px 12% 0;
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
}
.rails-default-error-page h1 {
font-size: 100%;
color: #730E15;
line-height: 1.5em;
}
.rails-default-error-page div.dialog > p {
margin: 0 0 1em;
padding: 1em;
background-color: #F7F7F7;
border: 1px solid #CCC;
border-right-color: #999;
border-left-color: #999;
border-bottom-color: #999;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-top-color: #DADADA;
color: #666;
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
}
</style>
</head>
<body class="rails-default-error-page">
<!-- This file lives in public/404.html -->
<div class="dialog">
<div>
<h1>The page you were looking for doesn't exist.</h1>
<p>You may have mistyped the address or the page may have moved.</p>
</div>
<p>If you are the application owner check the logs for more information.</p>
</div>
</body>
</html>
================================================
FILE: backend/public/422.html
================================================
<!DOCTYPE html>
<html>
<head>
<title>The change you wanted was rejected (422)</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
.rails-default-error-page {
background-color: #EFEFEF;
color: #2E2F30;
text-align: center;
font-family: arial, sans-serif;
margin: 0;
}
.rails-default-error-page div.dialog {
width: 95%;
max-width: 33em;
margin: 4em auto 0;
}
.rails-default-error-page div.dialog > div {
border: 1px solid #CCC;
border-right-color: #999;
border-left-color: #999;
border-bottom-color: #BBB;
border-top: #B00100 solid 4px;
border-top-left-radius: 9px;
border-top-right-radius: 9px;
background-color: white;
padding: 7px 12% 0;
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
}
.rails-default-error-page h1 {
font-size: 100%;
color: #730E15;
line-height: 1.5em;
}
.rails-default-error-page div.dialog > p {
margin: 0 0 1em;
padding: 1em;
background-color: #F7F7F7;
border: 1px solid #CCC;
border-right-color: #999;
border-left-color: #999;
border-bottom-color: #999;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-top-color: #DADADA;
color: #666;
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
}
</style>
</head>
<body class="rails-default-error-page">
<!-- This file lives in public/422.html -->
<div class="dialog">
<div>
<h1>The change you wanted was rejected.</h1>
<p>Maybe you tried to change something you didn't have access to.</p>
</div>
<p>If you are the application owner check the logs for more information.</p>
</div>
</body>
</html>
================================================
FILE: backend/public/500.html
================================================
<!DOCTYPE html>
<html>
<head>
<title>We're sorry, but something went wrong (500)</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
.rails-default-error-page {
background-color: #EFEFEF;
color: #2E2F30;
text-align: center;
font-family: arial, sans-serif;
margin: 0;
}
.rails-default-error-page div.dialog {
width: 95%;
max-width: 33em;
margin: 4em auto 0;
}
.rails-default-error-page div.dialog > div {
border: 1px solid #CCC;
border-right-color: #999;
border-left-color: #999;
border-bottom-color: #BBB;
border-top: #B00100 solid 4px;
border-top-left-radius: 9px;
border-top-right-radius: 9px;
background-color: white;
padding: 7px 12% 0;
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
}
.rails-default-error-page h1 {
font-size: 100%;
color: #730E15;
line-height: 1.5em;
}
.rails-default-error-page div.dialog > p {
margin: 0 0 1em;
padding: 1em;
background-color: #F7F7F7;
border: 1px solid #CCC;
border-right-color: #999;
border-left-color: #999;
border-bottom-color: #999;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-top-color: #DADADA;
color: #666;
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
}
</style>
</head>
<body class="rails-default-error-page">
<!-- This file lives in public/500.html -->
<div class="dialog">
<div>
<h1>We're sorry, but something went wrong.</h1>
</div>
<p>If you are the application owner check the logs for more information.</p>
</div>
</body>
</html>
================================================
FILE: backend/public/robots.txt
================================================
# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
================================================
FILE: backend/test/application_system_test_case.rb
================================================
require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
end
================================================
FILE: backend/test/controllers/.keep
================================================
================================================
FILE: backend/test/fixtures/.keep
================================================
================================================
FILE: backend/test/fixtures/files/.keep
================================================
================================================
FILE: backend/test/helpers/.keep
================================================
================================================
FILE: backend/test/integration/.keep
================================================
================================================
FILE: backend/test/mailers/.keep
================================================
================================================
FILE: backend/test/models/.keep
================================================
================================================
FILE: backend/test/routing/routing_test.rb
================================================
class RoutingTest < Minitest::Test
include ::RouteMechanic::Testing::Methods
def test_that_application_has_correct_routes
assert_all_routes
end
end
================================================
FILE: backend/test/system/.keep
================================================
================================================
FILE: backend/test/test_helper.rb
================================================
ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
# Add more helper methods to be used by all tests here...
end
================================================
FILE: backend/vendor/.keep
================================================
================================================
FILE: docker-compose.yml
================================================
version: '3'
services:
db:
container_name: postgres
image: postgres:11
volumes:
- ./tmp/db:/var/lib/postgresql/data
environment:
POSTGRES_HOST_AUTH_METHOD: trust
backend:
container_name: backend
platform: linux/amd64
build: ./backend
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- ./backend:/myapp/backend
depends_on:
- db
frontend:
container_name: frontend
platform: linux/amd64
image: "node:14-alpine"
user: "node"
working_dir: /myapp/frontend
volumes:
- ./frontend:/myapp/frontend
command: "yarn dev"
depends_on:
- backend
yaichi:
container_name: yaichi
platform: linux/amd64
image: mtsmfm/yaichi:1.5.0
ports:
- 80:3000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
================================================
FILE: frontend/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
================================================
FILE: frontend/jest.config.js
================================================
module.exports = {
"roots": [
"./src"
],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
],
moduleNameMapper: {
'\\.(css)$': '<rootDir>/src/__tests__/styleMock.js',
},
}
================================================
FILE: frontend/package.json
================================================
{
"name": "frontend",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"build": "webpack --mode production",
"dev": "webpack-dev-server",
"test": "jest",
"typecheck": "tsc -p . --noEmit"
},
"devDependencies": {
"@types/jest": "^27.5.0",
"@types/react": "^17.0.40",
"@types/react-dom": "^17.0.11",
"css-loader": "^3.5.3",
"html-webpack-plugin": "^4.5.2",
"jest": "^26.6.3",
"style-loader": "^1.2.1",
"ts-jest": "^26.5.6",
"ts-loader": "^7.0.5",
"typescript": "^4.6.4",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^4.7.4"
},
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}
================================================
FILE: frontend/src/App.css
================================================
.App {
text-align: center;
}
.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 40vmin;
pointer-events: none;
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
================================================
FILE: frontend/src/App.tsx
================================================
import React from 'react';
import './App.css';
const BACKEND_API_URL = process.env.BACKEND_API_URL || 'http://backend.localhost';
const fetchContent = async (updateContent: (content: string) => void) => {
const response = await fetch(`${BACKEND_API_URL}/greetings/hello`,{
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
});
const data = await response.json();
updateContent(data.content);
};
const App: React.FC = () => {
const [content, updateContent] = React.useState('Waiting for a response from Rails...');
React.useEffect(() => {
fetchContent(updateContent);
}, []);
return (
<div className="App">
<header className="App-header">
<p>
{content}
</p>
</header>
</div>
);
}
export default App;
================================================
FILE: frontend/src/__tests__/App.test.tsx
================================================
import React from 'react';
import ReactDOM from 'react-dom';
import App from '../App';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
================================================
FILE: frontend/src/__tests__/styleMock.js
================================================
module.exports = {};
================================================
FILE: frontend/src/index.css
================================================
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
================================================
FILE: frontend/src/index.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>
================================================
FILE: frontend/src/index.tsx
================================================
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
ReactDOM.render(<App />, document.getElementById('root'));
================================================
FILE: frontend/tsconfig.json
================================================
{
"compilerOptions": {
"target": "es2019",
"module": "esnext",
"moduleResolution": "node",
"jsx": "react",
"strict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
}
}
================================================
FILE: frontend/webpack.config.js
================================================
const path = require("path");
const HTMLPlugin = require("html-webpack-plugin");
module.exports = {
module: {
rules: [
{
test: /\.tsx?$/,
use: {
loader: "ts-loader",
options: {
transpileOnly: true,
},
},
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"]
},
],
},
resolve: {
extensions: [".js", ".ts", ".tsx", ".json", ".mjs", ".wasm"],
},
plugins: [
new HTMLPlugin({
template: path.join(__dirname, "src/index.html"),
}),
],
devServer: {
host: '0.0.0.0',
port: 3000,
disableHostCheck: true,
},
};
gitextract_vbzc0pcq/
├── .gitattributes
├── .github/
│ ├── dependabot.yml
│ └── workflows/
│ ├── backend_test.yml
│ └── frontend_test.yml
├── .gitignore
├── README.md
├── backend/
│ ├── .gitignore
│ ├── .ruby-version
│ ├── Dockerfile
│ ├── Gemfile
│ ├── LICENSE
│ ├── README.md
│ ├── Rakefile
│ ├── app/
│ │ ├── assets/
│ │ │ ├── config/
│ │ │ │ └── manifest.js
│ │ │ ├── images/
│ │ │ │ └── .keep
│ │ │ ├── javascripts/
│ │ │ │ ├── application.js
│ │ │ │ ├── cable.js
│ │ │ │ └── channels/
│ │ │ │ └── .keep
│ │ │ └── stylesheets/
│ │ │ └── application.css
│ │ ├── channels/
│ │ │ └── application_cable/
│ │ │ ├── channel.rb
│ │ │ └── connection.rb
│ │ ├── controllers/
│ │ │ ├── application_controller.rb
│ │ │ ├── concerns/
│ │ │ │ └── .keep
│ │ │ └── greetings_controller.rb
│ │ ├── helpers/
│ │ │ └── application_helper.rb
│ │ ├── jobs/
│ │ │ └── application_job.rb
│ │ ├── mailers/
│ │ │ └── application_mailer.rb
│ │ ├── models/
│ │ │ ├── application_record.rb
│ │ │ └── concerns/
│ │ │ └── .keep
│ │ └── views/
│ │ └── layouts/
│ │ ├── application.html.erb
│ │ ├── mailer.html.erb
│ │ └── mailer.text.erb
│ ├── bin/
│ │ ├── bundle
│ │ ├── rails
│ │ ├── rake
│ │ ├── setup
│ │ ├── spring
│ │ ├── update
│ │ └── yarn
│ ├── config/
│ │ ├── application.rb
│ │ ├── boot.rb
│ │ ├── cable.yml
│ │ ├── credentials.yml.enc
│ │ ├── database.yml
│ │ ├── environment.rb
│ │ ├── environments/
│ │ │ ├── development.rb
│ │ │ ├── production.rb
│ │ │ └── test.rb
│ │ ├── initializers/
│ │ │ ├── application_controller_renderer.rb
│ │ │ ├── assets.rb
│ │ │ ├── backtrace_silencers.rb
│ │ │ ├── content_security_policy.rb
│ │ │ ├── cookies_serializer.rb
│ │ │ ├── filter_parameter_logging.rb
│ │ │ ├── inflections.rb
│ │ │ ├── mime_types.rb
│ │ │ ├── new_framework_defaults_6_0.rb
│ │ │ └── wrap_parameters.rb
│ │ ├── locales/
│ │ │ └── en.yml
│ │ ├── puma.rb
│ │ ├── routes.rb
│ │ ├── spring.rb
│ │ └── storage.yml
│ ├── config.ru
│ ├── db/
│ │ ├── schema.rb
│ │ └── seeds.rb
│ ├── lib/
│ │ ├── assets/
│ │ │ └── .keep
│ │ └── tasks/
│ │ └── .keep
│ ├── log/
│ │ └── .keep
│ ├── prehook
│ ├── public/
│ │ ├── 404.html
│ │ ├── 422.html
│ │ ├── 500.html
│ │ └── robots.txt
│ ├── test/
│ │ ├── application_system_test_case.rb
│ │ ├── controllers/
│ │ │ └── .keep
│ │ ├── fixtures/
│ │ │ ├── .keep
│ │ │ └── files/
│ │ │ └── .keep
│ │ ├── helpers/
│ │ │ └── .keep
│ │ ├── integration/
│ │ │ └── .keep
│ │ ├── mailers/
│ │ │ └── .keep
│ │ ├── models/
│ │ │ └── .keep
│ │ ├── routing/
│ │ │ └── routing_test.rb
│ │ ├── system/
│ │ │ └── .keep
│ │ └── test_helper.rb
│ └── vendor/
│ └── .keep
├── docker-compose.yml
└── frontend/
├── .gitignore
├── jest.config.js
├── package.json
├── src/
│ ├── App.css
│ ├── App.tsx
│ ├── __tests__/
│ │ ├── App.test.tsx
│ │ └── styleMock.js
│ ├── index.css
│ ├── index.html
│ └── index.tsx
├── tsconfig.json
└── webpack.config.js
SYMBOL INDEX (18 symbols across 13 files)
FILE: backend/app/channels/application_cable/channel.rb
type ApplicationCable (line 1) | module ApplicationCable
class Channel (line 2) | class Channel < ActionCable::Channel::Base
FILE: backend/app/channels/application_cable/connection.rb
type ApplicationCable (line 1) | module ApplicationCable
class Connection (line 2) | class Connection < ActionCable::Connection::Base
FILE: backend/app/controllers/application_controller.rb
class ApplicationController (line 1) | class ApplicationController < ActionController::Base
FILE: backend/app/controllers/greetings_controller.rb
class GreetingsController (line 1) | class GreetingsController < ApplicationController
method hello (line 2) | def hello
FILE: backend/app/helpers/application_helper.rb
type ApplicationHelper (line 1) | module ApplicationHelper
FILE: backend/app/jobs/application_job.rb
class ApplicationJob (line 1) | class ApplicationJob < ActiveJob::Base
FILE: backend/app/mailers/application_mailer.rb
class ApplicationMailer (line 1) | class ApplicationMailer < ActionMailer::Base
FILE: backend/app/models/application_record.rb
class ApplicationRecord (line 1) | class ApplicationRecord < ActiveRecord::Base
FILE: backend/config/application.rb
type Myapp (line 9) | module Myapp
class Application (line 10) | class Application < Rails::Application
FILE: backend/test/application_system_test_case.rb
class ApplicationSystemTestCase (line 3) | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
FILE: backend/test/routing/routing_test.rb
class RoutingTest (line 1) | class RoutingTest < Minitest::Test
method test_that_application_has_correct_routes (line 4) | def test_that_application_has_correct_routes
FILE: backend/test/test_helper.rb
class ActiveSupport::TestCase (line 5) | class ActiveSupport::TestCase
FILE: frontend/src/App.tsx
constant BACKEND_API_URL (line 4) | const BACKEND_API_URL = process.env.BACKEND_API_URL || 'http://backend.l...
Condensed preview — 99 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (64K chars).
[
{
"path": ".gitattributes",
"chars": 36,
"preview": "backend/bin/* eol=lf\nprehook eol=lf\n"
},
{
"path": ".github/dependabot.yml",
"chars": 470,
"preview": "version: 2\nupdates:\n- package-ecosystem: bundler\n directory: \"/backend\"\n schedule:\n interval: daily\n time: \"20:0"
},
{
"path": ".github/workflows/backend_test.yml",
"chars": 957,
"preview": "name: Backend Test\n\non: [push]\n\njobs:\n test:\n runs-on: ubuntu-latest\n defaults:\n run:\n working-direct"
},
{
"path": ".github/workflows/frontend_test.yml",
"chars": 447,
"preview": "name: Frontend Test\n\non: [push]\n\njobs:\n test:\n runs-on: ubuntu-latest\n defaults:\n run:\n working-direc"
},
{
"path": ".gitignore",
"chars": 612,
"preview": "# See https://help.github.com/articles/ignoring-files for more about ignoring files.\n#\n# If you find yourself ignoring t"
},
{
"path": "README.md",
"chars": 2361,
"preview": "# Rails-React-TypeScript-Docker Example  { |repo| \"https://github.com/#{repo}.git\" }\n\nruby '3.3.1'\n\n# Bundle ed"
},
{
"path": "backend/LICENSE",
"chars": 1068,
"preview": "MIT License\n\nCopyright (c) 2018 Masato Ohba\n\nPermission is hereby granted, free of charge, to any person obtaining a cop"
},
{
"path": "backend/README.md",
"chars": 374,
"preview": "# README\n\nThis README would normally document whatever steps are necessary to get the\napplication up and running.\n\nThing"
},
{
"path": "backend/Rakefile",
"chars": 227,
"preview": "# Add your own tasks in files placed in lib/tasks ending in .rake,\n# for example lib/tasks/capistrano.rake, and they wil"
},
{
"path": "backend/app/assets/config/manifest.js",
"chars": 101,
"preview": "//= link_tree ../images\n//= link_directory ../javascripts .js\n//= link_directory ../stylesheets .css\n"
},
{
"path": "backend/app/assets/images/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/app/assets/javascripts/application.js",
"chars": 721,
"preview": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//"
},
{
"path": "backend/app/assets/javascripts/cable.js",
"chars": 360,
"preview": "// Action Cable provides the framework to deal with WebSockets in Rails.\n// You can generate new channels where WebSocke"
},
{
"path": "backend/app/assets/javascripts/channels/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/app/assets/stylesheets/application.css",
"chars": 709,
"preview": "/*\n * This is a manifest file that'll be compiled into application.css, which will include all the files\n * listed below"
},
{
"path": "backend/app/channels/application_cable/channel.rb",
"chars": 79,
"preview": "module ApplicationCable\n class Channel < ActionCable::Channel::Base\n end\nend\n"
},
{
"path": "backend/app/channels/application_cable/connection.rb",
"chars": 85,
"preview": "module ApplicationCable\n class Connection < ActionCable::Connection::Base\n end\nend\n"
},
{
"path": "backend/app/controllers/application_controller.rb",
"chars": 57,
"preview": "class ApplicationController < ActionController::Base\nend\n"
},
{
"path": "backend/app/controllers/concerns/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/app/controllers/greetings_controller.rb",
"chars": 121,
"preview": "class GreetingsController < ApplicationController\n def hello\n render json: { content: 'Hello from Rails' }\n end\nend"
},
{
"path": "backend/app/helpers/application_helper.rb",
"chars": 29,
"preview": "module ApplicationHelper\nend\n"
},
{
"path": "backend/app/jobs/application_job.rb",
"chars": 43,
"preview": "class ApplicationJob < ActiveJob::Base\nend\n"
},
{
"path": "backend/app/mailers/application_mailer.rb",
"chars": 102,
"preview": "class ApplicationMailer < ActionMailer::Base\n default from: 'from@example.com'\n layout 'mailer'\nend\n"
},
{
"path": "backend/app/models/application_record.rb",
"chars": 78,
"preview": "class ApplicationRecord < ActiveRecord::Base\n self.abstract_class = true\nend\n"
},
{
"path": "backend/app/models/concerns/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/app/views/layouts/application.html.erb",
"chars": 343,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <title>Myapp</title>\n <%= csrf_meta_tags %>\n <%= csp_meta_tag %>\n\n <%= styl"
},
{
"path": "backend/app/views/layouts/mailer.html.erb",
"chars": 229,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <style>\n "
},
{
"path": "backend/app/views/layouts/mailer.text.erb",
"chars": 13,
"preview": "<%= yield %>\n"
},
{
"path": "backend/bin/bundle",
"chars": 125,
"preview": "#!/usr/bin/env ruby\nENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)\nload Gem.bin_path('bundler', 'bund"
},
{
"path": "backend/bin/rails",
"chars": 182,
"preview": "#!/usr/bin/env ruby\nload File.expand_path(\"spring\", __dir__)\nAPP_PATH = File.expand_path('../config/application', __dir_"
},
{
"path": "backend/bin/rake",
"chars": 131,
"preview": "#!/usr/bin/env ruby\nload File.expand_path(\"spring\", __dir__)\nrequire_relative \"../config/boot\"\nrequire \"rake\"\nRake.appli"
},
{
"path": "backend/bin/setup",
"chars": 1068,
"preview": "#!/usr/bin/env ruby\nrequire \"fileutils\"\n\n# path to your application root.\nAPP_ROOT = File.expand_path('..', __dir__)\n\nde"
},
{
"path": "backend/bin/spring",
"chars": 492,
"preview": "#!/usr/bin/env ruby\nif !defined?(Spring) && [nil, \"development\", \"test\"].include?(ENV[\"RAILS_ENV\"])\n gem \"bundler\"\n re"
},
{
"path": "backend/bin/update",
"chars": 819,
"preview": "#!/usr/bin/env ruby\nrequire 'fileutils'\ninclude FileUtils\n\n# path to your application root.\nAPP_ROOT = File.expand_path("
},
{
"path": "backend/bin/yarn",
"chars": 521,
"preview": "#!/usr/bin/env ruby\nAPP_ROOT = File.expand_path('..', __dir__)\nDir.chdir(APP_ROOT) do\n yarn = ENV[\"PATH\"].split(File::P"
},
{
"path": "backend/config/application.rb",
"chars": 879,
"preview": "require_relative \"boot\"\n\nrequire \"rails/all\"\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited "
},
{
"path": "backend/config/boot.rb",
"chars": 207,
"preview": "ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)\n\nrequire \"bundler/setup\" # Set up gems listed in the G"
},
{
"path": "backend/config/cable.yml",
"chars": 186,
"preview": "development:\n adapter: async\n\ntest:\n adapter: test\n\nproduction:\n adapter: redis\n url: <%= ENV.fetch(\"REDIS_URL\") { \""
},
{
"path": "backend/config/credentials.yml.enc",
"chars": 464,
"preview": "MhFYHHqzWPtI+D4H1TUKngSXfC1tnHJ3ELcJPi5hDCoAQSkwNsBRJBsOfQpHmHpBP7FZscShFFJBzZhu5WI20K7eeQzIKKoID4hnT5Xxkczib1MEWaAKfEky"
},
{
"path": "backend/config/database.yml",
"chars": 3053,
"preview": "# PostgreSQL. Versions 9.1 and up are supported.\n#\n# Install the pg driver:\n# gem install pg\n# On OS X with Homebrew:\n"
},
{
"path": "backend/config/environment.rb",
"chars": 128,
"preview": "# Load the Rails application.\nrequire_relative \"application\"\n\n# Initialize the Rails application.\nRails.application.init"
},
{
"path": "backend/config/environments/development.rb",
"chars": 2772,
"preview": "require \"active_support/core_ext/integer/time\"\n\nRails.application.configure do\n # Settings specified here will take pre"
},
{
"path": "backend/config/environments/production.rb",
"chars": 5332,
"preview": "require \"active_support/core_ext/integer/time\"\n\nRails.application.configure do\n # Settings specified here will take pre"
},
{
"path": "backend/config/environments/test.rb",
"chars": 2344,
"preview": "require \"active_support/core_ext/integer/time\"\n\n# The test environment is used exclusively to run your application's\n# t"
},
{
"path": "backend/config/initializers/application_controller_renderer.rb",
"chars": 216,
"preview": "# Be sure to restart your server when you modify this file.\n\n# ActiveSupport::Reloader.to_prepare do\n# ApplicationCont"
},
{
"path": "backend/config/initializers/assets.rb",
"chars": 630,
"preview": "# Be sure to restart your server when you modify this file.\n\n# Version of your assets, change this if you want to expire"
},
{
"path": "backend/config/initializers/backtrace_silencers.rb",
"chars": 540,
"preview": "# Be sure to restart your server when you modify this file.\n\n# You can add backtrace silencers for libraries that you're"
},
{
"path": "backend/config/initializers/content_security_policy.rb",
"chars": 1412,
"preview": "# Be sure to restart your server when you modify this file.\n\n# Define an application-wide content security policy\n# For "
},
{
"path": "backend/config/initializers/cookies_serializer.rb",
"chars": 244,
"preview": "# Be sure to restart your server when you modify this file.\n\n# Specify a serializer for the signed and encrypted cookie "
},
{
"path": "backend/config/initializers/filter_parameter_logging.rb",
"chars": 260,
"preview": "# Be sure to restart your server when you modify this file.\n\n# Configure sensitive parameters which will be filtered fro"
},
{
"path": "backend/config/initializers/inflections.rb",
"chars": 647,
"preview": "# Be sure to restart your server when you modify this file.\n\n# Add new inflection rules using the following format. Infl"
},
{
"path": "backend/config/initializers/mime_types.rb",
"chars": 156,
"preview": "# Be sure to restart your server when you modify this file.\n\n# Add new mime types for use in respond_to blocks:\n# Mime::"
},
{
"path": "backend/config/initializers/new_framework_defaults_6_0.rb",
"chars": 2548,
"preview": "# Be sure to restart your server when you modify this file.\n#\n# This file contains migration options to ease your Rails "
},
{
"path": "backend/config/initializers/wrap_parameters.rb",
"chars": 485,
"preview": "# Be sure to restart your server when you modify this file.\n\n# This file contains settings for ActionController::ParamsW"
},
{
"path": "backend/config/locales/en.yml",
"chars": 849,
"preview": "# Files in the config/locales directory are used for internationalization\n# and are automatically loaded by Rails. If yo"
},
{
"path": "backend/config/puma.rb",
"chars": 1788,
"preview": "# Puma can serve each request in a thread from an internal thread pool.\n# The `threads` method setting takes two numbers"
},
{
"path": "backend/config/routes.rb",
"chars": 163,
"preview": "Rails.application.routes.draw do\n get 'greetings/hello'\n # For details on the DSL available within this file, see http"
},
{
"path": "backend/config/spring.rb",
"chars": 97,
"preview": "Spring.watch(\n \".ruby-version\",\n \".rbenv-vars\",\n \"tmp/restart.txt\",\n \"tmp/caching-dev.txt\"\n)\n"
},
{
"path": "backend/config/storage.yml",
"chars": 1093,
"preview": "test:\n service: Disk\n root: <%= Rails.root.join(\"tmp/storage\") %>\n\nlocal:\n service: Disk\n root: <%= Rails.root.join("
},
{
"path": "backend/config.ru",
"chars": 160,
"preview": "# This file is used by Rack-based servers to start the application.\n\nrequire_relative \"config/environment\"\n\nrun Rails.ap"
},
{
"path": "backend/db/schema.rb",
"chars": 868,
"preview": "# This file is auto-generated from the current state of the database. Instead\n# of editing this file, please use the mig"
},
{
"path": "backend/db/seeds.rb",
"chars": 370,
"preview": "# This file should contain all the record creation needed to seed the database with its default values.\n# The data can t"
},
{
"path": "backend/lib/assets/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/lib/tasks/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/log/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/prehook",
"chars": 146,
"preview": "#!/usr/bin/env bash\n\nif [ -e Gemfile ]; then\n bundle check || bundle install\nfi\n\nif [ -e tmp/pids/server.pid ]; then\n "
},
{
"path": "backend/public/404.html",
"chars": 1722,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <title>The page you were looking for doesn't exist (404)</title>\n <meta name=\"viewport\""
},
{
"path": "backend/public/422.html",
"chars": 1705,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <title>The change you wanted was rejected (422)</title>\n <meta name=\"viewport\" content="
},
{
"path": "backend/public/500.html",
"chars": 1635,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <title>We're sorry, but something went wrong (500)</title>\n <meta name=\"viewport\" conte"
},
{
"path": "backend/public/robots.txt",
"chars": 98,
"preview": "# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file\n"
},
{
"path": "backend/test/application_system_test_case.rb",
"chars": 157,
"preview": "require \"test_helper\"\n\nclass ApplicationSystemTestCase < ActionDispatch::SystemTestCase\n driven_by :selenium, using: :c"
},
{
"path": "backend/test/controllers/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/test/fixtures/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/test/fixtures/files/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/test/helpers/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/test/integration/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/test/mailers/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/test/models/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/test/routing/routing_test.rb",
"chars": 159,
"preview": "class RoutingTest < Minitest::Test\n include ::RouteMechanic::Testing::Methods\n\n def test_that_application_has_correct_"
},
{
"path": "backend/test/system/.keep",
"chars": 0,
"preview": ""
},
{
"path": "backend/test/test_helper.rb",
"chars": 290,
"preview": "ENV['RAILS_ENV'] ||= 'test'\nrequire_relative '../config/environment'\nrequire 'rails/test_help'\n\nclass ActiveSupport::Tes"
},
{
"path": "backend/vendor/.keep",
"chars": 0,
"preview": ""
},
{
"path": "docker-compose.yml",
"chars": 840,
"preview": "version: '3'\nservices:\n db:\n container_name: postgres\n image: postgres:11\n volumes:\n - ./tmp/db:/var/lib/"
},
{
"path": "frontend/.gitignore",
"chars": 310,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pn"
},
{
"path": "frontend/jest.config.js",
"chars": 311,
"preview": "module.exports = {\n \"roots\": [\n \"./src\"\n ],\n \"transform\": {\n \"^.+\\\\.tsx?$\": \"ts-jest\"\n },\n \"testRegex\": \"(/__"
},
{
"path": "frontend/package.json",
"chars": 733,
"preview": "{\n \"name\": \"frontend\",\n \"version\": \"1.0.0\",\n \"main\": \"index.js\",\n \"license\": \"MIT\",\n \"scripts\": {\n \"build\": \"web"
},
{
"path": "frontend/src/App.css",
"chars": 492,
"preview": ".App {\n text-align: center;\n}\n\n.App-logo {\n animation: App-logo-spin infinite 20s linear;\n height: 40vmin;\n pointer-"
},
{
"path": "frontend/src/App.tsx",
"chars": 823,
"preview": "import React from 'react';\nimport './App.css';\n\nconst BACKEND_API_URL = process.env.BACKEND_API_URL || 'http://backend.l"
},
{
"path": "frontend/src/__tests__/App.test.tsx",
"chars": 249,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from '../App';\n\nit('renders without crashing', ("
},
{
"path": "frontend/src/__tests__/styleMock.js",
"chars": 21,
"preview": "module.exports = {};\n"
},
{
"path": "frontend/src/index.css",
"chars": 366,
"preview": "body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Can"
},
{
"path": "frontend/src/index.html",
"chars": 344,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-wid"
},
{
"path": "frontend/src/index.tsx",
"chars": 168,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\n\nReactDOM.re"
},
{
"path": "frontend/tsconfig.json",
"chars": 225,
"preview": "{\n \"compilerOptions\": {\n \"target\": \"es2019\",\n \"module\": \"esnext\",\n \"moduleResolution\": \"node\",\n \"jsx\": \"rea"
},
{
"path": "frontend/webpack.config.js",
"chars": 665,
"preview": "const path = require(\"path\");\nconst HTMLPlugin = require(\"html-webpack-plugin\");\n\nmodule.exports = {\n module: {\n rul"
}
]
About this extraction
This page contains the full source code of the ohbarye/rails-react-typescript-docker-example GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 99 files (54.6 KB), approximately 17.2k tokens, and a symbol index with 18 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.