REAL-TIME DATA OFFLINE
33 | <% end %> 34 |<%== session.delete(:success) %>
38 | <% end %> 39 | 40 | <% if session[:failure] %> 41 |<%== session.delete(:failure) %>
42 | <% end %> 43 | 44 | <%== yield %> 45 | 46 |├── .ruby-version ├── config.ru ├── data ├── cache_prices.yml ├── agreement.md ├── users_data.yml └── cache_hist.yml ├── Procfile ├── public ├── favicon.ico ├── images │ └── noisy_net_2X.png ├── javascript │ ├── input-conversion.js │ ├── jsapi.js │ └── chartkick.js └── stylesheets │ └── main.css ├── views ├── agreement.erb ├── not_found.erb ├── index.erb ├── signin.erb ├── signup.erb ├── charts.erb ├── layout.erb ├── settings.erb ├── buy.erb ├── sell.erb └── dashboard.erb ├── test ├── data │ └── users_data.yml └── cx_test.rb ├── Gemfile ├── LICENSE.md ├── Gemfile.lock ├── README.md └── cx.rb /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.3.7 2 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | require "./cx" 2 | run Sinatra::Application -------------------------------------------------------------------------------- /data/cache_prices.yml: -------------------------------------------------------------------------------- 1 | --- 2 | BTC: 3 | USD: 7032.6 4 | ETH: 5 | USD: 286.97 6 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development} 2 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YingCGooi/coin_exchange/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /views/agreement.erb: -------------------------------------------------------------------------------- 1 |
Oops! It looks like the page that you've requested is not found.
4 |Click here to return.
-------------------------------------------------------------------------------- /test/data/users_data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | admin: 3 | :password: "$2a$10$XQq2o2l8zVCndc9Ol1MpI..T9ckk2quGlRRVdXFeKJ29ySnFkkH5W" 4 | :created: '2017-11-03 22:08:11 -0500' 5 | :new_user: false 6 | :balances: 7 | :btc: 0.987 8 | :eth: 2.896 9 | :usd: 6320 10 | :transactions: [] 11 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | ruby '>= 2.3.4' 4 | 5 | gem 'sinatra' 6 | gem 'sinatra-contrib' 7 | gem 'erubis' 8 | gem 'chartkick' 9 | gem 'minitest' 10 | gem 'minitest-reporters' 11 | gem 'rack-test' 12 | gem 'bcrypt' 13 | gem 'redcarpet' 14 | gem 'pry' 15 | 16 | group :production do 17 | gem "puma" 18 | end -------------------------------------------------------------------------------- /data/agreement.md: -------------------------------------------------------------------------------- 1 | ## User Agreement 2 | This application is built for the purpose of practice. Digital currencies and USD balances in the application's account balances are not real and should not be treated seriously. 3 | 4 | This application is not intended to provide any advice on investment nor to provide any education about cryptocurrencies. 5 | 6 | If you notice any bugs, please post an issue on my [Github Issues page](https://github.com/YingCGooi/coin_exchange_web_app_project/issues). 7 | On top of all, have fun with this small application! -------------------------------------------------------------------------------- /views/index.erb: -------------------------------------------------------------------------------- 1 | 6 | 7 |Coin Exchange is a platform to easily trade bitcoin and ethereum.
11 |Updated: <%= Time.now %>
29 |Updated: <%= Time.now %>
47 |Signed in as <%=session[:signin][:username]%>
21 | <% else %> 22 | 23 | 24 | 25 | <% end %> 26 |REAL-TIME DATA OFFLINE
33 | <% end %> 34 |<%== session.delete(:success) %>
38 | <% end %> 39 | 40 | <% if session[:failure] %> 41 |<%== session.delete(:failure) %>
42 | <% end %> 43 | 44 | <%== yield %> 45 | 46 |Your USD Balance: <%= format_usd(@usd_balance) %>
32 | 33 |32 | Your <%=CURRENCY_NAMES[@coin.to_sym]%> Balance: 33 | <%=@coin_balance.round(5)%> <%=@coin.upcase%> 34 |
35 | 36 || 26 | | BALANCE | 27 |COUNTER VALUE | 28 |
|---|---|---|
| 32 | <%= CURRENCY_NAMES[symbol] %> 33 | | 34 |35 | <%= balance.round(5) %> <%= symbol.upcase %> 36 | | 37 |38 | <%= format_usd(balance * @counter_values[symbol]) %> 39 | | 40 |
|
55 | <%= trx.type.capitalize %> <%= CURRENCY_NAMES[trx.coin.to_sym.downcase] %> 56 | <% if trx.type != :deposit %> 57 | @<%= format_usd(trx.price) %> per coin 58 | <% end %> 59 | |
60 |
61 | <%= trx.coin_amount %> <%= trx.coin.upcase %> 62 | 63 | <%= format_usd(trx.usd_amount) %> 64 | 65 | |
66 |
67 |
68 | <%= trx.time.strftime('%l:%M %p') %> 69 | <%= trx.time.strftime('%b %d, %Y') %> 70 | |
71 |