Git Product home page Git Product logo

kairon-client's Introduction

This is a Next.js project bootstrapped with create-next-app.

Purpose

This application shows the current state of affairs of a list of tokens (cryptocurrency coins): how much they are worth, their price variation over the past week, past day and past hour. Clicking on any token reveals some details about the particular token. The information is taken from the coinGecko API. The user can customize the token list by adding/removing tokens. The application keeps track of this list in a sqlite database through an API written in Python (see below). Finally, the app keeps track of removed tokens on the /archive page. Removed tokens can be reactivated here.

Instructions

Install the client

  • Note: these instructions are for a Windows OS, if you use a different OS you might need to do some googling.

Download the repository and the dependencies to your machine:

git clone https://github.com/TheRealByteraver/kairon-client.git
cd kairon-client
npm install

Create a .env.local file in the root of the "kairon-client" folder and give it the following contents:

NEXT_PUBLIC_TOKEN_API_URL=http://localhost:5000

Run the build script to compile the code, then serve the build locally:

npm run build
npm run start

Install the server

Open a new terminal window and download the Python api server repository. You might need to install pipenv first. If you want to start with an empty database you'll have to delete the db.sqlite file and create a new db (see below)

cd ..
git clone https://github.com/TheRealByteraver/kairon-server.git
cd kairon-server
pipenv shell
pip install -r requirements.txt

Creation of the sqlite database - we need to do this only once. First, start python:

python

The cursor now changes to the Python >>> prompt. Now, enter the following commands to create the database:

from app import app
from app import db
db.create_all()
exit()

We're almost done. Now, start the server with the command:

python app.py

Running the app

Open http://127.0.0.1:5000 to check if the api is up and ready. You should see some text explaining how to use the api.

Finally,

Open http://localhost:3000 with your browser to see the client.

Todo

  • take care of proper sorting in table
  • take care of auto refetch for coin gecko api (convert to useQuery?)
  • provide CryptoGecko attribution ("powered by CoinGecko")

Improvements

  • on landing page: fetch coinGecko's /coins/list to get a list of known tokens, and use this to help the use add tokens with the form, by using autocomplete for example, and prevent addition of non-existent tokens
  • improve error handling of fetch() calls, provide user feedback with modal on fetch error etc
  • /:tokenName page: more details (fetch different api endpoint), show graph, fancier css
  • /archive page: improve design/ looks, add "permanent token delete" functionality

Ideas

  • show online status of CoinGecko API on landing page

useful resources:

frontend:

backend:

kairon-client's People

Contributors

therealbyteraver 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.