All Projects → giannisp → Rails React Boilerplate

giannisp / Rails React Boilerplate

Licence: mit
Ruby on Rails, React, Webpack 4 boilerplate app.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Rails React Boilerplate

Niklick
Rails Versioned API solution template for hipsters! (Ruby, Ruby on Rails, REST API, GraphQL, Docker, RSpec, Devise, Postgress DB)
Stars: ✭ 39 (-54.65%)
Mutual labels:  rails, ruby-on-rails, boilerplate
Furatto Rails Start Kit
A rails app with Furatto, Devise, and Facebook Authentication perfect for hackathons!
Stars: ✭ 46 (-46.51%)
Mutual labels:  rails, boilerplate
Drag and drop active storage
A demo drag and drop image upldate Ruby on Rails app using Stimulus.js, DropZone.js, and ActiveStorage
Stars: ✭ 46 (-46.51%)
Mutual labels:  rails, ruby-on-rails
Graphjin
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
Stars: ✭ 1,264 (+1369.77%)
Mutual labels:  rails, ruby-on-rails
Stimulus reflex expo
StimulusReflex demos
Stars: ✭ 85 (-1.16%)
Mutual labels:  rails, ruby-on-rails
Tris Webpack Boilerplate
A Webpack boilerplate for static websites that has all the necessary modern tools and optimizations built-in. Score a perfect 10/10 on performance.
Stars: ✭ 1,016 (+1081.4%)
Mutual labels:  webpack4, boilerplate
Jsonapi parameters
Rails-way to consume JSON:API input
Stars: ✭ 50 (-41.86%)
Mutual labels:  rails, ruby-on-rails
Activeadmin froala editor
Froala WYSIWYG editor for ActiveAdmin
Stars: ✭ 30 (-65.12%)
Mutual labels:  rails, ruby-on-rails
Ifme
Free, open source mental health communication web app to share experiences with loved ones
Stars: ✭ 1,147 (+1233.72%)
Mutual labels:  rails, ruby-on-rails
Execution time
How fast is your code? See it directly in Rails console.
Stars: ✭ 67 (-22.09%)
Mutual labels:  rails, ruby-on-rails
Rails Security Checklist
🔑 Community-driven Rails Security Checklist (see our GitHub Issues for the newest checks that aren't yet in the README)
Stars: ✭ 1,265 (+1370.93%)
Mutual labels:  rails, ruby-on-rails
Web Extension Starter
🖥🔋Web Extension starter to build "Write Once Run on Any Browser" extension
Stars: ✭ 987 (+1047.67%)
Mutual labels:  webpack4, boilerplate
Figmagic Example
Using Figmagic (simplifying design token generation and asset extraction) with Webpack 5, React 16, Styled Components.
Stars: ✭ 37 (-56.98%)
Mutual labels:  webpack4, boilerplate
Html Sass Babel Webpack Boilerplate
Webpack 4 + Babel + ES6 + SASS + HTML Modules + Livereload
Stars: ✭ 35 (-59.3%)
Mutual labels:  webpack4, boilerplate
Bhf
Rails-Engine-Gem that offers an admin interface for trusted user
Stars: ✭ 81 (-5.81%)
Mutual labels:  rails, ruby-on-rails
Graphql Rails Generators
Graphql Rails Scaffold™. Automatically generate GraphQL types from your rails models.
Stars: ✭ 47 (-45.35%)
Mutual labels:  rails, ruby-on-rails
Leaky Gems
A list of Ruby gems that have known memory leaks (and issues)
Stars: ✭ 895 (+940.7%)
Mutual labels:  rails, ruby-on-rails
Activejob Scheduler
A background job scheduler for any queue backend
Stars: ✭ 24 (-72.09%)
Mutual labels:  rails, ruby-on-rails
Binda
Headless CMS based on Ruby on Rails
Stars: ✭ 60 (-30.23%)
Mutual labels:  rails, ruby-on-rails
Karafka
Framework for Apache Kafka based Ruby and Rails applications development.
Stars: ✭ 1,223 (+1322.09%)
Mutual labels:  rails, ruby-on-rails

rails-react-boilerplate

This is a pure Ruby on Rails / React / Webpack 4 boilerplate app.

Features

  • Ruby on Rails 6.x
  • React 16.x
  • Webpack 4.x
  • Babel 7.x
  • ESLint support
  • Prettier support
  • SASS and StyleLint support
  • Hashed filenames for production assets
  • Separate app and vendor JS bundles
  • Postgres compatibility
  • Using Rails default gems and NPM packages only

Exit Asset Pipeline, Enter Webpack

Why Webpack?
Webpack is a module bundler. It can bundle all JS files for usage in the browser, but can also transform / bundle / package any resource or frontend asset.
The NPM ecosystem is huge, and Webpack makes it available in the simplest way possible.
Webpack can support every modern JS app, using ES6 or CommonJS modules, or both, create a single or multiple bundles, and in general can be customized to accomplish any application requirement.

The frontend assets on this repository are placed on a more accessible directory, at front/js and front/css, rather than app/assets/javascripts and app/assets/stylesheets.
At any point, migration to a different backend (for example NodeJS) can be seamless since Webpack is running as a stand-alone bundler, there's absolutely no dependence to the Asset Pipeline or any other framework-specific module.

Install

It's recommended to use Ruby 2.7.1 and NodeJS 12.x.

# install bundler if not available
gem install bundler

# install gem dependencies
bundle install

# install npm dependencies
npm install

# create the postgres databases
# update config/database.yml details if needed
rake db:create

# generate assets for development
npm run webpack

# start server
rails s

Webpack scripts

npm run webpack
Builds the assets for development mode.

npm run webpack:watch
Builds the assets for development mode, and rebuilds on every detected change.

npm run webpack:production
Builds the assets for production mode, output files are hashed.

Load assets in production from a custom root directory or URL

By default JS/CSS assets are being served from the public/dist directory. However in production it may be needed to serve assets from a CDN or an S3 bucket etc.
Simply override the Rails.application.config.assets.root_path property on the production environment to accomplish it.
Of course during the deployment script and after the npm run webpack-production command, public/dist/* output files should be copied to the target dir or infrastructure.

Run in production

# build assets
npm run webpack:production

# run rails server
SECRET_KEY_BASE=abcd RAILS_SERVE_STATIC_FILES=true rails s -e production

Run in Docker (optional)

Repository contains a basic Dockerfile for running the app in production mode.
Assets should be compiled first using webpack outside of the container.

# build docker image
docker build -t rails-react-boilerplate .

# run docker image
docker run -p 3000:3000 -e SECRET_KEY_BASE=abcd rails-react-boilerplate
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].