GithubHelp home page GithubHelp logo

sweeetland / crypto-dex Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 47 KB

A small service that is responsible for retrieving current crypto rates and saving data to an SQL database every 5 minutes.

JavaScript 78.56% HTML 21.44%

crypto-dex's Introduction

Crypto Dex ๐Ÿš€

A small service that is responsible for retrieving current rates by following pairs BTC/EUR, BTC/USD, BTC/GBP, ETH/EUR, ETH/USD, ETH/GBP and saving data to an SQL database every 5 minutes.

This was built with Google Cloud services: Functions, Cloud SQL and Cloud Scheduler.

Prerequisites

  1. Node: any 10.x version
  2. NPM
  3. GCP account
  4. Gcloud CLI - make sure this is setup with your project

Installation

  1. npm i to install dependencies
  2. npm run create-db to create an postgres instance on Cloud SQL
  3. npm run deploy-saveLatestRates && npm run deploy-getRates to deploy the functions
  4. Create a .env.yml in the root directory for env variables: SQL_USER, SQL_PASSWORD, SQL_DB, INSTANCE_CONNECTION_NAME
  5. You will find this info from GCP console
  6. Create a table in the DB with: CREATE TABLE rates (ID UUID PRIMARY KEY, CREATED_AT TIMESTAMP, BTC_USD FLOAT, BTC_EUR FLOAT, BTC_GBP FLOAT, ETH_USD FLOAT, ETH_EUR FLOAT, ETH_GBP FLOAT);
  7. Setup cloud scheduler to trigger saveLatestRates via http

๐Ÿงจ

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.