This API was created for users to search and filter Cryto Currency data provided by Shrimpy API. The data is programmed to update every 10 minutes, ensuring the users have the latest crypto currency information available. A few highlights for this application are the Circle CI, endpoints and test suite. The endpoints return paginated results and the included test suite has 100% coverage. This application was created with Ruby on Rails and is currently being auto deployed to Heroku after successfully passing Circle CI checks.
Go to Endpoints and use /coins
and coins/searches
endpoints to recieve crypto currency information.
- Fork and clone this repo
- Run
bundle install
- Run
rails db:{create,migrate,seed}
- To seed test database
- Run
rails db:seed RAILS_ENV=test
- Run
bundle exec rspec
to run the test suite
- Testing includes coverage of all endpoint with happy and sad path and edge case.
Search through the database with valid params:
- name,
- symbol,
- min_usd_price
- max_usd_price
- min_btc_price
- max_btc_price
- min_percent_change
- max_percent_change
- page
- per_page
Postman happy request to Heroku
Postman happy response
Postman sad request
Postman sad response
Returns of all crypto coins in list of 20
Postman happy request to Heroku
Postman happy response
This is version 1 of Cryptonite, for any updated versions please check back here. New versions will be linked below:
- This project allowed me to dive deep into an area that I've always been curious about, advanced search and filtering.
- Following the process of TDD allowed me to thoroughly organized my thoughts and planned out the algorithm of this project.
- To reduce the negative user experience, sad path and edge case was included and tested thoroughly. Test coverage is 100%.
- Writing the tests and using the errors to guided me on what code to write has increased my understanding in different aspects of the app that I would never have thought of.
- Reading and understanding errors
- Flow of data
- Better security
- Future implementation of caching is possible with the current setup of my application because search requests are saved into the database. Caching will optimize the performance of the application.
- Currently, the request params are being pushed to the model which compile data from the database then response back to the controller.
- I do understand that having the model compiled data from the database on every request will have a slower responsed.
- In order to increased user experience, I made sure that the app is protected against Shrimpy API failing by consuming the API and create a coin model that has attributes with the data as values.
- The database is being updated by the overwriting of data on all the coins with the help of Heroku Scheduler, set to every 10 minutes, which is designed with the limitation of Heroku storage in mind.
- For future iteration, I would implement that the data is being sort through and if there's a change in the value, then create another instance of coin. That way, I have the ability to store previous values for further algorithm research.
- With the thought of performance optimization in mind, I implemented pagination. The endpoints return 20 records per request unless params are given. The limitation on the return of records helped divide the data into smaller chunks for faster processing.
- This app data is being provided by Shrimpy.io, crypto trading and market data API.