Skip to content

Repository files navigation

MusicMap

MusicMap is an interactive graph explorer for musicians and bands. It models artists, albums, genres, instruments, memberships, influences, and collaborations as connected graph data.

Live Demo: https://musicgraph.netlify.app/ Repository: https://github.com/soumyajit444/MusicMap


Use Case

MusicMap is designed as an "IMDb for musicians".

Instead of browsing artists as isolated records, users can explore how they are connected:

  • Band memberships
  • Instruments played
  • Musical influences
  • Collaborations
  • Albums
  • Genres
  • Connections between artists through the graph

The UI provides three main ways to explore the data:

  1. Artist Browser — browse and filter artists and bands.
  2. Relationship Map — visualize connected artists and entities.
  3. Relationship Explorer — inspect direct connections and find paths between artists.

Why a Graph Database?

A graph database fits this use case because the main value of the application is the relationships between entities, not just the entities themselves.

For example:

Meshuggah
    ↓ INFLUENCED_BY
Periphery
    ↓ MEMBER_OF
Mark Holcomb
    ↓ COLLABORATED_WITH
Misha Mansoor

Representing these connections as graph relationships makes traversals and path-based queries natural.

With a relational database, these connections would require multiple tables and joins. With CognoDB, they can be expressed directly using Cypher patterns.

CognoDB supports Cypher over Bolt and works with the standard Neo4j JavaScript driver, which makes it straightforward to integrate with the Next.js API routes.


Data Model

graph LR
    Artist["Artist<br/>Band / Person"]
    Album["Album"]
    Genre["Genre"]
    Instrument["Instrument"]

    Artist -->|MEMBER_OF| Artist
    Artist -->|PLAYS| Instrument
    Artist -->|INFLUENCED_BY| Artist
    Artist -->|COLLABORATED_WITH| Artist
    Artist -->|RELEASED| Album
    Album -->|BELONGS_TO_GENRE| Genre
Loading

Entities

  • Artist — musicians and bands
  • Album — released albums
  • Genre — musical genres
  • Instrument — instruments played by artists

Relationships

  • MEMBER_OF
  • PLAYS
  • INFLUENCED_BY
  • COLLABORATED_WITH
  • RELEASED
  • BELONGS_TO_GENRE

The current dataset contains 43 nodes and 43 relationships.


Tech Stack

Layer Technology
Framework Next.js 15
Language JavaScript
UI React
Styling Tailwind CSS v4
Graph Database CognoDB
Database Protocol Bolt
Database Queries openCypher / Cypher
Database Driver neo4j-driver
Visualization amCharts 4 ForceDirected
Fonts Oswald, JetBrains Mono
Deployment Netlify

Project Structure

MusicMap/
├── public/
│   └── images/
│       └── artists/
├── scripts/
│   └── seed.cypher
├── src/
│   ├── app/
│   │   ├── api/
│   │   └── page.js
│   ├── components/
│   │   ├── ArtistCard.js
│   │   ├── ArtistDetailPanel.js
│   │   ├── BrowsePanel.js
│   │   ├── GraphView.js
│   │   ├── PathDetailView.js
│   │   ├── RelationshipExplorer.js
│   │   ├── RelationshipMapPanel.js
│   │   └── SkeletonCard.js
│   └── lib/
│       ├── graphTheme.js
│       ├── neo4j.js
│       └── useCountUp.js
├── .env.local
├── package.json
└── README.md

Prerequisites

  • Node.js 18+
  • npm
  • A CognoDB instance
  • Git

CognoDB Setup

MusicMap uses CognoDB through the Bolt protocol and the Neo4j JavaScript driver.

1. Create or start a CognoDB instance

Create a CognoDB instance using the CognoDB service provided for the assignment, or run CognoDB locally using its official installation method.

For local development, CognoDB can be started with:

./cognodb

The default local Bolt endpoint is:

bolt://localhost:7687

CognoDB also provides a Docker option:

docker run -p 7687:7687 cognodb/cognodb:latest

For the assignment environment, use the Bolt URI and credentials provided by your CognoDB instance.

2. Connect to the instance

Use the CognoDB Browser or another Cypher-compatible client and run the contents of:

scripts/seed.cypher

This creates the MusicMap graph and adds the artist image URL properties.

3. Verify the graph

Run:

MATCH (a)-[r]->(b)
RETURN a, r, b
LIMIT 100

Environment Variables

Create .env.local in the project root:

NEO4J_URI=<your-cognodb-bolt-uri>
NEO4J_USER=<your-cognodb-username>
NEO4J_PASSWORD=<your-cognodb-password>

Do not commit .env.local to Git.


Run Locally

Clone the repository:

git clone https://github.com/soumyajit444/MusicMap.git
cd MusicMap

Install dependencies:

npm install

Create .env.local with your CognoDB credentials.

Start the development server:

npm run dev

Open:

http://localhost:3000

Create a production build with:

npm run build

Main Queries

The application uses Cypher queries through the Next.js API routes.

1. Browse Artists

Finds Artist nodes and returns their properties for the browsing interface.

MATCH (a:Artist)
RETURN a
ORDER BY a.name

2. Artist Details and Connections

Finds an artist and the entities directly connected to them.

MATCH (a:Artist {name: $name})-[r]-(connected)
RETURN a, r, connected

This powers the artist detail and relationship explorer views.

3. Find a Relationship Path

Finds the shortest available path between two artists.

MATCH p = shortestPath(
  (a:Artist {name: $from})-[*]-(b:Artist {name: $to})
)
RETURN p

This is used by the path exploration feature.

4. Full Graph

Loads the graph used by the relationship visualization.

MATCH (a)-[r]->(b)
RETURN a, r, b

The resulting nodes and relationships are transformed into the format required by the graph visualization.


UI Screenshots

Desktop Overview

MusicMap Desktop Overview

Artist Browser

Artist Browser

Artist Details

Artist Details

Relationship Map

Relationship Map

Relationship Explorer

Relationship Explorer

Mobile View

MusicMap Mobile

Screenshots can be added to the screenshots/ directory using the filenames above.


Deployment

The application is deployed on Netlify.

Live: https://musicgraph.netlify.app/

The following environment variables must be configured in the deployment environment:

NEO4J_URI
NEO4J_USER
NEO4J_PASSWORD

No database credentials are stored in the repository.


Notes

  • The Next.js API routes act as the backend layer.
  • No separate Java or Node.js backend service is required.
  • The CognoDB driver is kept as a singleton to avoid connection-pool duplication during development.
  • The graph visualization uses amCharts ForceDirected.
  • Artist images fall back to generated initials when an image is not available.
  • The UI is responsive and includes a mobile bottom-sheet exploration layout.

Notes

  • The Next.js API routes act as the backend layer.
  • No separate Java or Node.js backend service is required.
  • The CognoDB driver is kept as a singleton to avoid connection-pool duplication during development.
  • The graph visualization uses amCharts ForceDirected.
  • Artist images fall back to generated initials when an image is not available.
  • The UI is responsive and includes a mobile bottom-sheet exploration layout.

About

Interactive graph explorer for musicians and bands, powered by Next.js, React, and CognoDB.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages