@mthomason2
Michael ThomasonDeveloper▲6
Systems Analysis, Independent
24m ago · New project · Agents · Washington

Shipped: MAD (Mobile Analytics Document)

An open format and embeddable engine for relational reporting, written in Objective-C. MAD combines a SQL query designer, a banded report designer, and a report viewer. It's intended for developers and business users who already have a database and want to get more out of their data.

At the center of the project is the .mad file format. A report isn't simply a template or a static PDF. It's a portable document containing a snapshot of the source database schema, a relational query graph (tables, JOINs, filters, and groupings), and a parametric report layout. The entire report definition is generally only 15-80 KB.

The reporting engine is shared across all environments: UIKit on iOS, AppKit on macOS, and a headless Linux implementation. There are two iOS apps (Designer and Viewer), a full native macOS application, and a Linux command-line engine that runs in Docker and GitHub Actions. The database drivers support PostgreSQL, MySQL/MariaDB, Microsoft SQL Server, and SQLite.

One of the I'm happy about is the underlying data architecture. This was originally designed as a mobile-first application, where memory is a very real constraint. Rather than loading the entire result set into memory, the engine streams data from the source database into an indexed SQLite cache and renders the report from there. This allows it to handle very large result sets, including hundreds of thousands of rows, without requiring the entire dataset to reside in RAM. It's also very fast; it runs about as fast as the server can return the data.

The .mad format is an open specification, and the source code is MIT licensed. The engine is also designed to be embedded into other applications, and database drivers can be added through a relatively straightforward subclass of MADDatabase.

This project represents roughly 15 years of work. I wrote the original file format, reporting engine, frameworks, and iOS application by hand. The native macOS application and the headless Linux implementation were developed with AI agents (Claude Code with DeepSeek, and Google's agy).

The macOS application was an interesting exercise in agentic programming. My first attempt at having the agent build the native application failed miserably. What finally worked was breaking the application down into individual workspaces and pointing the agent to the root view controller of each corresponding iOS screen. I started with the query designer, then the report designer, then the viewer, and finally the report creation screens. With the existing UIKit implementations as a reference, the agent did an amazing job translating them into native AppKit, and today that is truly machine work.

AI was also used to localize the application and documentation into German, Spanish, Japanese, Brazilian Portuguese, and Simplified Chinese. I've even used it to research potential markets and developer communities in different countries and put together a marketing report identifying places where I might introduce the project.

I'm interested in feedback, beta users, and integration opportunities. In particular, I'd like to connect with developers interested in embedding the engine, building additional database drivers, or using the open reporting format in their own applications.

As a side note... ever wonder what graph algorithm is used to turn a visual query into SQL? The answer is a topological sort. Tables are vertices, JOINs are directed edges, and the resulting graph determines the SQL construction order.

MAD (Mobile Analytics Document) logoMAD (Mobile Analytics Document)@mthomason/mad-designer · github.com/mthomason/MAD
AgentsAgentic CodingOpen SourceDeveloper ToolsSQLDatabasesReportingBusiness Intelligence

Comments

No comments yet
Start the conversation.
Log in to join the thread.