๐Ÿ“ฆ navidrome / insight-charts

A little command-line tool to generate Vega-Lite charts from Navidrome's insights database.

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching โš–๏ธ GNU General Public License v3.0
๐Ÿ“ฅ Clone https://github.com/navidrome/insight-charts.git
HTTPS git clone https://github.com/navidrome/insight-charts.git
SSH git clone git@github.com:navidrome/insight-charts.git
CLI gh repo clone navidrome/insight-charts
Caio Cotts Caio Cotts add LICENSE 28f636e 7 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ .vscode
๐Ÿ“ model
๐Ÿ“„ .env.example
๐Ÿ“„ .gitignore
๐Ÿ“„ deno.json
๐Ÿ“„ deno.lock
๐Ÿ“„ Dockerfile
๐Ÿ“„ generators.ts
๐Ÿ“„ index.html
๐Ÿ“„ LICENSE
๐Ÿ“„ main.ts
๐Ÿ“„ README.md
๐Ÿ“„ README.md

insightโ€‘charts

Overview

insightโ€‘charts processes insight records from Navidrome and generates Vega-Lite charts.

Charts implemented so far

  • Operating system distribution
  • Number of instances over time
  • File systems used for music files
  • File systems used for data files
  • Player types/clients used

Requirements

  • Deno runtime
  • SQLite database with Navidrome insights data

Installation

git clone https://github.com/yourusername/insight-charts.git
cd insight-charts

Using Deno tasks (recommended)

development; autoโ€‘reloads on file change

deno task dev

produce a standalone native binary in ./insightโ€‘charts

deno task build

Configuration

Environment variables

| Variable | Purpose | Example | | -------------------- | ---------------------------------------------------------------------------- | ---------------------------------- | | INSIGHTDBPATH | Path to the SQLite database. Required if --db-path flag is not passed. | INSIGHTDBPATH=./db/insights.db | | INSIGHTOUTPUTDIR | Folder where chart JSON files will be written. | INSIGHTOUTPUTDIR=./charts | | INSIGHTVERBOSE | Enable timestamped log lines (1, true, yes). | INSIGHTVERBOSE=1 |

A sample file (.env.example) is provided; copy it to .env and adjust:

cp .env.example .env

...edit as needed...

Usage

Using only environment variables

INSIGHTDBPATH=./db/insights.db \
INSIGHTOUTPUTDIR=./charts \
deno run -ERW main.ts

Compiled binary

After deno task build:

./insight-charts -d ./db/insights.db -o ./charts -v

Options

| Flag | Description | Default | | ------------------------- | ------------------------------------- | ------- | | -d, --db-path <path> | Path to the SQLite database | โ€” | | -o, --output-dir <path> | Output directory for chart JSON files | . | | -v, --verbose | Prepend date & time to log messages | off | | --help | Show builtโ€‘in help | โ€” |

View the visualisations

deno task serve

Docker

Build

docker build -t insight-charts .