Since I familiar with Rails and React I put them together in a new kind of 'Hello World!' app. This exercise is going to have you create a React front-end with a Rails back-end and connect them to display a random message.
- Implement a connection between a Ruby on Rails back-end and React front-end.
- Understand pros and cons of different approaches of connecting Ruby on Rails back-end with React front-end.
To get a local copy for this project and running follow these simple example steps.
$ npx create-react-app@latest hello-react-front-end
$ cd hello-react-front-end # Move into the application directory
$ https://github.com/sja-thedude/hello-react-front-end.git
$ cd hello-react-front-end
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
https://github.com/facebook/create-react-app/issues/11816
- heroku login
- git remote remove heroku
- heroku create sja-thedude-api
- git push heroku intgration-tests:main
- heroku run rails db:migrate
- heroku run rails db:seed
ESLint
$ npm install --save-dev eslint@7.x eslint-config-airbnb@18.x eslint-plugin-import@2.x eslint-plugin-jsx-a11y@6.x eslint-plugin-react@7.x eslint-plugin-react-hooks@4.x @babel/eslint-parser@7.x @babel/core@7.x @babel/plugin-syntax-jsx@7.x @babel/preset-react@7.x @babel/preset-react@7.x
- Stylelint package
$ npm install --save-dev stylelint@13.x stylelint-scss@3.x stylelint-config-standard@21.x stylelint-csstree-validator@1.x
- Run linter
$ npx eslint .
$ npx stylelint "**/*.{css,scss}"
- In auto-correct mode, RuboCop will try to automatically fix offenses:
$ npx eslint . --fix
$ npx stylelint "**/*.{css,scss}" --fix
This project is build with:
👤 Syeda Juveria Afreen
- GitHub: @sja-thedude
- Twitter @sja_thedude
- LinkedIn sja-thedude
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
- Credit to Gregoire Vella on Behance, the author of the original design guidelines
This project is MIT licensed.