A lightweight framework for rapidly building full-stack applications with automatic API generation, database management, and type-safe entity definitions.
- 🎯 Array-based entity schemas with guaranteed field ordering
- 🔧 Shortcut helpers for common field types
- 🔗 Chainable API for fluent field configuration
- 🚀 Automatic REST API generation from entity definitions
- 💾 Built-in database adapter (SQLite)
- 🔐 Multi-tenant ownership support
- ✅ Type-safe with full TypeScript support
To install dependencies:
bun installimport { ownedEntity, field, string, richtext, date, number, file, t } from './framework';
const Task = ownedEntity("Task", [
string("title").required(),
richtext("description"),
field("status", t.enum(["open", "in_progress", "done"]).default("open")),
field("priority", t.enum(["low", "medium", "high", "urgent"]).default("medium")),
date("dueDate"),
number("estimate").min(0),
file("attachments").array(),
]);string(name)- String fieldnumber(name)- Number fielddate(name)- Date fieldrichtext(name)- Rich text fieldfile(name)- File fieldboolean(name)- Boolean fieldfield(name, type)- For complex types like enums
All shortcuts support method chaining:
string("email").required().maxLength(100)
number("price").min(0).default(0)
file("avatar").maxSize(5 * 1024 * 1024)import { Matte } from './framework';
const app = new Matte({
dbPath: './data.db',
port: 3000,
});
// Register entities
app.register(Task);
// Start the framework (initialization happens automatically)
await app.start();This automatically:
- Initializes the database
- Creates database tables
- Generates REST API endpoints
- Serves a UI at
http://localhost:3000
For each entity, the following endpoints are automatically generated:
GET /api/{entities}- List all recordsGET /api/{entities}/:id- Get single recordPOST /api/{entities}- Create recordPUT /api/{entities}/:id- Update recordDELETE /api/{entities}/:id- Delete record
See the src/examples/ directory:
simple-entity.ts- Basic entity definitioncustomizable-fields.ts- Advanced field customizationfield-api-demo.ts- Comprehensive API demoverify-ordering.ts- Field ordering demonstration
To run an example:
bun run ./src/examples/simple-entity.tsbun testAll 107 tests pass ✅
MIT
This project was created using bun init in bun v1.3.3. Bun is a fast all-in-one JavaScript runtime.