Maat Documentation
Maat is a backend framework for Dart. It brings together routing, middleware, validation, dependency injection, database access, authentication, mail, notifications, and realtime features behind one consistent application lifecycle.
If you have used Laravel, the structure will feel familiar. Maat keeps the productive conventions while using Dart’s type system, async model, and native compiler directly.
New to Maat?
Start with Build Your First Maat Application. You will create, validate, test, and run a JSON endpoint in one short guide.
Create an Application
You can create and run a new application with four commands:
dart pub global activate ptahmaat new blogcd blogmaat serveOpen http://127.0.0.1:8000 or request the generated health endpoint at
http://127.0.0.1:8000/api/health.
Why Maat
Maat is designed for teams that want a full web framework without giving up the strengths of Dart:
- Typed application code. Controllers, middleware, models, commands, and services are ordinary Dart classes.
- No reflection. The application behaves the same in development and in an ahead-of-time compiled executable.
- One deployment artifact. Production builds use
dart build cliand do not require a Dart SDK on the server. - Familiar conventions. Routes, service providers, validation rules, migrations, resources, and feature tests follow a predictable vocabulary.
- Explicit wiring. Configuration and providers are registered in code, so dependencies remain visible and analyzable.
Learn the Framework
Start Here
- Installation explains the requirements, installer, and local server.
- Build Your First Maat Application walks through a validated endpoint and its test.
- Directory Structure shows where application code belongs.
- Configuration covers
.envand dot-notation config.
Handle HTTP Requests
- Routing, Controllers, and Middleware define the request pipeline.
- Requests, Validation, and Responses cover input and output.
- Error Handling explains how exceptions become safe responses.
- Views, Frontend, and Assets cover server-rendered applications.
Store and Protect Data
- Database, Seshat ORM, and Migrations cover persistence.
- API Resources define public JSON shapes.
- OpenAPI and Typed Clients export route contracts and generate null-safe Dart clients.
- Authentication, Cartouche, and Anubis protect token- and session-authenticated routes.
- Vizier builds a resource-driven admin panel over those routes, with tables, forms, actions, and direct and polymorphic relation managers.
Build Application Features
- Service Container and Service Providers explain application wiring.
- Events, Mail, and Notifications connect domain actions to delivery.
- Task Scheduling puts recurring work in Dart behind one cron entry.
- Akhet watches the queues those jobs run on — depth, throughput, failures, and one-click retry.
- Udjat records what a request or job did — queries, exceptions, logs, mail, and more — correlated into one batch and viewable in Vizier.
- Mekhat renders what Udjat collected about the request you are looking at directly into the page, as an in-page request bar.
- Broadcasting and WebSockets add realtime updates.
- Typed Realtime Clients delivers those updates to Dart
and Flutter as
Stream<OrderUpdated>.
Test and Ship
- Sesh Console documents generators and application commands.
- Djed provides trusted local
.testdomains on macOS. - Testing covers the in-process HTTP client, fakes, factories, and database reset helpers.
- Deployment covers native builds, containers, proxies, and production checks.
- Coming From Laravel maps familiar concepts to Maat’s Dart APIs.
Community Extensions
- Community Extension Checklist is what a package must show before it is linked from the directory.
- Community Extensions is the curated, human- reviewed directory itself.
Example Applications
Each one is a runnable package in this repository with its own README.
- Todo builds a server-rendered site: routes, Khnum templates, validation, and realtime updates through Thoth.
- Catalog exports route contracts as OpenAPI and generates a typed Dart client from them.
- Orders delivers an authenticated broadcast to a Dart client as a typed stream.
- Maintenance serves a JSON API and a Vizier admin panel from one application, with one field definition read by both.
- Resident App consumes that API from Flutter using nothing but the generated client.
- Maintenance Client is that generated
client, packaged so both sides can import it by
package:URI.
Production Model
Maat applications compile ahead of time:
dart build cli --target=bin/server.dart --output=build./build/serverThe resulting executable contains your application and its Dart dependencies. Runtime configuration still comes from environment variables, so the same artifact can move between staging and production.