
The New Way to Build
Web Servers
GraphQL-like flexibility with unmatched performance.
Client-driven projections, automatic relationships, end-to-end TypeScript safety.
npm install @hemedani/lesan mongodbEverything You Need
Built for modern developers who demand performance, type safety, and flexibility.
Extreme Performance
Much faster than traditional ORMs or GraphQL with client-driven projections.
Type Safety
End-to-end TypeScript safety with automatic type inference.
Auto Relations
Automatic bi-directional relationships between models.
Client Projections
Fetch only the data you need, reducing payload size.
MongoDB Ready
Full MongoDB compatibility with modern developer experience.
Cross Platform
Works seamlessly on Node.js, Bun, and Deno.
Relationships That Think for Themselves
Lesan's relationship engine is the heart of the framework. Define a relation once, and both sides stay in perfect sync โ automatically. No SQL joins, no hand-written embedding logic, no stale denormalized copies.
๐๏ธSQL
- Only a single foreign key connects the two sides
- Each side lives independently โ no shared data
- Deleting a referenced row just throws an error
- Side effects of a relation are hidden, not visible
๐NoSQL (naive)
- Embedding is a one-way street โ data goes stale
- You hand-write sync logic on every insert/update/delete
- No management of deletions on either side
- You maintain pagination windows yourself
๐Lesan
- Both sides embed a pure snapshot of each other
- Insert, update, delete and re-limit are fully automatic
- Dependent deletes are blocked or cascade recursively
- Every side effect is visible at the definition point
Define Once, Both Sides
Declare a relation from the important side, and Lesan builds the embedded snapshot on both documents โ no extra code to keep them in sync.
One Query, Full Data
Because relations live inside the document, a country arrives with its cities, its most populous cities, and its users already embedded. One request, not three.
Explicit Side Effects
Each relatedRelations block spells out exactly what happens on the other side โ limits, sorts, and cascading deletes. Nothing is hidden.
Built for Speed
Extreme performance without compromising developer experience.
Than traditional ORMs
Zero runtime overhead
End-to-end TypeScript
Benchmarks run on Apple M2 Max, querying 10,000 documents with relationships.
Write Less, Do More
Intuitive API that feels natural and requires minimal boilerplate.
import { lesan } from "@hemedani/lesan";// Define your modelconst User = lesan.model("User", { name: "string", email: "string", posts: "relationship",});// Create serverconst server = lesan.serve({ port: 8080,});// Add routesserver.get("/users", async () => { return await User.find({ projection: { name: 1, email: 1, "posts.title": 1, }, });});Client-Driven Projections
Fetch only the fields you need, reducing payload size and improving performance.
Auto Relations
Bi-directional relationships are handled automatically. No manual foreign keys.
Type Safe
Full TypeScript support with automatic type inference from your models.
Production Ready
Built with modern best practices and trusted by developers worldwide.
Built with Lesan
Lesan isn't just a framework โ it's already powering production applications.
ZiWound
A full-stack war crimes documentation platform built entirely with Lesan โ a serious, production-grade application demonstrating Lesan at scale. Users submit reports with geolocation and file attachments, explore documented incidents through interactive maps, read blog articles, and admins manage everything from a full dashboard.
ZiWound is open source โ the entire codebase is on GitHub, so you can read the real models, acts, and utilities to see how Lesan powers a production app.
Ready to Build
Something Amazing?
Join thousands of developers who are already building faster, safer, and more efficiently with Lesan.