# ZURAFFA

AI-First Clean Architecture for Flutter

A comprehensive framework with built-in MCP server support. Type-safe error handling, zero boilerplate, and AI-native generation for modern developers.

Install 3.19.0 Read Docs
The CLI

## Generate in
Seconds

The zfa CLI generates complete Clean Architecture boilerplate. UseCases, repositories, controllers, views—all from a single command.

zfa — Terminal
$ zfa generate Product --methods=get,getList,create,update,delete --data --mock --di --cache --test --dry-run
The Code

## Elegant by Design

Write Flutter code that reads like poetry. Type-safe, expressive, and maintainable. Zuraffa handles the complexity so you can focus on what matters.

View Example →

    // Define a UseCase
    class GetUserUseCase extends UseCase<User, String> {
      final UserRepository _repository;

      GetUserUseCase(this._repository);

      @override
      Future<User> execute(
        String userId,
        CancelToken? cancelToken
      ) async {
        return _repository.getUser(userId);
      }
    }

    // Use it in a Controller
    final result = await getUserUseCase('user-123');

    result.fold(
      (user) => showUser(user),
      (failure) => showError(failure),
    );

Features

## Crafted for
Excellence

### Result Type

Type-safe error handling with sealed classes. Pattern match successes and failures with compile-time guarantees.

TYPE-SAFE

### UseCase Patterns

Single-shot, streaming, and background operations. One pattern, infinite possibilities for your business logic.

FLEXIBLE

### CLI Tool

Generate boilerplate with a single command. Full stack, half the effort. Focus on logic, not structure.

PRODUCTIVE

### Controller & CleanView

State management that gets out of your way. Automatic cleanup, lifecycle hooks, and fine-grained rebuilds. Just build your UI.

EFFORTLESS

### MCP Server

AI/IDE integration via Model Context Protocol. Let Claude generate your architecture. Seamless workflow.

INNOVATIVE

### Mocking

Generate realistic mock data for development and testing. Work without backend services, prototype quickly.

OFFLINE

### Caching

Dual datasource pattern with configurable cache policies. Offline-first with automatic sync strategies.

PERFORMANCE

### Dependency Injection

Automated DI setup with get_it. Clean separation of concerns, easy testing, and flexible composition.

ORGANIZED

### GraphQL Generation

Auto-generate type-safe queries, mutations, and subscriptions. Connect to any GraphQL API with minimal boilerplate and full type safety.

TYPE-SAFE