Welcome to Radiant
Radiant is a schema-first backend framework that turns a declarative domain-specific language (.radiant files) into a fully functional API server. You describe your data model, security policies, and infrastructure settings in the Radiant DSL; the compiler validates and transforms them into a typed runtime, database schema, and CRUD API endpoints — no boilerplate required.
How It Works
Radiant operates fundamentally differently from traditional frameworks. Instead of manually writing and maintaining complex boilerplate code across your stack, you declare your desired architecture using a custom, highly readable syntax.
The engine then does the heavy lifting, acting as an extremely fast compiler that bridges the gap between your abstract design and a robust, production-ready backend.
- You write
.radiantfiles in theradiant/directory of your project. - The CLI (
radiant generateorradiant dev) parses these files into a language-agnostic Universal AST (Abstract Syntax Tree). - The AST lowers into your target language's native runtime (currently Bun, with Go and Python support planned).
- The runtime boots up an extremely fast server with auto-generated REST endpoints, authentication, realtime subscriptions, and more.
Design Philosophy
The core of Radiant is built on the idea that infrastructure and data logic should be universally portable. You should never have to rewrite the same access controls, database relationships, and API configurations just because you switched languages or platforms.
By separating the "what" from the "how", Radiant ensures your backend remains clean, scalable, and entirely focused on business value.
- Language-Agnostic Core. The Radiant DSL is universally portable. It describes the "what" (schemas, access rules, infrastructure), while the underlying engine handles the "how" in native code.
- Schema as source of truth. Your
.radiantfiles are the canonical definition. Everything else — database DDL, API routes, and native types — is derived. You never edit generated files by hand. - No migration files. Radiant syncs the database directly from the compiled schema using
radiant db:sync. No versioned migration files to manage. - Configuration as code. Security policies, rate limits, CORS, monitoring — all declared in the DSL, validated at compile time, and wired into the runtime automatically.
What Radiant Gives You
| Feature | How |
|---|---|
| CRUD API | Every collection gets GET, POST, PUT, DELETE routes automatically. |
| Authentication | JWT, session, or API key strategies — declared in the DSL, enforced by the runtime. |
| Access Control | Per-collection read/create/update/delete rules written in TypeScript. |
| Hooks | beforeCreate, afterCreate, beforeUpdate, afterUpdate, beforeDelete, afterDelete — lifecycle hooks in TypeScript. |
| Realtime | WebSocket and Server-Sent Events subscriptions on collection changes. |
| Caching | Per-collection TTL and stale-while-revalidate strategies. |
| Rate Limiting | Configurable per-action (write, login) limits with time windows. |
| OpenAPI Docs | Auto-generated Swagger/OpenAPI spec at /api/docs. |
| Admin UI | Optional admin dashboard driven by your collection schema. |
| Database Sync | radiant db:sync diffs the compiled schema against your database and applies changes safely. |
| Editor Support | VS Code extension + LSP with diagnostics, autocompletion, and formatting. |
Quick Example
Here is a complete Radiant project in two files:
// radiant/config.radiant
config {
core: {
api: {
prefix: "/api"
}
}
security: {
auth: {
strategies: ["jwt"]
jwt: {
accessTokenExpiry: "15m"
refreshTokenExpiry: "7d"
}
}
}
monitoring: {
healthCheck: {
enabled: true
path: "/health"
}
}
}
// radiant/collections.radiant
collection users {
auth: true
fields: {
name: text
email: email @unique
password: password
role: text @default("user")
}
}
collection todos {
fields: {
title: text
completed: boolean @default(false)
author: relationship("users")
}
}
Run radiant generate and the engine automatically provisions your backend:
Compiled Assets
| Output File | Description |
|---|---|
radiant/schema.json | The compiled Universal AST schema |
radiant/gen.ts | The high-performance native entry point |
radiant-types.ts | Strictly-typed interfaces for all collections |
Runtime Capabilities
| Feature | Details |
|---|---|
| REST Endpoints | Auto-generated GET, POST, PUT, and DELETE endpoints for todos, users, etc. |
| Authentication | JWT auth securely wired into the users collection out-of-the-box. |
| Monitoring | A built-in health check accessible at /health. |
| Documentation | An auto-generated OpenAPI (Swagger) spec available at /api/docs. |