Coder Social home page Coder Social logo

yingcgooi / coin_exchange Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 8.0 317 KB

A digital currency exchange app. Allows users to buy/sell mock digital currencies with virtual money. Back-end built with Sinatra framework. Dynamic inputs implemented using jQuery.

Home Page: https://coin-exchange-sinatra.herokuapp.com/

License: MIT License

Ruby 26.43% JavaScript 53.21% HTML 11.92% CSS 8.44%
sinatra ruby api jquery erb html css

coin_exchange's Introduction

Coin Exchange Web Application

coin exchange dashboard

A mock digital currency exchange platform which allows users to buy and sell Bitcoin and Ethereum based on actual real-time market price. This web application is built with Sinatra Ruby framework. Features inspired by Coinbase exchange.

This app is deployed in Heroku: https://coin-exchange-sinatra.herokuapp.com/

The goal of creating this application to practice translating high-level requirements into working code, integrating third-party web APIs and translating them into user-friendly interfaces and charts. Dynamic input forms were rendered through the use of jQuery. Performance bottlenecks such as slow loading speed were addressed.

Installation

Clone or download this git repository. Within the terminal opening the root of this project, execute the following line to install dependencies:

bundle install

Usage

To run the server locally, execute:

bundle exec ruby cx.rb

Once Sinatra is running in the background, open up a web browser and enter localhost:4567 in the URL address bar to begin.

API Utilization

Third-party APIs are used to integrate real-time BTC and ETH prices into the application and to display a 30-day BTC and ETH chart.

Offline Mode

In the case where the application fails to fetch real-time data, the last retrieved price data will be used. This will apply to buy/sell prices as well as historical chart data. It is possible to run the application entirely off-line. For the best user experience, it is recommended that you have an active Internet connection.

Sign-up Bonus

User will receive a sign-up bonus funding of virtual USD balance into their account, which can be used to purchase mock BTC or ETH.

Default User

If you do not wish to create a new account, you can use the default credentials:

  • username: admin
  • password: secret

Automatic logging out

Signed-in user will be automatically logged out after a certain period of inactivity. On every account action (buy/sell/page navigation), the idle time will be reset.

Numbers

Prices are updated real-time - which means the web app's exchange rates follow the actual markets. A strict price validation is implemented (price swing within 0.5%) so that users may not be able to manipulate the inputs to buy/sell at a false exchange rate.

Tests

To run tests:

bundle exec ruby test/cx_test.rb

Tests will now retrieve current price data from cache_prices.yml. This will prevent significant price fluctuations due to API response lagging time.

Credits

Icon made by Those Icons from www.flaticon.com

Chartkick, together with Google Charts are used for drawing beautiful charts.

Crytocompare API is used as an API source for all of the real-time pricing and historical price data.

coin_exchange's People

Contributors

yingcgooi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.