Crypto-Things / cryptonite

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 deploy to Heroku after successfully pass Circle CI check.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cryptonite

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.

Authors

Summary

Getting Started

For Using Endpoints

Go to Endpoints and use /coins and coins/searches endpoints to recieve crypto currency information.

Gemfile

fj-gemfile

Installing

  • 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

Running the tests

  • bundle exec rspec to run the test suite

Sample of Tests Across the App

  • Testing includes coverage of all endpoint with happy and sad path and edge case.

Search Happy Path

Search happy path

Search Sad Path

Search sad path

Search pagination

Search pagination

Search pagination sad path and edge case

Search sad path and edge case

Endpoints

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 request

Postman happy response

Postman response

Postman sad request

Postman sad request

Postman sad response

Postman sad response

Returns of all crypto coins in list of 20

Postman happy request to Heroku

coins happy path

Postman happy response

happy response

Built With

circleci heroku postgresql rails ruby

Versioning

This is version 1 of Cryptonite, for any updated versions please check back here. New versions will be linked below:

Reflection

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

Acknowledgement

  • This app data is being provided by Shrimpy.io, crypto trading and market data API.

About

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 deploy to Heroku after successfully pass Circle CI check.


Languages

Language:Ruby 50.3%Language:HTML 49.7%