TypeScript first. Language-agnostic by design.
Define your models once
Get TypeScript types, runtime validation, and DB metadata from a single `.as` model.
Atscript is built to power a broader model-driven stack over time. Today, TypeScript is the first supported plugin.
Start with one .as file and use it for TypeScript types, validators, and runtime metadata.
Keep constraints, labels, and other hints on the model instead of scattering them across schemas and UI code.
Drive tables, relations, schema sync, and REST/CRUD integrations from the same model definition.
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 '../db/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 and MongoDB adapters are available today.
The long-term direction is one model across UI, API, TypeScript, and DB. The same metadata that powers runtime tooling today is the basis for automated forms and data-table views later.
Atscript 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.