One model. Types · DB · UI.
Define your data once.
Generate TypeScript types, runtime validation, DB schema, REST routes, and a full UI — forms, tables and multi-step flows — from a single `.as` model.
One .as file becomes TypeScript types, validators, and runtime metadata.
Constraints, labels and hints live on the model — not scattered across schema and UI code.
Tables, relations, schema sync, and CRUD endpoints from the same model definition.
Render <AsForm>, <AsTable>, and multi-step HTTP flows straight from .as types.
import { pgTable, serial, varchar, integer, uniqueIndex } from 'drizzle-orm/pg-core'
export const users = pgTable(
'users',
{
id: serial('id').primaryKey(),
email: varchar('email', { length: 255 }).notNull(),
name: varchar('name', { length: 100 }).notNull(),
age: integer('age').notNull(),
role: varchar('role', { enum: ['admin', 'user'] }),
},
t => [uniqueIndex().on(t.email)]
)import { createInsertSchema } from 'drizzle-zod'
import { users } from '..https://db.atscript.dev/schema'
export const insertUserSchema = createInsertSchema(users, {
email: s => s.email.email(),
name: s => s.name.min(2).max(100),
age: s => s.age.positive(),
})const fieldConfig = {
email: { label: 'Email Address', placeholder: 'alice@company.com' },
name: { label: 'Full Name', placeholder: 'Alice Smith' },
age: { label: 'Age', type: 'number' },
role: { label: 'Role', component: 'select' },
}@db.table 'users'
export interface User {
@meta.id
id: number
@meta.label "Email Address"
@ui.placeholder "alice@company.com"
@db.index.unique 'email_idx'
email: string.email
@meta.label "Full Name"
@ui.placeholder "Alice Smith"
@expect.minLength 2
@expect.maxLength 100
@db.index.fulltext 'search_idx'
name: string
@meta.label "Age"
age: number.int.positive
@meta.label "Role"
@ui.component "select"
role?: 'admin' | 'user'
} Start with one .as model. Atscript turns that model into TypeScript types, runtime metadata, and validation rules without a second schema layer.
The same model can drive schema annotations, relations, sync, CRUD helpers, and REST/CRUD integrations instead of splitting those concerns into separate definitions. SQLite, PostgreSQL, MySQL, and MongoDB adapters are available today.
The same .as model that drives your types, validation, and DB now renders <AsForm>, smart <AsTable> data grids, and multi-step HTTP workflow forms — straight from the annotations. No render boilerplate, no manual wiring.
One command teaches Claude Code, Cursor, Windsurf, and Codex the entire .as language — annotations, primitives, codegen, and the runtime Validator.
.as syntax & primitives @meta.* / @expect.* annotations asc codegen & plugin modelValidator & type guardsAtscript is not built as a TypeScript-only schema DSL. The core model and plugin system are meant to support other language targets over time, while TypeScript remains the first and most complete implementation today.
.as model stays stable as the shared schema layer.