This project is a Rails API application that provides a server API for the [Hello Rails Front-End]. The API provides a single endpoint that returns a random greeting from the database.
- Create a Rails API app called 'hello-rails-back-end'.
- Initialize the project with Git.
- Set up a Postgres database and create a table for storing messages.
- Populate the table with 5 different greetings.
- Create an API endpoint that selects a random greeting from the table.
Here is the link to the Hello Rails Front-Endrepository.
- Ruby on Rails framework
-
Use Linters to check code quality
- Rubocop
- MVC architectural/design pattern
- Data persistent in PostgreSQL
- RESTful API
- GET /api/v2/greetings/random
- Returns a random greeting from the database.
To get the project up and running on your local machine, follow these steps.
Before you begin, make sure you have the following prerequisites installed on your system:
- Ruby: You need Ruby to run the Rails application.
- Bundler: Bundler is used to manage gem dependencies in your Ruby project.
- Postgres: You need Postgres as the database for the Rails app.
Clone this repository to your desired folder:
git clone https://github.com/NoelLincoln/hello-rails-back-end.git
cd hello-rails-back-end
Install gem dependencies:
bundle install
Set up the database:
rails db:create
rails db:migrate
rails db:seed
To run the project, execute the following command:
rails server
The API will be accessible at ``.
π€ Noel Bryant
- GitHub: @NoelLincoln
- Twitter: @Noel_Lincoln
Upcoming improvements:
- Add the endpoints to create, update and delete a greeting
- Deploy the application
Find a bug or have a feature request? Open a new issue here on GitHub.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
If you find this project helpful, please consider starring the repository. Your support is greatly appreciated!
This project is MIT licensed.