Documentation
Learn Guren,
end to end.
Guides for every subsystem — routing, models, auth, queues — and two courses that build a working app: one by hand, one by directing a coding agent. Every page starts with code you can run.
Start here
- QuickstartGet startedA fresh app running in about five minutes on SQLite, then the full setup when you need it.
- TutorialBuild a blog by handFrom an empty directory to a deployed blog with users, comments and uploads, one chapter at a time.
- Agent courseBuild with an agentReview and approve each plan, then watch a coding agent build a meetup app one step at a time.
Guides
76 pagesGetting Started
- Guren at a GlanceThe fullstack TypeScript framework that feels like Laravel, powered by Bun.
- Why GurenAn honest look at where Guren fits (compared with Hono, Next.js, AdonisJS, and Laravel) and why it is built the way it is.
- Fullstack on BunBun ships a runtime, a package manager, a bundler and a test runner, and its dev server can serve HTML pages next to API routes.
- Getting StartedThis guide has two parts.
- First Steps: A 10-Minute Tour of One RequestThis tour follows a single request, GET /posts, through every layer of a Guren app: route, controller, validation, model, resource, Inertia page, and test.
- ConfigurationA Guren app keeps its configuration in config/.
- ArchitectureGuren reimagines Laravel's design principles in TypeScript, tying together Bun, Hono, Inertia.js, React, and Drizzle ORM into a full-stack MVC framework.
The Basics
- RoutingRoutes map a method and a URL to the code that answers it: a controller action or an inline handler.
- Route ContractsA route contract is the options object you pass as the second argument when you register a route.
- ControllersControllers are where your application logic lives.
- Middleware GuideMiddleware runs code around a request: before the controller action, after it, or instead of it.
- CSRF ProtectionCross-Site Request Forgery (CSRF) protection prevents malicious websites from submitting forms on behalf of authenticated users.
- ValidationValidate request input against a schema and get typed, parsed values back.
- Error HandlingAn exception thrown anywhere in a request ends up at the ExceptionHandler, which decides what gets reported and what the client sees.
- DatabaseGuren reads and writes the database through models built on Drizzle tables, with a query API shaped like Laravel's Eloquent and typed from your schema.
- ModelsA model wraps one table from db/schema.ts.
- RelationshipsDeclare relationships next to the model that owns them, then eager-load them everywhere.
- Frontend GuideGuren delivers a single-page application experience by combining Inertia.js with React.
- Inertia Protocol SupportGuren ships its own Inertia server adapter inside @guren/core, written against the Inertia protocol as @inertiajs/react 3 speaks it.
- Server-Rendered Viewsthis.view() renders a JSX component to a plain server-rendered HTML response, the non-hydrating counterpart to this.inertia() for public, read-mostly pages: blog posts, docs, marketing pages.
Security
- Authentication GuideAdd sign-in, registration and password reset to an app with one command, then protect routes and read the signed-in user in controllers.
- SessionsA session keeps per-browser state between requests, and the session guard stores the signed-in user's identifier in it.
- OAuth GuideGuren ships an OAuth 2.0 authorization-code flow for "Sign in with GitHub / Google / Discord" style login.
- AuthorizationAuthorization determines what an authenticated user is allowed to do.
- API Tokens GuideGuren provides a secure API token system for authenticating API requests.
- Password Reset GuideGuren provides a secure password reset system with token generation, verification, and expiration.
- Email Verification GuideGuren provides a secure email verification system with token generation, verification, and expiration.
- Encryption & HashingGuren provides utilities for encrypting data and hashing passwords securely.
Digging Deeper
- Events GuideGuren provides a simple yet powerful event system for decoupling components in your application.
- Queue GuideThe queue moves slow work off the request: sending mail, processing uploads, calling an external API.
- Cache GuideThe cache stores the result of slow work, such as a database query or a computation, under a key so the next request can read it back.
- Mail GuideGuren provides a fluent API for sending emails with support for multiple transport backends.
- Notifications GuideGuren provides a unified API for sending notifications across multiple channels like email, database, Slack, and more.
- Broadcasting GuideGuren provides a broadcasting system for real-time event broadcasting to connected clients.
- Live PropsA live prop reloads itself when a broadcast event says its data changed.
- Storage GuideGuren provides a unified file storage API with support for multiple storage backends.
- Attachments GuideAttachments connect uploaded files to your models: a Post has a cover
- Task Scheduling GuideGuren provides a fluent API for defining scheduled tasks within your application.
- Console CommandsConsole commands let you run application code from a terminal (backfills, one-off maintenance, reports) with the same models, services, and container your HTTP handlers use.
- Rate Limiting GuideGuren provides a flexible rate limiting system to protect your application from abuse.
- Logging GuideGuren provides a flexible logging system with multiple channels, log levels following RFC 5424, and contextual logging support.
- Health ChecksA health manager runs the checks you register (database, Redis, cache, storage, process memory, or one you write yourself) and reports healthy, degraded, or unhealthy.
- Internationalization (i18n) GuideGuren ships internationalization end to end: file-based translation catalogs, per-request locale detection, translation helpers in controllers and React pages, pluralization rules for 15+ languages, typed translation keys, and a consistency checker for your catalogs.
- API ResourcesAPI Resources provide a transformation layer between your models and API responses.
- OpenAPIGuren generates an OpenAPI 3.1 document from your routes.
- Markdown Rendering@guren/plugin-markdown renders markdown to HTML with hardened defaults: GitHub Flavored Markdown, sanitized output safe for dangerouslySetInnerHTML, GitHub-style alerts, heading anchors, and optional shiki code highlighting.
Testing & Deployment
- TestingTest your app over HTTP with TestApp: send a request through the real middleware and routes, then assert on the response.
- Deployment GuideThis guide summarizes the steps required to promote a freshly scaffolded Guren application to production.
- Serverless Deployment (AWS Lambda)Guren runs on AWS Lambda's Node.js runtime.
- Deploy a Fullstack Bun App to Cloudflare WorkersYou develop a Guren app on Bun and deploy the same code to Cloudflare Workers, with D1 as the database and R2 for files.
- Production Operations RunbookThis runbook defines minimum reliability operations before GA.
AI-Native Development
- Spec-Anchored DevelopmentAI agents write code faster than anyone can keep documentation honest by
- Prototype FirstSpecifications written as documents get argued about; specifications a customer can click get corrected.
- Implementation PlansAn implementation plan is a design document for a change, written as JSON before any code exists.
- Writing an Implementation PlanThis page describes the plan file itself: its sections, element ids and changes, acceptance behaviours, questions and commands.
- Generating Code and Tests from a Planplan:next sends scaffold and tests steps to plan:scaffold, which writes code and test skeletons from an approved plan.
- Implementation Plan Reference: Approval and VerificationThis page collects the rules behind approval and verification, for when a verdict surprises you.
- Agent InterfaceAI agents call applications over MCP.
- Control and Audit Agent Tool AccessOnce routes are served as agent tools (see Agent Interface),
- MCP AppsAn MCP App renders a tool's result as a page inside the agent's host.
- AI AgentsAn AI agent is a class in your application that calls a language model and reaches the application only through the agent tools its routes already declare. @guren/plugin-ai builds it on the Vercel AI SDK: the SDK talks to the provider, and the plugin decides which of your routes the model may call, as whom, and what gets recorded.
- Testing AI AgentsAn agent is tested at two levels.
- Durable AgentsA durable agent is a long-lived, stateful process your own application hosts, and it reaches that application only through the agent tools the routes already declare.
- Agent HarnessApps scaffolded with create-guren-app include an AI agent harness: files that teach coding agents how to work in a Guren app, and hooks that run Guren's checks while they work.
- Application Graph and Runtime Errorsbunx guren graph reports how your app is wired: its routes, controllers, models, Inertia pages, middleware, validators, policies and tests, and the evidence that links them. bunx guren runtime:errors lists the server errors the running development app hit recently.
Reference
- Build an Auth AppThis guide walks you through building an application with user registration, login, and protected routes.
- Ship an APIThis guide walks you through building and shipping a JSON API with Guren.
- Deploy to ProductionThis guide covers the essential steps to take a Guren application from local development to a production environment.
- Troubleshoot a Broken SetupThis guide covers the most common issues you will encounter when developing with Guren and how to fix them quickly.
- CLI ReferenceGuren ships with two companion CLIs:
- Checks and Audits in DepthThe CLI Reference lists check, audit, gate, introspect and doctor.
- Plugin Authoring GuideThis guide walks you through creating, testing, and publishing a Guren plugin.
- Support Matrix| Runtime | Versions | Status |
- Upgrading GurenUse this guide when you move an app to a newer version.
- Release & Compatibility PolicyThis document defines the minimum release contract for production use.
- GlossaryShort definitions for common terms in the Guren docs.
Tutorials
16 pagesFoundations
- Chapter 1: Zero to a Shipped AppIn this chapter you scaffold a Guren app, read what the scaffold gave you, make one change by hand with a test in front of it, hand one change to a coding agent and watch the harness check its work, and finish with a container image you can run anywhere.
- Chapter 2: One Request, by HandChapter 1 gave you an app with one page you did not write.
- Chapter 3: The Posts TableA blog needs posts, and posts need somewhere to live.
- Chapter 4: Validation and ResourcesChapter 3 put a schema inside the controller and sent raw field maps to the pages.
Users
- Chapter 5: Users and PasswordsEverything so far has been anonymous.
- Chapter 6: Protecting RoutesThe blog has users now, but nothing checks for one: a guest can still write, edit and delete posts, and guren audit has been saying so since chapter 3.
- Chapter 7: Authorization, and What the Gate Cannot SeeChapter 6 built a wall: you have to be signed in to change a post.
Data
Agents
Agent Course
9 pagesStart here
The first plan
- Chapter 2: The First PlanA plan is the design of a change, written as JSON before any code exists.
- Chapter 3: Review and ApproveChapter 2 ended with a list: one open question, five missing behaviours.
- Chapter 4: One Step at a TimeThe plan is approved.
- Chapter 5: Close the PlanOnce a plan is built, plan.json goes quiet: nobody edits an approved plan to describe code that exists.