Levelbrook Labs

Building a Media Rights & Distribution Dashboard

Patrick Donahue · Levelbrook Consulting

Try the interactive demo

The business of media distribution runs on a complex web of contracts that dictate who can show what content, where, when, and how. For decades, this information has lived in spreadsheets, bespoke internal databases, and the institutional memory of key personnel. This status quo is fragile, opaque, and incredibly expensive when mistakes are made. A breach of an exclusivity clause can easily lead to seven-figure penalties and damaged partner relationships.

This makes Media Rights Management a fascinating domain for a SaaS product. It’s not a simple CRUD app. The core technical challenge is modeling and querying a high-dimensional problem space and then presenting it in a way that provides immediate clarity to a non-technical user. It’s a data modeling, UX, and system correctness problem rolled into one.

The Core Problem: An N-Dimensional Matrix

At its heart, a media right is a permission slip with multiple constraints. To build a system that can answer the fundamental question—"Can we distribute this film to this partner?"—we need to model these dimensions cleanly. The primary axes are:

A single film might have hundreds of these rights grants, creating a dense, overlapping matrix of permissions. The engineering task is to build a system that can reliably navigate this matrix to prevent conflicts and surface opportunities.

Architecture for a Rights Management Platform

Let's consider how to architect a system to tackle this, using a modern stack: Python for the backend API, Vue.js for the dashboard, and MongoDB as the database, with a pragmatic application of AI.

Data Model: Embracing Complexity with MongoDB

This is a domain where a relational model can become painfully complex. Contracts often have unique, non-standard clauses that don't fit neatly into rigid tables. A document model, like MongoDB's, offers the flexibility to represent the structure of a deal more naturally.

We could structure our data around three core collections: `Content`, `Agreements`, and `Rights`. The `Rights` document is the heart of the system, tying everything together:

{
  "_id": ObjectId("..."),
  "contentId": ObjectId("..."),       // Ref to Content collection
  "agreementId": ObjectId("..."),     // Ref to the legal contract
  "partnerId": ObjectId("..."),       // Who the right is granted to
  "territories": ["US", "CA"],        // ISO 3166-1 alpha-2
  "excludedTerritories": ["CA-QC"],   // ISO 3166-2 for sub-regions
  "timeWindow": {
    "start": ISODate("2025-01-01T00:00:00Z"),
    "end": ISODate("2026-12-31T23:59:59Z")
  },
  "platforms": ["SVOD"],
  "exclusivity": "EXCLUSIVE",
  "metadata": { /* ... custom fields from the deal ... */ }
}

This structure allows us to query for potential conflicts directly. For example, before saving a new exclusive SVOD right for a film in the US for 2025, the system must query for any existing `Rights` documents that match `contentId`, `territories: "US"`, `platforms: "SVOD"`, and have an overlapping `timeWindow`.

Indexing is non-negotiable. We'd need compound indexes on combinations of `contentId`, `territories`, `platforms`, and the `timeWindow` fields to make these "avails" (availability) checks performant.

Backend Logic: The Conflict Detection Engine

Using Python with a framework like FastAPI, the backend's primary responsibility is not just serving data but enforcing business logic. The most critical piece is the conflict detection engine. This is where a senior engineer's pragmatism comes into play.

A synchronous, blocking check on every write is the safest path to data integrity, but it could be slow if the logic is complex. An asynchronous check that flags conflicts for review after the fact is faster but allows for temporary states of invalidity. A hybrid approach is likely best: run fast, synchronous checks for direct, obvious conflicts (e.g., identical exclusive grants) and queue a more comprehensive, asynchronous job that checks for nuanced interactions (e.g., a combination of non-exclusive rights that violates a "total-market-share" clause).

The cost of an error is the primary driver of this tradeoff. In a domain where mistakes are measured in millions of dollars, leaning towards correctness and predictability over raw write performance is the right call.

Frontend: Visualizing Complexity

The frontend, built with Vue.js, TypeScript, and a state management library like Pinia, has the difficult job of making this multi-dimensional data comprehensible. A simple table of rights is insufficient. The goal is to provide intuitive visualizations that answer key business questions at a glance:

Reactivity is key. As a user adjusts a date range filter or selects a different set of platforms, these complex visualizations must update in near real-time. This requires careful state management and efficient data fetching strategies. Pushing updates via WebSockets or Server-Sent Events ensures that all users viewing a dashboard see new deals as they are logged, fostering a single source of truth.

A Pragmatic Role for AI and LLMs

This is a domain ripe for AI integration, but not as a replacement for human oversight. The most valuable applications are as powerful assistants.

Contract Ingestion with a Human-in-the-Loop

Legal agreements are often unstructured PDFs. An LLM-powered pipeline can be built to parse these documents. Using a Retrieval-Augmented Generation (RAG) approach, the system can extract key terms—content titles, dates, territories, financial details, and specific clauses—and map them to our structured data model.

However, the output of the LLM cannot be blindly trusted. The UI must be designed for a human-in-the-loop workflow. The interface should present the LLM's suggested data fields side-by-side with the source text from the original contract, requiring a user from the legal or business affairs team to verify and approve each extracted field before it's committed to the database. This combines the speed of automation with the correctness of expert review.

Natural Language Query

Once the structured data is in place, an LLM can serve as a natural language interface to the database. A business user shouldn't have to construct a complex query with ten different filters. They should be able to ask:

"Show me all our action films that become available for SVOD in Germany, Austria, and Switzerland in the next six months."

The LLM's job is to translate this query into the precise MongoDB query syntax required to fetch the data. This dramatically lowers the barrier to entry for accessing critical business intelligence.

Closing Reflection

Building a robust Media Rights Management platform is a compelling engineering challenge because the solution's value is directly proportional to the clarity it creates from complexity. It forces a focus on first principles: a precise and flexible data model, a business logic layer obsessed with correctness, and a user interface dedicated to intuitive visualization. The problem space is a near-perfect intersection of data density, high-stakes business rules, and the need for a truly user-centric design. It’s the kind of system where thoughtful engineering doesn't just improve efficiency—it prevents disasters and unlocks opportunities that were previously buried in spreadsheets.