Skip to content

Commit

Permalink
xtended boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
itsazzad committed Apr 6, 2021
1 parent 400ea72 commit e1fb365
Show file tree
Hide file tree
Showing 58 changed files with 8,393 additions and 421 deletions.
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defaults
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.DS_Store
.bin
.git
.gitignore
.bundleignore
.bundle
.byebug_history
.rspec
tmp
log
test
config/deploy
public/packs
public/packs-test
node_modules
yarn-error.log
coverage/
.env
21 changes: 21 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
DEFAULT_URL=0.0.0.0:3000
CLIENT_URL=0.0.0.0:8000
WEB_CONCURRENCY=2
RAILS_MAX_THREADS=5
ADMIN_EMAIL=demo@zauberware.com
ADMIN_PASSWORD=demo1234
ADMIN_FIRST_NAME=John
ADMIN_LAST_NAME=Doe
DEVISE_SECRET_KEY=replace-this-key-with-a-secret
DEVISE_MAILER_FROM=test@domain.com
IS_HTTP_AUTH_PROTECTED=false
HTTP_AUTH_USER=demo
HTTP_AUTH_PASSWORD=demo1234
SMTP_ADDRESS=
SMTP_PORT=
SMTP_DOMAIN=
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_AUTH=login
SMTP_ENABLE_STARTTLS_AUTO=true
RACK_ATTACK_ENABLED=false
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,24 @@ coverage
/storage/*
!/storage/.keep

/node_modules
/yarn-error.log

/public/assets
.byebug_history

# Ignore master key for decrypting credentials and more.
/config/master.key

.env
yarn-debug.log*
.yarn-integrity
.env
.env.*

dump.rdb
dump.rdb
/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.5
2.6.6
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ruby:2.6

ENV BUNDLER_VERSION=2.1.4

RUN apt-get update -qq && apt-get install -y nodejs postgresql-client npm
RUN npm install -g npm@latest
RUN npm install --global yarn

RUN gem install bundler -v 2.1.4

WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock

RUN bundle check || bundle install
COPY . /myapp

# Add a script to be executed every time the container starts.
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 3000

# Configure the main process to run when running the image
CMD ["rails", "server", "-b", "0.0.0.0"]
9 changes: 7 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.5'
ruby '2.6.6'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3'
Expand Down Expand Up @@ -32,7 +32,7 @@ gem 'rails-i18n', '~> 6.0.0'
gem 'devise-i18n' # Install default translations
gem 'rails_admin-i18n' # Use default rails_admin translations

# gem 'graphiql-rails', group: :development
gem 'graphiql-rails', group: :development

# Use Puma as the app server
gem 'puma', '~> 3.12'
Expand Down Expand Up @@ -87,3 +87,8 @@ group :development do
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

gem "react_on_rails", "12.2.0" # Update to the current version
gem "webpacker", "~> 5"

gem 'mini_racer', platforms: :ruby
36 changes: 34 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ GEM
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
annotate (3.1.1)
activerecord (>= 3.2, < 7.0)
rake (>= 10.4, < 14.0)
Expand All @@ -83,6 +85,7 @@ GEM
byebug (11.1.3)
cancancan (3.1.0)
concurrent-ruby (1.1.7)
connection_pool (2.2.3)
crass (1.0.6)
database_cleaner (1.8.5)
devise (4.7.2)
Expand All @@ -103,6 +106,7 @@ GEM
dotenv (= 2.7.6)
railties (>= 3.2)
erubi (1.9.0)
execjs (2.7.0)
factory_bot (6.1.0)
activesupport (>= 5.0.0)
factory_bot_rails (6.1.0)
Expand All @@ -116,6 +120,9 @@ GEM
activerecord (>= 4.0.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
graphiql-rails (1.7.0)
railties
sprockets-rails
graphql (1.11.4)
graphql-errors (0.4.0)
graphql (>= 1.6.0, < 2)
Expand Down Expand Up @@ -150,6 +157,7 @@ GEM
activerecord
kaminari-core (= 1.2.1)
kaminari-core (1.2.1)
libv8 (8.4.255.0-x86_64-linux)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand All @@ -162,10 +170,14 @@ GEM
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (1.0.0)
mimemagic (0.3.5)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
mini_magick (4.10.1)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
mini_racer (0.3.1)
libv8 (~> 8.4.255)
minitest (5.14.2)
msgpack (1.3.3)
nested_form (0.3.2)
Expand All @@ -177,6 +189,7 @@ GEM
parser (2.7.1.4)
ast (~> 2.4.1)
pg (1.2.3)
public_suffix (4.0.6)
puma (3.12.6)
rack (2.2.3)
rack-attack (6.3.1)
Expand All @@ -186,6 +199,8 @@ GEM
rack-pjax (1.1.0)
nokogiri (~> 1.5)
rack (>= 1.1)
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.3.3)
Expand Down Expand Up @@ -239,6 +254,13 @@ GEM
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
react_on_rails (12.2.0)
addressable
connection_pool
execjs (~> 2.5)
rails (>= 3.2)
rainbow (~> 3.0)
webpacker (>= 4.0)
regexp_parser (1.7.1)
remotipart (1.4.4)
responders (3.0.1)
Expand Down Expand Up @@ -298,6 +320,7 @@ GEM
search_object_graphql (0.3.2)
graphql (~> 1.8)
search_object (~> 1.2.2)
semantic_range (3.0.0)
shoulda-matchers (4.0.0.rc1)
activesupport (>= 4.2.0)
simplecov (0.19.0)
Expand Down Expand Up @@ -325,6 +348,11 @@ GEM
unicode-display_width (1.7.0)
warden (1.2.9)
rack (>= 2.0.9)
webpacker (5.2.1)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -349,13 +377,15 @@ DEPENDENCIES
faker (~> 1.8)
foreman
friendly_id (= 5.3.0)
graphiql-rails
graphql (~> 1.11.4)
graphql-auth!
graphql-errors
i18n-spec
image_processing (~> 1.2)
listen (>= 3.0.5, < 3.2)
mini_magick
mini_racer
pg
puma (~> 3.12)
rack-attack
Expand All @@ -365,6 +395,7 @@ DEPENDENCIES
rails-i18n (~> 6.0.0)
rails_admin (~> 2.0.2)
rails_admin-i18n
react_on_rails (= 12.2.0)
rspec-rails (~> 3.8)
rubocop
rubocop-performance
Expand All @@ -376,9 +407,10 @@ DEPENDENCIES
spring
spring-watcher-listen (~> 2.0.0)
timecop
webpacker (~> 5)

RUBY VERSION
ruby 2.6.5p114
ruby 2.6.6

BUNDLED WITH
2.1.4
22 changes: 2 additions & 20 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
MIT License
License

Copyright (c) 2019 zauberware technologies

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.
Copyright (c) 2021 My Company
9 changes: 9 additions & 0 deletions Procfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# You can run these commands in separate shells
web: rails s -p 3000

# Next line runs a watch process with webpack to compile the changed files.
# When making frequent changes to client side assets, you will prefer building webpack assets
# upon saving rather than when you refresh your browser page.
# Note, if using React on Rails localization you will need to run
# `bundle exec rake react_on_rails:locale` before you run bin/webpack
client: sh -c 'rm -rf public/packs/* || true && bin/webpack -w'
26 changes: 26 additions & 0 deletions Procfile.dev-hmr
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Procfile for development using HMR

web: rails s -p 3000

# Note, hot and live reloading don't work with the default generator setup on
# top of the rails/webpacker Webpack config with server rendering.
# If you have server rendering enabled (prerender is true), you either need to
# a. Ensure that you have dev_server.hmr and dev_server.inline BOTH set to false,
# and you have this option in your config/initializers/react_on_rails.rb:
# config.same_bundle_for_client_and_server = true
# If you have either config/webpacker.yml option set to true, you'll see errors like
# "ReferenceError: window is not defined" (if hmr is true)
# "TypeError: Cannot read property 'prototype' of undefined" (if inline is true)
# b. Skip using the webpack-dev-server. bin/webpack --watch is typically
fast enough.
# c. See the React on Rails README for a link to documentation for how to setup
# SSR with HMR and React hot loading using the webpack-dev-server only for the
# client bundles and a static file for the server bundle.

# Run the webpack-dev-server for client and maybe server files
webpack-dev-server: bin/webpack-dev-server

# Keep the JS fresh for server rendering. Remove if not server rendering.
# Especially if you have not configured generation of a server bundle without a hash.
# as that will conflict with the manifest created by the bin/webpack-dev-server
# rails-server-assets: SERVER_BUNDLE_ONLY=yes bin/webpack --watch
Loading

0 comments on commit e1fb365

Please sign in to comment.