Skip to Content
ConceptsDocuments

Documents

Documents are Orjanda’s central modeling primitive: a Go struct with metadata that can be carried through the application.

What is a Document?

A Document represents a business entity that needs to be stored, accessed, and acted on. Its fields are declared in Go. oj tags carry framework metadata alongside the type, giving Orjanda the information it needs to derive the database table, CRUD API, admin UI, and AI-agent tools.

Go structyour declaration
Documentregistered model
application surfacesderived output
APICRUD surface
Admin + agentcontrolled operations
one source of truth · multiple ways to work

Fields and schema

Fields are ordinary Go struct fields. The schema is derived from the Document declaration and its supported metadata. The exact tag vocabulary is release-defined; keep the tags you use aligned with the v0.1.5 source rather than assuming an option from a later version.

DeclarationDerived concernConsumed by
Go fieldDocument field and schemadatabase
oj tagfield metadatagenerated surfaces
Documentregistered entityAPI, admin, agent

The Registry

The Registry is the framework’s catalog of Documents. It gives the runtime a coherent view of the entities available to the application and provides the basis for deriving their surfaces. Treat registration as the boundary between a type in your package and a business object Orjanda can operate on.

Keep the declaration close

A good Document is understandable without opening generated output. Start with a business noun, keep fields explicit, and let the framework handle repetitive plumbing. When you need behavior beyond the default surfaces, use the extension points documented in Architecture.

Last updated on