Hive Analytics Dashboard (using HafSQL) - Next Version crazy fast and easy to use.

in HiveDevs4 days ago

A few days ago, I converted my original script, which is written in Python and only ran locally on my computer, into an application that can run in a browser with an interface. You can find the article here: https://peakd.com/hive-139531/@louis88/a-single-file-analytics-tool-to-find-post-payouts-from-a-list-of-users

I was actually very happy with the development, as everything worked as I had imagined. But for a long time I had been thinking that retrieving information for every single API call per account is simply too resource-intensive and takes far too long. The idea that came to me was to rewrite the software in such a way that it can be realized with the HiveSQL database query, since information can be retrieved directly and almost instantly. Since I am not very familiar with SQL, I simply discarded this idea and continued working with the API endpoint version. After I published the API version on Github the day before yesterday, I took it upon myself to spend the day yesterday getting to grips with SQL a little more. I became aware of the new development by @blocktrades and @mahdiyari, who have published HAFSQL. More about this in the articles

https://gitlab.com/mahdiyari/hafsql
https://gitlab.com/mahdiyari/hafsql-api
https://peakd.com/hive-139531/@mahdiyari/hafsql-update-200-rc1-breaking-changes
https://peakd.com/hive-139531/@mahdiyari/public-hafsql-database-on-haf
Proposal: https://peakd.com/hive-139531/@mahdiyari/proposal-public-haf-hafsql-database-maintenance-and-development-of-hafsql

SQL Calls are the Solution

My goal was not to retrieve lists of 18,000 for several hours via the API calls, for example, but to get to the details quickly, because waiting several hours was simply lousy and I no longer wanted to. So yesterday I took the time to rebuild the software based on calls to the HAFSQL database from mahdiyari. I have to say, this variant is simply lightning fast and delivers exactly the result I expected. However, I still had another problem - I can't make SQL queries from a local HTML document, for example, so I have to outsource the software to a web server using NodeJS, for example, so that the queries work. Locally this wasn't a problem, but so that you can view and use the software, I had to switch to a service called Render.com, which provides me with a mini-server and receives a ping from uptimerobot every 5 minutes so that the server is (hopefully) permanently online. Anyway, I'm happy that after many hours of work it worked and services like Hivewatchers but also every single user of yours can work with it. Here is the software with the HAFSQL integration:

Hive Analytics Dashboard (using HafSQL)

A web-based dashboard for monitoring Hive blockchain posts using HafSQL database. This tool allows you to track posts from multiple accounts, monitor their payouts, and analyze engagement metrics.

Live-Version

https://hive-fetcher-hafsql.onrender.com/
(Running on Render.com / If Service is unavailable - please drop me a Message.)

Github Repo: https://github.com/louis-88/hive-fetcher-hafsql

Screenshots

Clean View

Dummy Data fetched


Features

  • Monitor multiple Hive accounts simultaneously
  • Track post payouts and engagement metrics
  • Batch processing of account data
  • Customizable time range and payout thresholds
  • Real-time progress tracking
  • Sortable results table
  • Support for both PeakD and Hive.blog frontend links
  • Custom HafSQL database connection configuration
  • File upload support for bulk account lists

Installation

  1. Clone this repository:
git clone https://github.com/louis-88/hive-fetcher-hafsql.git
cd hive-hafsql-fetcher
  1. Install dependencies:
npm install
  1. Start the server:
node server.js
  1. Open your browser and navigate to:
http://localhost:3000

Usage

  1. Enter Hive usernames (one per line) or upload a text file containing usernames

  2. Configure settings:

    • Days Back: How far back to look for posts (1-30 days)
    • HBD Threshold: Minimum payout value to include
    • Batch Size: Number of accounts to process at once
    • Frontend: Choose between PeakD and Hive.blog links
  3. Click "Start Monitoring" to begin processing

Default HafSQL Connection

The dashboard comes preconfigured to connect to the public HafSQL instance:

Host: hafsql.mahdiyari.info
Port: 5432
Database: haf_block_log
Username: hafsql_public
Password: hafsql_public

You can change these settings through the "Custom HAFSQL Credentials" section in the dashboard.

image.png

Tech Stack

  • Frontend: HTML, CSS, JavaScript
  • Backend: Node.js, Express
  • Database: PostgreSQL (HafSQL)
  • Additional: pg-pool for database connection management

API Endpoints

  • GET /: Serves the main dashboard
  • POST /update-credentials: Updates HafSQL connection settings
  • POST /query: Fetches post data for specified accounts

License

MIT


That's it for now - if you have any questions or suggestions, please write a message in the comments.

Sort:  

I ran into some things that I couldn't get to work the way I wanted with Python and using HIVESQL was the way I was able to finally get it done. If you can program in those other languages, SQL shouldn't be too hard for you. Just a lot of referencing tables and stuff.

Loading...