Rails React DTA Template

screenshot of Rails React DTA Template

(not maintained) React on Rails starter app - with devise_token_auth

Overview

The Rails, React & devise_token_auth template is a preconfigured starter app that serves as a nice starting point for developers looking to build their next app. It comes with devise_token_auth, an authentication solution, set up for user accounts. Additionally, it includes a deployment configuration for Heroku and various other boilerplate code. The project is available under the MIT License.

Features

  • Preconfigured starter app with devise_token_auth setup for user accounts
  • Deployment configuration for Heroku
  • Various other boilerplate code

Config Backend

  1. Install Ruby version 2.7.0 using RVM or RBenv:

    rvm install 2.7.0
    

    or

    rbenv install 2.7.0
    
  2. Set the installed Ruby version as the active version:

    rvm use 2.7.0
    

    or

    rbenv local 2.7.0
    
  3. Install the required gems:

    bundle install
    
  4. Create the database:

    rails db:create
    
  5. Run the database migration:

    rails db:migrate
    

Frontend

  1. Navigate to the client directory:

    cd client
    
  2. Install the required packages:

    yarn
    
  3. Return to the previous directory:

    cd ..
    

Starting the Development Server

If you don't have foreman installed, run the following command to install it:

gem install foreman

To start the development server, run the following command:

foreman start -f Procfile.dev

If foreman exits without killing ports 3000/3001, run the following command to kill them:

lsof -ti:3000 | xargs kill

Deployment Instructions (For Heroku)

If you don't have Heroku CLI installed, run the following command to install it:

npm install -g heroku

To login to your Heroku account, run the following command:

heroku login

Create a new Heroku app:

heroku apps:create

Add the necessary buildpacks for Node.js and Ruby:

heroku buildpacks:add heroku/nodejs --index 1
heroku buildpacks:add heroku/ruby --index 2

Initialize a new Git repository:

git init

Add all the files to the repository:

git add .

Commit the changes before deployment:

git commit -m "commit changes before deployment"

Push the code to your Heroku app:

git push heroku master

Run the database migration on Heroku:

heroku run rake db:migrate

Visit your deployed app and enjoy!

Summary

The Rails, React & devise_token_auth template provides developers with a preconfigured starter app that includes devise_token_auth for easy user account authentication. It also comes with deployment configurations for Heroku and other essential boilerplate code. By following the installation guide, users can quickly set up this template and start building their next app.