Your backend. Your code. Your infrastructure.
Build, deploy and scale production-ready backends with TypeScript. Develop locally, deploy to managed cloud or run your infrastructure yourself.
import { defineFunction } from "baclet";
// Illustrative example
export default defineFunction({
name: "createInvoice",
auth: "required",
async handler(ctx, input: { customerId: string; amount: number }) {
const invoice = await ctx.db.invoices.create({
customerId: input.customerId,
amount: input.amount,
status: "draft",
});
await ctx.email.send("invoice-created", { to: ctx.user.email });
return invoice;
},
});Platform
One integrated backend, not nine products.
Auth, data, functions, APIs, docs, email, storage and realtime share one type system and one runtime.
Authentication & authorization
Sessions, providers and role-based access rules, enforced where your data lives.
Database models
Typed models, queries and mutations on PostgreSQL. Bring your own database.
Custom backend functions
Plain TypeScript functions that run next to your frontend code.
Generated APIs
Every model and function gets a typed endpoint, with no hand-written routes.
OpenAPI & Swagger
Specs and interactive docs generated from the same types you ship.
Email & templates
Transactional email with versioned templates in your repository.
File storage
Uploads, signed URLs and access policies behind one interface.
Realtime
WebSocket channels that share the auth and data model of the rest of the backend.
CLI & dashboard
Develop from the terminal, inspect and operate from the web.
Developers
Code-first, from the first command.
All snippets below are illustrative. Final package names and SDK methods may differ.
1. Initialize
# Illustrative commands
npx create-baclet@latest my-app
cd my-app
baclet dev2. Define a function
// backend/functions/listPosts.ts
import { defineFunction } from "baclet";
export default defineFunction({
name: "listPosts",
async handler(ctx) {
return ctx.db.posts.findMany({ orderBy: { createdAt: "desc" } });
},
});3. Connect your frontend
// app/page.tsx
import { baclet } from "@/lib/baclet";
export default async function Page() {
const posts = await baclet.listPosts();
return <ul>{posts.map((p) => <li key={p.id}>{p.title}</li>)}</ul>;
}4. Call the generated API
# Generated endpoint and spec (illustrative)
curl https://api.example.com/functions/listPosts
open https://api.example.com/openapi.jsonInfrastructure
Run it where it makes sense.
The same code runs locally, on managed cloud or on your own infrastructure. Your database and hosting stay your choice.
Local development
Run the full backend on your machine with the same runtime you ship.
BACLET managed cloud
Push to a global, managed environment with no servers to operate.
Self-hosted
Run BACLET on your own infrastructure with the same code and configuration.
Workflow
From first line to production.
- 01
Write
Define models and functions in TypeScript, in the same repository as your frontend.
- 02
Run
Develop locally with the CLI. Types, APIs and docs update as you type.
- 03
Deploy
Ship to managed cloud or your own infrastructure when you are ready.
- 04
Operate
Inspect data, logs and usage from the dashboard.
Security & ownership
Built so you are never locked in.
You own the data
Connect your own PostgreSQL database. BACLET never requires you to move it.
You own the infrastructure
Self-host whenever you need to. Your code is portable.
Isolated control plane
Management and runtime are separated by design.
Read the documentation
Guides, concepts and references for every part of the platform.
Start building with BACLET.
Create your first backend in minutes. Early access is opening soon.
Get started