Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/suyashjoshi179/crypt-web

Crypt is a free cryptocurrency website which uses free open API's efficiently in order to visualise data, which helps you to analyse and predict their future, so you can invest your money wisely.
https://github.com/suyashjoshi179/crypt-web

analysis-tools bootstrap coingecko-api cryptocurrency-prices cryptowatch-api database-caching firebase firestore free google-charts reactjs request-throughput-tradeoff rest-api tradeoff visualize-data

Last synced: 7 days ago
JSON representation

Crypt is a free cryptocurrency website which uses free open API's efficiently in order to visualise data, which helps you to analyse and predict their future, so you can invest your money wisely.

Awesome Lists containing this project

README

        

# Crypt Cryptocurrency Website

Crypt is a cryptocurrency website, where you can check out latest cryptocurrencies, their current rates, historical rates and their trend. Which helps you to predict their future, so you can invest your money wisely.


Crypt is free, hosted on firebase. Data for current rates is provided by coingecko and history by cryptowatch.


Idea


  Surfing through the internet, trying to predict cryptocurrency trends, I thought of making a better and free alternative for allready present sites. You can see the Ideation of this project here.


As you can see from the ideation, lot of things have changed during the project, such as UI and the API used. Reason for why api has been changed is given in the making and working section. Some features have been added, whereas some have been removed.


Making and Working of Crypt


  Crypt gets the cryptocurrency data from API's and displays it in a manner that is easily undastandable and visually appealing. For this, it uses various frameworks and libraries.


  The website is made using ReactJS. It gives crypt it's dynamic behaviour. Crypt gets the required data by sending http requests to the REST Api endpoints provided by Cryptowatch and Coingecko. Almost all REST Api's for cryptocurrency data out there have some sort of limit for free use. For Crypt to be free, all requests combined should be within the given limit.


CoinApi is good but has very small limit(only 100 requests a day). So, the Cryptowatch having 10 sec of computer time a day(666 requests a day on avg.) was a obvious choice.


  The thing is, every visitor makes more than one requests to the api in one visit(22 requests are made just on loading). Thats why even a handful people can saturate the api limit. For this reason, crypt is optimised to use minimum number of requests by storing the data which is repetadely accessed and which does not change frequently, such as historical data.


  Historical data is accessed by every user and as history data doesn't change in the course of a day, that can be stored and retrived only once a day. For storing purpose, crypt uses Cloud Firestore, provided by Firebase. For every cryptocurrency, a server timestamp of 'updatedOn' is stored, only if the difference between this timestamp and current timestamp exceeds one day, the request is sent to the API. That means, only the first user who opens the website, actually sends the request and updates the backend. If a new cryptocurrency is found, it makes a new document for it and uploads the data in it. All other users access the history data from database itself.


  There is a slight problem with Cryptowatch Api, it doesn't provides the market cap data, which is useful for ranking the cryptocurrencies. For this purpose, crypt uses a second cryptocurrency api named CoinGecko. CoinGecko provides market cap data along with all the data for current rate's. CoinGecko also has a larger limit with 100 requests a minute. CoinGecko has a nasty api endpoint for history and only provides small amount of information in a single request. Thats why its better to stick with two API approach, one for rankings and prices and one for history.


  Crypt uses firebase for hosting and database with free spark plan in mind. Spark plan allows 20k reads and 50k writes a day which are more than enough and will not be a bottleneck.


  Cryptowatch dosn't send Allow-Origin header in the http response, that meanse sending requests from frontend will be bloked by CORS policy. To tackle this, a proxy server is used which acts like a middleman in frontend and API server. Proxy server adds the Allow-Origin header in te response so that the browser doesn't block the response. Crypt uses a seperate proxy server using CORS-Anywhere, deployed on Heroku.