- About Project
- Built With
- Tech Stack
- Key Features
- Getting Started
- Usage
- Tests
- Author
- Future Features
- Contributing
- Show your support
- Acknowledgements
- License
The "Hello Rails" app is a Rails API that fetches a random greeting from a PostgreSQL database, demonstrating basic Rails API development. For a practical application, the "Hello React" app consumes this API to display greetings, showcasing a full-stack integration with React, Vite, and TailwindCSS.
See the "Hello React" app in action here.
- Ruby on Rails
- PostgreSQL
- Ruby: V3.2.2
- Rails: V7.1
- Database: PostgreSQL
- API endpoint to fetch a random greeting
- PostgreSQL database integration
- Simple and clean codebase focusing on RESTful API design
- Ruby
- Rails
- PostgreSQL
- Clone this repository
git clone https://github.com/lily4178993/hello-rails-back-end.git
cd hello-rails-back-end
- Check your Ruby version
ruby -v
- Install dependencies
bundle install
- Update your database informations
Go to
config/database.yml
. Replaceyour_postgres_username
andyour_postgres_password
with your database informationsdefault: &default adapter: postgresql encoding: unicode pool: 5 username: [your_postgres_username] password: [your_postgres_password] host: localhost development: <<: *default database: [your_database_for_development] test: <<: *default database: [your_database_for_test] production: <<: *default database: [your_database_for_production]
Populate greetings data in the database by running the following commands:
rails db:create
rails db:migrate
rails db:seed
To start the server, run:
rails s
Navigate to http://localhost:3000/api/v1/greeting
to see the API in action, returning a random greeting.
To run the test suite, execute the following commands:
rails db:migrate RAILS_ENV=test
rspec
- Nelly Telli - @lily4178993
- Extend the API to include more diverse greetings
- Implement other operations (e.g., adding or removing greetings)
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if this project helped you!
- Ruby on Rails Community
- PostgreSQL Team
- Microverse
This project is MIT licensed.