Skip to content

Commit

Permalink
Custom to api only structure
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed Oct 29, 2018
1 parent 1d7aec5 commit 6bccd51
Show file tree
Hide file tree
Showing 36 changed files with 21 additions and 465 deletions.
20 changes: 2 additions & 18 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,9 @@ gem 'rails', '~> 5.2.0'
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# 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.5'
# gem 'jbuilder', '~> 2.5'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
Expand Down Expand Up @@ -81,21 +73,13 @@ group :development, :test do
end

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# 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', '>= 2.15', '< 4.0'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'

# mock http request
gem 'webmock', '~> 3.4', '>= 3.4.2'
gem 'codecov', :require => false
Expand Down
65 changes: 0 additions & 65 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,17 @@ GEM
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
archive-zip (0.11.0)
io-like (~> 0.3.0)
arel (9.0.0)
ast (2.4.0)
awesome_print (1.8.0)
bindex (0.5.0)
bitcoin-secp256k1 (0.4.0)
ffi (>= 1.9.10)
bootsnap (1.3.2)
msgpack (~> 1.0)
builder (3.2.3)
byebug (10.0.2)
capybara (3.7.2)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
xpath (~> 3.1)
case_transform (0.2)
activesupport
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
chromedriver-helper (2.1.0)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
ciri-crypto (0.1.1)
bitcoin-secp256k1 (~> 0.4.0)
ciri-utils (~> 0.2.0)
Expand All @@ -85,13 +70,6 @@ GEM
simplecov
url
coderay (1.1.2)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
crack (0.4.3)
safe_yaml (~> 1.0.0)
Expand All @@ -109,7 +87,6 @@ GEM
ethereum.rb (2.2)
activesupport (>= 4.0)
digest-sha3 (~> 1.1)
execjs (2.7.0)
factory_bot (4.11.1)
activesupport (>= 3.0.0)
factory_bot_rails (4.11.1)
Expand All @@ -126,11 +103,7 @@ GEM
railties (>= 5.0)
i18n (1.1.0)
concurrent-ruby (~> 1.0)
io-like (0.3.0)
jaro_winkler (1.5.1)
jbuilder (2.7.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
json (2.1.0)
jsonapi-renderer (0.2.0)
kaminari (1.1.1)
Expand Down Expand Up @@ -170,7 +143,6 @@ GEM
mini_portile2 (2.3.0)
minitest (5.11.3)
msgpack (1.2.4)
multi_json (1.13.1)
multipart-post (2.0.0)
nio4r (2.3.1)
nokogiri (1.8.5)
Expand Down Expand Up @@ -254,22 +226,7 @@ GEM
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.10.0)
ruby_dep (1.5.0)
rubyzip (1.2.2)
safe_yaml (1.0.4)
sass (3.6.0)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
selenium-webdriver (3.14.0)
childprocess (~> 0.5)
rubyzip (~> 1.2)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
Expand All @@ -289,30 +246,17 @@ GEM
sprockets (>= 3.0.0)
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
turbolinks (5.2.0)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (4.1.19)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.4.0)
url (0.3.2)
web-console (3.7.0)
actionview (>= 5.0)
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
webmock (3.4.2)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
xpath (3.1.0)
nokogiri (~> 1.8)
yard (0.9.16)
yard-activesupport-concern (0.0.1)
yard (>= 0.8)
Expand All @@ -325,11 +269,8 @@ DEPENDENCIES
awesome_print
bootsnap (>= 1.1.0)
byebug
capybara (>= 2.15, < 4.0)
chromedriver-helper
ciri-crypto (= 0.1.1)
codecov
coffee-rails (~> 4.2)
daemons (~> 1.2, >= 1.2.6)
database_cleaner
dotenv-rails
Expand All @@ -338,7 +279,6 @@ DEPENDENCIES
faraday (~> 0.15.2)
google-protobuf (~> 3.6)
health_check (~> 3.0)
jbuilder (~> 2.5)
kaminari (~> 1.1, >= 1.1.1)
listen (>= 3.0.5, < 3.2)
mina
Expand All @@ -354,15 +294,10 @@ DEPENDENCIES
ransack (~> 2.0, >= 2.0.1)
rspec-rails (~> 3.7)
rubocop (~> 0.59)
sass-rails (~> 5.0)
selenium-webdriver
simplecov
spring
spring-watcher-listen (~> 2.0.0)
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)
webmock (~> 3.4, >= 3.4.2)
yard (~> 0.9.14)
yard-activesupport-concern
Expand Down
3 changes: 0 additions & 3 deletions app/assets/config/manifest.js

