Rust types as the source of truth
Evenframe reads the Rust structs and enums in your project and generates TypeScript types, SurrealDB schemas, validation, and mock data from them.
cargo install evenframe
src/profile.rs
use evenframe::Evenframe;
use serde::Serialize;
#[derive(Debug, Clone, Serialize, Evenframe)]
pub struct Profile {
#[morphs(trim)]
#[validators(non_empty, max_length = 80)]
pub display_name: String,
#[validators(email)]
pub email: String,
}What it does
Writes ArkType, Effect, and Macroforge definitions for your Rust structs and enums.
Compares your types with a SurrealDB database and applies the differences, or writes the SurrealQL without connecting.
Validators on a field run when Rust deserializes it, in the generated TypeScript, and as database assertions.
Generates test records that satisfy your field types, relations, and validators.
Ways to use it
Each part works on its own. A project can use the derive at runtime, a build script for TypeScript, and the CLI for its database.
Validated deserialization and runtime type information. No database or code generation.
Generate TypeScript and SurrealQL files on every cargo build.
Generate files, synchronize a live database, and create mock data.