Cody Burleson

Project: 4th Brain — Progress Update — 2025–0

· Software development

The Gog rock formation in Colorado Springs, CO — photo by the author.

Not a member? You can still access this story for free.

In my previous update, I brainstormed the Project: 4th Brain Supabase backend, one aspect of the 4th Brain platform that will provide a unique alternative to Obsidian Publish — allowing you to publish directly from Obsidian to a platform you can host yourself. Supabase is an open-source Firebase alternative that offers:

I’ve now started the Proof of Concept (PoC) phase, refining the technical design with hands-on coding experiments and scrupulous deliberation, one table at a time. My purpose today is to provide a quick status update to let interested parties know that things are still in progress and to invite feedback and participation.

Obsidian 4th Brain Plugin on GitHub

Though the Obsidian 4th Brain plugin has not been released, I’ve published the source code repo on GitHub for transparency.

At this early stage, the only thing worth noting in the repo is the init-supabase.sql script at the project's root. This is the script that any user can run on their own Supabase instance to set up the database. It currently creates:

  • Table: documents including:
    - index
    - function and trigger for flagging the latest of all versions of a given document
    - Row Level Security (RLS) enablement
    - Policies for INSERT, SELECT, and UPDATE

You can examine that script here: init-supabase.sql

Other code in the plugin project implements a SupabaseService and utilizes the Supabase JavaScript SDK. For now, I have hard-coded a little acid test to perform inserts on the documents table.

Table: documents

The documents table is the most important since it stores the Obsidian markdown documents. Here’s a quick summary of the core concepts that have influenced the design up to this point, column by column:

  • id | uuid — the id of the document, a universally unique identifier. This is generated when a markdown document is inserted into the database. When a successful insert signal is returned, the same uuid can be added to the front-matter metadata in Obsidian. In this way, the local document can thereafter be cross-referenced with a server copy.
  • version | int4 — this will help us support a version history so that documents can always be restored to a previous state. This represents a revision of the original design that called for a separate document_versions table.
  • path | text — the folder path
  • name | text — the document name (file name, minus the extension), which can be used for the content title when a metadata title has not been provided
  • content | text — the complete markdown document is stored in this field
  • is_latest | bool — a convenience field helping us select the latest among all versions of a given document
  • created_at | timestamptz — a timestamp, with time zone information, recording when the document was created in the database
  • created_by | uuid — the id of the user who created the document

Next Steps

Here are some use cases I intend to tackle next. These use cases are written with the Gherkin syntax, which can later be converted to executable test cases using a tool like the Cypress Cucumber Preprocessor.

Feature: Sync with Supabase

GIVEN the user is working with the Obsidian client
WHEN the user right-clicks a document
THEN a ‘Sync with Supabase’ item appears in the context menu

GIVEN the Obsidian user selects ‘Sync with Supabase’
WHEN the right-clicked document has no uuid property
THEN a uuid property is added to the markdown document 
AND a version property, is added to the markdown document with value 0
AND the document is inserted into the DB
AND the is_latest field is set to true
AND the created_at field is set to reflect the moment of insert

GIVEN the Obsidian user selects ‘Sync with Supabase’
WHEN the right-clicked document has a uuid property
AND the right-clicked document has a version property 
THEN the version property value is incremented by 1 on the markdown document
AND the document is updated in the database
AND the is_latest field is set to true
AND the is_latest field of all previous versions are set to false
AND the modified_at field is changed to reflect the update timestamp

GIVEN a markdown document has been inserted into the database
WHEN the markdown document has no title property
THEN the title field contains the file name without the file extension

GIVEN a markdown document has been inserted into the database
WHEN the markdown document has a title property
THEN the title field contains the title from the markdown document’s title property


If you’re interested in following along or contributing to the vision for this platform, you can:

💬 Contact me to share your thoughts and ideas

First published on Medium on .

← Cody Burleson