Skip to content

avoinescu/chronicle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chronicle

Go Version License Status

Chronicle is a Go-based CLI tool for managing and querying a personal book database using ISBNs.

It acts as the entry point for a book ingestion and analytics pipeline, allowing you to normalize ISBNs, search your database, and (in the future) enrich book data automatically.


What Chronicle actually does today?

Chronicle is not just an ISBN normalizer anymore.

It currently allows you to:

  • normalize ISBN inputs (ISBN10 / ISBN13)
  • search a PostgreSQL book database by ISBN
  • retrieve structured book data (title, author, etc.)
  • act as a CLI interface for your personal book system

👉 In short:

Chronicle = CLI layer for your personal book database + analytics system


Why This Exists?

I use other tools to keep track of what I read, like Goodreads and TheStoryGraph, but what I do not like is that they either do not provide everything on their site, or if I want more stuff it is behind a paywall. I am not against paying for stuff, but if I can build the items I want myself, while also learning, why not? This is how this small CLI tool was born. I have linked a postgres DB to my Grafana instance and I have populate in that DB all the books I have read so far, but I wanted a simpler way to add items in my DB, query for books or modify items, without having to go each time in pgadmin, or connect using postgres tools to the db.

I wanted to learn Go and saw this as a great method to learn while building what I am interested.

Chronicle solves this today by:

  1. Taking raw ISBN input
  2. Normalizing and validating it
  3. Querying a central database
  4. Returning structured data

⚙️ Current Architecture

flowchart TD

A[User CLI Input] --> B[Chronicle CLI]

B --> C[Normalize ISBN]
C --> D[Validate ISBN]

D --> E[PostgreSQL Books DB]

E --> F[Book Data]
F --> G[CLI Output]

E --> H[Grafana Dashboards]
Loading

💻 CLI Usage

Normalize ISBN

go run ./cmd/chronicle normalize 978-1804940822

Search by ISBN

go run ./cmd/chronicle search 9781835418581

Output:

Title: Jitterbug
Author: Gareth L. Powell
ISBN13: 9781835418581

Build Binary

go build -o chronicle ./cmd/chronicle

Run:

./chronicle search 9781835418581

📦 Current Features

  • CLI-based architecture
  • ISBN normalization (strip spaces, hyphens)
  • PostgreSQL integration
  • search by ISBN13 (exact match) - For now it is only ISBN13 while it is the most used in my DB.
  • modular Go project structure (cmd / internal separation)

📁 Project Structure

chronicle/
├── cmd/
│   └── chronicle/
│       └── main.go
├── internal/
│   ├── db/
│   │   └── db.go
│   ├── isbn/
│   │   ├── normalize.go
│   │   └── validate.go
│   ├── models/
│   │   └── models.go
│   ├── repository/
│   │   └── query_isbn.go
│   └── output/
│       └── print.go
├── docs/
│   └── screenshots/
├── README.md
├── go.mod
└── LICENSE

📊 Analytics Integration

Chronicle queries a PostgreSQL database that is used for analytics via Grafana.

My Grafana Dashboard recreates most of the stats I like to see in the StoryGraph site while allow me to query across multiple years.

  • books per author
  • genre distribution
  • reading trends
  • page count insights
  • collection overview

Example Dashboards

Books Dashboard

Genre Dashboard


🛣️ Roadmap

Near Term

  • search by title (partial match)
  • add books via ISBN (chronicle add <isbn>)
  • delete / update commands
  • better CLI output formatting

Metadata Enrichment

  • Google Books API integration
  • Open Library fallback
  • automatic metadata ingestion

Data Pipeline

  • unified Book model
  • automatic DB insertion if book not found
  • JSON output mode

Long Term

  • web interface (optional)
  • automation pipelines (n8n / Discord integration via slash commands)
  • multi-source ingestion system

🧪 Running the Project

Clone:

git clone https://github.com/anubis619/chronicle.git
cd chronicle

Run:

go run ./cmd/chronicle search 9781835418581

🧰 Tech Stack

Current:

  • Go
  • PostgreSQL
  • Docker (for DB)
  • Grafana (analytics)
  • Terraform (infrastructure for deploying Grafana in my homelab, the db and also all my dashboards)

Future:

  • Google Books API
  • Open Library API
  • n8n (automation)

🧠 Why This Project Matters

Chronicle is part of a broader system combining:

  • CLI tools
  • database design
  • data ingestion pipelines
  • analytics dashboards
  • homelab infrastructure

It is both a practical tool and a learning platform for:

  • Go development
  • backend architecture
  • data pipelines
  • self-hosted systems

📄 License

MIT License

About

Chronicle is a Go-based CLI tool that is capable of query my DB, add, modify or delete entries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages