Skip to content

enionsouza/hello-rails-back-end

Repository files navigation

Microverse GitHub last commit (branch) GitHub Repo stars

Hello Rails (Back-End)!

About

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.

Built With

  • Ruby on Rails
  • PostgreSQL
  • VisualStudio Code, Git, & GitHub

Pre-requisites

  • Ruby (v. 3.0.1)
  • Rails (v. 6.1.4)
  • NodeJs (v. 14.17)
  • YarnJs (v. 1.22.10)
  • PostgreSQL (v. 12.8)
  • Git

Getting Started

  1. 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
  1. 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
  1. 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.

Author

👤 Ênio Neves de Souza

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

📝 License

This project is MIT licensed.