Note: This was built using cursor, so the code itself is almost entirely AI-generated.
Features
metachronik
A nodejs app that starts up and indexes a database using chronik. The schema is defined in the server. The server will determine chaintip and begin populating the database on startup. If the database is populated through the chaintip, the server will listen for finalized blocks and add them as they come in. The server runs a cron job to fill in any blocks that may have been missed by the websocket.
The server is a standalone app and interacts only with a database. It does not expose an API and the charts front end does not interact directly with the server. The charts frontend connects directly to the database (it is a nextjs app, so it runs effectively it's own server that runs an API populated by the same database that is updated by the indexer).
Front end
NextJS app that visually presents network activity overtime, according to the database schema. User can select different time windows. User can zoom to select different y-axis max values. The BCH and XEC forks are marked with reference lines. We include some novel data that probably would not make sense to index with chronik, like volume over time. Perhaps it would be better to come up with a more extensive chronik plugin, or add more volume data to the existing agora plugin. But we will probably always have some data that really is only interesting for charting purposes. Charts are mobile responsive.
Everything in this diff is deployed. The database is being updated by the indexer. The front-end is deployed and connected to the database. We could launch this just by moving the domain -- we could also keep the existing stack and support CI. Would be a bit of an infra change for ABC, but could be the way to go if we are going to have lots of nextjs apps and one-off backends where a dedicated server is arguably overkill.
https://charts-e-cash.vercel.app/
Data that is charted is available at public API endpoints, e.g.: https://charts-e-cash.vercel.app/api/charts/daily-stats?start_date=2024-07-10&end_date=2025-07-10
