Code Monkey home page Code Monkey logo

crypt-web's Introduction

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.

crypt-web's People

Contributors

suyashjoshi179 avatar

Stargazers

 avatar

Watchers

 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.