๐Ÿ“ฆ tomcartwrightuk / fx-you-might-like

An exchange rate query tool

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching
๐Ÿ“ฅ Clone https://github.com/tomcartwrightuk/fx-you-might-like.git
HTTPS git clone https://github.com/tomcartwrightuk/fx-you-might-like.git
SSH git clone git@github.com:tomcartwrightuk/fx-you-might-like.git
CLI gh repo clone tomcartwrightuk/fx-you-might-like
Tom Cartwright Tom Cartwright Update ecb url 06730c3 8 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ app
๐Ÿ“ bin
๐Ÿ“ config
๐Ÿ“ db
๐Ÿ“ lib
๐Ÿ“ log
๐Ÿ“ public
๐Ÿ“ spec
๐Ÿ“ vendor
๐Ÿ“„ .gitignore
๐Ÿ“„ config.ru
๐Ÿ“„ Gemfile
๐Ÿ“„ Gemfile.lock
๐Ÿ“„ Rakefile
๐Ÿ“„ Readme.md
๐Ÿ“„ README.md

Fx-you-might-like

Given the state the money markets of late, I can't guarantee you will experience positive feelings from the results returned from this exchange query tool. But here it none-the-less.

To use

With ruby installed run

bundle install

To import rates:

rake import_rates

To start server:

rails s

Architecture

Given the cyclic nature of application architecture trends, the simple monolith is probably due a renaissance soon. With that in mind, this app is ahead of the curve, architected as a simple rails monolith. Reusable Fx library functions are located in the /lib folder and they work by querying a store object. In this case, an ActiveRecord model takes the store role. Controllers and views follow the Rails Wayโ„ข.

Things I would do with more time

Utilise rails models to make form handling more idiomatic - use the form_for helpers Luke.

Collaborator tests: the tests for the Fx lib are unit tested but the touch points are untested so apis could drift and tests would not pick up that.

Handling errors better - no attempt was made to handle network errors or parsing errors properly.

Fx::ExchangeRate should capture the ActiveRecord::RecordNotFound exception and raise an exception of it's own to complete the API. Or return a NoRate object for null object pattern goodness.

A nicer UI