The AI-First Clean Architecture Framework for Flutter.
Zuraffa is a comprehensive toolkit designed to streamline Flutter development by enforcing Clean Architecture principles, ensuring type safety, and integrating seamlessly with modern AI coding assistants via MCP.
- π€ AI-Native (MCP): The first Flutter framework with a built-in Model Context Protocol server. AI agents (Trae, Cursor, Windsurf) can understand, generate, and refactor your code with 100% precision.
- ποΈ Clean Architecture by Default: Strict separation of Domain, Data, and Presentation layers. No more spaghetti code.
- π‘οΈ Type-Safe Everything: Uses
Result<T, AppFailure>for error handling. Stop catching exceptions; start matching results. - β‘ Zero Boilerplate: The
zfaCLI handles the heavy liftingβUseCases, Repositories, VPCs (View-Presenter-Controller), and Tests are generated in seconds. - π§© Smart Caching & Sync: Built-in patterns for offline-first apps with configurable cache policies and automatic sync.
- π§ͺ Mock-Ready: Instant mock data generation for rapid prototyping without a backend.
Zuraffa exposes your project structure to AI agents through its MCP Server. This allows AI to:
- Contextual Generation: "Add a 'PlaceOrder' usecase to the existing 'Cart' domain."
- Smart Refactoring: "Rename this entity field and update all related layers."
- Automated Diagnostics: AI can run
zfa doctorand fix architectural violations automatically.
To enable, just install Zuraffa. Compatible IDEs will detect the server automatically.
Add Zuraffa to your pubspec.yaml:
dependencies:
zuraffa: ^4.1.0
dev_dependencies:
zuraffa: ^4.1.0
build_runner: ^2.4.0
zorphy_annotation: ^1.7.0 # Required for supercharged entitiesActivate the CLI globally:
dart pub global activate zuraffazfa initZuraffa uses Zorphy for immutable, type-safe entities.
zfa entity create -n Product --field name:String --field price:double --field stock:intGenerate the full stack (Domain, Data, Presentation, Tests) in one go:
# Using Repository/DataSource (Default)
zfa feature scaffold Product --methods=get,getList,create --mock --vpcs --state --test
# Using Service/Provider (Alternative)
zfa feature scaffold Product --methods=get,getList --use-service --mock --vpcs --state --testNeed just a specific part? Use zfa make:
zfa make Search usecase --domain=search --params=SearchRequest --returns=Listingzfa build| Command | Description |
|---|---|
zfa feature |
High-level command to generate full feature slices. |
zfa make |
Low-level command for granular generation (UseCases, Mocks, DI, etc.). |
zfa entity |
Create and manage Zorphy entities with field validation. |
zfa doctor |
Lints your architecture and suggests fixes. |
zfa build |
Optimized wrapper for build_runner. |
Accidentally added a method or plugin? Use --revert to undo the change. Zuraffa's AST-aware reverter will remove only the specific code added, preserving your manual changes.
zfa make Product usecase --methods=watch --revertEvery boolean flag has a --no- counterpart to explicitly disable features.
zfa feature Product --data --no-zorphy # Generate data layer but skip Zorphylib/src/
βββ data/ # Models, DataSources, Repository Impls
βββ domain/ # Entities, Repository Interfaces, UseCases
βββ presentation/ # VPC (View, Presenter, Controller, State)
βββ di/ # Automated Dependency Injection (GetIt)
- Documentation: zuraffa.dev
- Example Project: Github Example
- Discord/Community: Join us!
Made with π¦ and β‘οΈ by Arrrrny.