Postgresql development package
Macs OSX (with home brew)
brew install postgresql
Linux
yum install postgresql-devel
Windows
nope, sorry ¯\_(ツ)_/¯
Build a service that stores a number of palindromes. A palindrome is a word or phrase string that reads the same backwards as forwards, independent of spaces and punctuation. An example could be 'Dammit I'm Mad'. The service has a simple REST interface that presents two endpoints:
-
An endpoint that accepts a string parameter, that will return true if the string is palindrome (and false otherwise).
-
An endpoint that returns a list of the last 10 palindromes the system has received in the last 10 minutes.
The project was written in Ruby on Rails following a TDD approach. This was a fun project that consolidated some of my rails knowledge. With more time I would like to work on extending this project to add user authentication so that users can read, update and delete their palindromes when logged in. A more exciting front-end built using a library like react.js, would also improve this web app.
First clone this repo. Then:
bundle install
# assuming your postgres instance is running
bin/rails db:create
bin/rails db:migrate
bundle exec rspec # Run the tests to ensure it works
bin/rails server # Start the server at localhost:3000
Palindrome successfully saved in database:
Error when user tries to add string that is not a palindrome:
Passing rspec tests:


