Skip to content

thirt33n/price_tracker

Repository files navigation

BitCoin Price Tracker

This is a bitcoin price tracker built using django and redis.

Installation

PS: Docker version will be pushed shortly
  1. Clone the project using git
git clone https:/thirt33n/price_tracker.git
  1. Install the requirements
pip install -r requirements.txt
  1. Install Redis On your system, if on Debian-Based system run the following comand:
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list

sudo apt-get update
sudo apt-get install redis

If not on debian system check the redis documentation for installation steps.

Usage

To start the development server run the following

cd price_tracker
python manage.py runserver



This starts the django server on port 8000

Navigate to http://127.0.0.1:8000/api/alerts to view all the alerts created.

Fill the form below to create your alerts.

To Start redis server and Celery worker and beat processes run the following commands in different terminal windows:

redis-server
redis-cli ping #to Check if the redis server is up and running

For Celery

celery -A price_tracker worker -l info
celery -A price_tracker beat -l info



To start the alert background process click on the Extra Options button at the top and click on Check option

Working

It uses Binance Web Socket to fetch the average Price of Bitcoin in USD every 2 minutes and checks for created alerts whose target price is more than the current bitcoin value.

Once this is found, it uses Redis message broker to send an email alert to the particular user's registered email about the current BTC price.

Video Demo

In Case you are unable to recreate the project in your system view this video:

demo_tracker_compress.mp4

Author

P Siddharth

About

Django app to track bitcoin prices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages