smartnav / crypto-todo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prerequisites

  • Nodejs12.x+
  • PostgreSQL 11
  • Sequelize
  • Postman

File Structure

DB Snapshot

Application Setup

Run the following commands.

Clone from repo

$ git clone https://github.com/smartnav/crypto-todo

Goto the folder

$ cd crypto-todo

Install npm dependencies

$ npm install

Database Setup

Create table with Migrations

$ npx sequelize-cli db:migrate It will create table in the database.

Db connection

Go to server/config/config.json file, and change db connections.

{
  "development": {
    "username": "postgres",  
    "password": "pg@123#",
    "database": "tododb",
    "host": "127.0.0.1",
    "dialect": "postgres"
  },
  .................

App Configuration

Open .env file from the applicatoin and configure your settings. Currently I have added some of the fields for default sync. You can add as many as you want.

CRYPTO_URL=https://min-api.cryptocompare.com/data/pricemultifull
FSYMS=BTC,LINK,MKR 
TSYMS=USD,EUR,ETH,LTC
CRONTIME=2
PORT=8000

Start Application

Run the following command for start the application, I will run on default port 8000, but you can change it from .env file.

$ npm start

Test with postman

Import this link to your postman and Run.

<link> : https://www.getpostman.com/collections/c3e99d541e625c481202

Direct Link

http://localhost:8000/service/price?fsyms=BTC,LINK&tsyms=USD,ETH

Note

I tried myself best within this timeframe but we can make it better if I get more time.

###End

About


Languages

Language:JavaScript 98.3%Language:Shell 1.7%