This file was deleted.

Empty file removed app/assets/images/.keep
Empty file.
3 changes: 0 additions & 3 deletions app/assets/javascripts/api/blocks.coffee

This file was deleted.

3 changes: 0 additions & 3 deletions app/assets/javascripts/api/statistics.coffee

This file was deleted.

3 changes: 0 additions & 3 deletions app/assets/javascripts/api/transactions.coffee

This file was deleted.

16 changes: 0 additions & 16 deletions app/assets/javascripts/application.js

This file was deleted.

13 changes: 0 additions & 13 deletions app/assets/javascripts/cable.js

This file was deleted.

Empty file.
3 changes: 0 additions & 3 deletions app/assets/stylesheets/api/blocks.scss

This file was deleted.

3 changes: 0 additions & 3 deletions app/assets/stylesheets/api/statistics.scss

This file was deleted.

3 changes: 0 additions & 3 deletions app/assets/stylesheets/api/transactions.scss

This file was deleted.

15 changes: 0 additions & 15 deletions app/assets/stylesheets/application.css

This file was deleted.

4 changes: 0 additions & 4 deletions app/helpers/api/blocks_helper.rb

This file was deleted.

4 changes: 0 additions & 4 deletions app/helpers/api/statistics_helper.rb

This file was deleted.

4 changes: 0 additions & 4 deletions app/helpers/api/transactions_helper.rb

This file was deleted.

4 changes: 0 additions & 4 deletions app/helpers/application_helper.rb

This file was deleted.

15 changes: 0 additions & 15 deletions app/views/layouts/application.html.erb

This file was deleted.

3 changes: 0 additions & 3 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ chdir APP_ROOT do
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')

# Install JavaScript dependencies if using Yarn
# system('bin/yarn')

# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# cp 'config/database.yml.sample', 'config/database.yml'
Expand Down
3 changes: 0 additions & 3 deletions bin/update
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ chdir APP_ROOT do
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'

Expand Down
11 changes: 0 additions & 11 deletions bin/yarn

This file was deleted.

19 changes: 18 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
require_relative 'boot'

require 'rails/all'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/engine"
# require "sprockets/railtie"
require "rails/test_unit/railtie"


# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Expand All @@ -16,6 +28,11 @@ class Application < Rails::Application
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.

# Only loads a smaller set of middleware suitable for API only apps.
# Middleware like session, flash, cookies can be added back manually.
# Skip views, helpers and assets when generating a new resource.
config.api_only = true

# cors config
config.middleware.insert_before 0, Rack::Cors do
allow do
Expand Down
3 changes: 1 addition & 2 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
task :setup do
# command %{rbenv install 2.3.0 --skip-existing}
command %[touch "#{fetch(:shared_path)}/config/puma.rb"]
command %[touch "#{fetch(:shared_path)}/config/master.key"]
command %[touch "#{fetch(:shared_path)}/.env.local"]
comment color_str("Be sure to edit config files")
end
Expand All @@ -79,7 +78,7 @@
invoke :'deploy:link_shared_paths'
invoke :'bundle:install'
invoke :'rails:db_migrate'
invoke :'rails:assets_precompile'
# invoke :'rails:assets_precompile'
invoke :'deploy:cleanup'

on :launch do
Expand Down
Loading

0 comments on commit 6bccd51

Please sign in to comment.