Entity-First Architecture
Define your data model once. Nevr generates your database schema, REST API, auth rules, and client SDK automatically.
Define your data model once. Get a type-safe API, database schema, auth, and client — automatically.
Building backends today means gluing together an ORM, a framework, validation libraries, and auth middleware — then manually keeping types in sync.
Nevr changes that. Define your entity once, and everything else is derived from it.
// Define your entity — this is your entire backend for a resource
const post = entity("post", {
title: string.min(1).max(200),
content: text,
author: belongsTo(() => user),
})
.ownedBy("author")
.rules({
create: ["authenticated"],
read: ["everyone"],
update: ["owner"],
delete: ["owner", "admin"],
})From this single definition, you get:
POST /api/posts — Create (validated, auth-protected)GET /api/posts — List (filtered, sorted, paginated)GET /api/posts/:id — Read (with relation includes)PUT /api/posts/:id — Update (ownership enforced)DELETE /api/posts/:id — Delete (ownership enforced)Nevr provides the architectural primitives needed to build scalable, real-world applications.
Define complex multi-step operations with automatic failure handling.
action().workflow([
step("reserve", inventory.reserve, inventory.release),
step("charge", stripe.charge, stripe.refund),
step("fulfill", shipping.create),
])Functional dependency injection that keeps your code testable and decoupled.
// Register once, use anywhere
api.register(Payment, new Stripe())
const payments = ctx.resolve(Payment)Merge data from external APIs as if it were in your local database.
// User in DB, Sub in Stripe
belongsTo(() => sub).remote("stripe")
// API Response: { user, sub }