https://github.com/iphytech/btc_calculator
A simple BTC to NGN calculator built with ruby and graphql.
https://github.com/iphytech/btc_calculator
btc gr ngn ru ruby
Last synced: 3 months ago
JSON representation
A simple BTC to NGN calculator built with ruby and graphql.
- Host: GitHub
- URL: https://github.com/iphytech/btc_calculator
- Owner: Iphytech
- Created: 2020-03-09T18:18:17.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T17:49:08.000Z (over 2 years ago)
- Last Synced: 2025-01-10T01:00:00.709Z (4 months ago)
- Topics: btc, gr, ngn, ru, ruby
- Language: Ruby
- Homepage: https://btc-simply.herokuapp.com/graphiql
- Size: 1.19 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How to use
Clone the repo `https://github.com/Iphytech/btc_calculator.git` to your computer
change to the project directory
NB: There is no database (because we ain't going to make use of it).
go to the terminal and run `bundle or bundle install`
We are making use of `Net::HTTP ` for the restful api calls - Read more about it here (https://apidock.com/ruby/Net/HTTP)
And we are consuming data from `Coindesk APi endpoint`
Start the project and test what we have built
```bash
rails s or rails server
```
Then open your browser and type `http://localhost:3000/graphiql`
sample request
```bash {
calculatePrice(
type: "sell"
margin: 0.1
exchangeRate: 370.0
) {
price
}
}```
sample response
```bash
{
"data": {
"calculatePrice": {
"price": 2937074.4355499996
}
}
}
```NB: If you encounter this error message when serving the app `Your Yarn packages are out of date!`
Please run `yarn install --check-files` to update.