The main goals for this exercise are:
- Implement a connection between a Ruby on Rails back-end and ReactJS front-end.
- Understand the pros and cons of different approaches of connecting Ruby on Rails back-end with ReactJS front-end.
In this project, only the Ruby on Rails back-end part was implemented. The front-end part of the project can be found in this repo.
- Ruby on Rails
- PostgreSQL
- VisualStudio Code, Git, & GitHub
- Ruby (v. 3.0.1)
- Rails (v. 6.1.4)
- NodeJs (v. 14.17)
- YarnJs (v. 1.22.10)
- PostgreSQL (v. 12.8)
- 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-back-end.git
- Now that you have already cloned the repo run the following commands to get the project up and running:
cd hello-rails-back-end
bundle
rails db:create
rails db:migrate
rails db:seed
- Now, on your terminal, run:
rails server
This should start your local server in http://localhost:4200/. Now, you 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 | /greetings |
GET | { "Accept": "application/json", "Content-Type": "application/json" } |
To stop the server, hit <CTRL> + C
on your keyboard.
You can also find an API-consumer built with ReactJS in this repo that will display one random greeting message in your browser.
👤 Ê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.