This README would normally document whatever steps are necessary to get the application up and running.
Tutorial for React front end with Rails API
Link for tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-ruby-on-rails-project-with-a-react-frontend#step-7-%E2%80%94-viewing-recipes
-
Ruby version
2.6.0
-
Rails version
6.0.0
-
System dependencies Yarn Package manager PostgreSQL
-
Configuration
bundle install
yarn install
-
Database creation
rails db:create db:migrate db:seed
-
Run app with
rails s
-
Address below in browser to view application http:localhost:3000/
-
Conclusion This tutorial helps highlight the power and efficiency of a Ruby on Rails API. The API portion of the tutorial is very short and quick. With minimal code and setup, Rails spits out JSON, allows objects to be saved into the database and uses token authorisation to verify requests. The React code on the other hand is long and constantly repeats itself. Components are over 100 lines of code where this could be handled with classic Rails Views in smaller bites and in a dryer fashion.
But all in all the tutorial was outstanding and helped my see and understand how React and Rails can work together.