Skip to content

Principles

basedb was designed from an architecture document — sixteen chapters, in the repository, under docs/architecture. Its chapter 00 sets down twenty-five decisions; here is their spirit.

A user base is a PostgreSQL schema, a table is a table, a field is a typed column with a plain name. No EAV (entity-attribute-value), no catch-all JSON document, no opaque names. The _basedb catalog describes these objects; it does not replace them.

An intended consequence: direct SQL is a legitimate use. Constraints are set in the database, the history is captured by triggers — nothing assumes that writes go through the application.

The interface, the REST API, the MCP server, shared forms, webhooks: everything goes through the same enforcement point for permissions, in the core. The interface is a consumer of the API like any other — no private route, no service token. A resource you cannot see responds exactly like a resource that does not exist.

A TypeScript monorepo: @basedb/core holds all the logic (catalog, DDL engine, permissions, records, history); apps/api (Hono), apps/mcp and apps/web (Next.js) are adapters that do not call one another. The interface never depends on the core: it speaks HTTP, period.

Deleting sets aside, without destroying: a deleted table keeps its rows, readable in SQL under a set-aside name, and can be restored. Renaming a physical name keeps the old one served by an alias. Purging is an administration decision, preceded by a verified export.

PostgreSQL 16 or later, and no required external dependency: no message queue, no cache, no search engine. The webhook queue, the history drain, the rate limits — everything fits in the database or in the process.

ChapterSubject
00Structuring decisions and error code registry
01Naming and slugification
02The _basedb catalog, source of truth
03DDL engine and migrations
04Field types and PostgreSQL mapping
05Permissions
06Lifecycle: renaming, deletion, purge
07History
08REST API and webhooks
09MCP server
10Software architecture
11Interface
12AI integration
13Authentication
14Environments
15Shared forms

basedb is open-source software by Eodia, an AI-native software studio.