
I've always been fascinated by how Obsidian visualizes the connections between notes in their graph view. It transforms a collection of documents into an interactive web of knowledge, making it easy to discover relationships you might have missed. I wanted to bring that same experience to my blog.
The idea was simple: create a mind-map style interface where blog posts appear as nodes, connected by shared tags and backlinks. As you hover over nodes, related posts light up. Click a node to read the full post. It's a more organic way to explore content than a traditional chronological list.
After evaluating several approaches, I decided to build a custom solution using react-force-graph, a React wrapper around D3's force simulation. Here's why:
Posts are connected in two ways:
The graph uses visual cues to convey information at a glance:
The interface includes:
To support backlinks, I added a new model to track post-to-post connections:
model BlogPostLink {
id String @id @default(cuid())
sourcePostId String
targetPostId String
linkType LinkType @default(BACKLINK)
sourcePost BlogPost @relation("SourceLinks", ...)
targetPost BlogPost @relation("TargetLinks", ...)
}
When a post is saved, the system automatically parses the HTML content for internal links and updates the connection table.
The graph view is now embedded directly on the blog page. It provides a bird's-eye view of all content and how it's interconnected. For readers, it's a more engaging way to discover related posts. For me, it's a visual reminder of how ideas connect across different topics.
Future improvements I'm considering:
If you're interested in implementing something similar, the key libraries are react-force-graph for visualization and any database with relationship support for storing connections. The hardest part is designing a good UX—the graph should enhance discovery, not overwhelm users.