The main goals for this exercise are:
- Implement a connection between a Ruby on Rails back-end and React front-end.
- Understand the pros and cons of different approaches of connecting Ruby on Rails back-end with React front-end.
Below, we can see a screenshot of the app.
- Ruby on Rails
- ReactJS, Redux
- VisualStudio Code, Git, & GitHub
- Ruby (v. 3.0.1)
- Rails (v. 6.1.4)
- NodeJs (v. 14.17)
- YarnJs (v. 1.22.10)
- Git
- In your terminal, in the folder of your preference, type the following bash command to clone this repository:
git clone git@github.com:enionsouza/hello-rails-react.git
- Now that you have already cloned the repo run the following commands to get the project up and running:
cd hello-rails-react
bundle
yarn
bin/rails db:create
bin/rails db:migrate
bin/rails db:seed
- Now, on your terminal, run:
bin/rails server
This should start your local server in http://localhost:3000/. Now, you can go to your browser and visit this page, and you also can open the rest API client of your choice (Thunder Client extension for VScode is recommended) to fetch a randomly selected greeting message:
Request | Endpoint | Method | Header |
---|---|---|---|
Randomly selected greeting message | /api/greetings |
GET | { "Accept": "application/json", "Content-Type": "application/json" } |
To stop the server, hit <CTRL> + C
on your keyboard.
👤 Ênio Neves de Souza
- GitHub: @enionsouza
- Twitter: @enionsouza
- LinkedIn: Enio Neves de Souza
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
This project is MIT licensed.