
(not maintained) React on Rails starter app - with devise_token_auth
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.
Install Ruby version 2.7.0 using RVM or RBenv:
rvm install 2.7.0
or
rbenv install 2.7.0
Set the installed Ruby version as the active version:
rvm use 2.7.0
or
rbenv local 2.7.0
Install the required gems:
bundle install
Create the database:
rails db:create
Run the database migration:
rails db:migrate
Navigate to the client directory:
cd client
Install the required packages:
yarn
Return to the previous directory:
cd ..
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
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!
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.
