Skip to main content

DAZZLE — declarative SaaS framework with built-in compliance (SOC 2, ISO 27001), provable RBAC, and graph features

Project description

DAZZLE

Model your business. Ship your product. Pass your audit.

Python 3.11+ Homebrew

CI codecov Ruff Checked with mypy

Docs License: MIT GitHub stars

Dazzle is a declarative framework for building SaaS applications. You describe your business — its data, its users, its rules, its workflows — in structured .dsl files. Dazzle gives you a working web application with a database, API, UI, authentication, role-based access control, and compliance evidence. No code generation, no build step, no scaffold to maintain.

cd examples/simple_task && dazzle serve
# UI:  http://localhost:3000
# API: http://localhost:8000/docs

Why Dazzle

Your business model IS the application

Most frameworks ask you to express your business logic across scattered files — controllers, models, migrations, middleware, templates. When requirements change, you update all of them and hope they stay in sync.

Dazzle inverts this. You write what your business is — entities, roles, permissions, workflows, state machines — and the runtime executes it directly. Change the DSL, refresh the browser. The DSL is the single source of truth for your application, your API spec, your test suite, and your compliance documentation.

Built for the compliance conversation

If you're building SaaS — especially in regulated industries — you will face auditors. They will ask: who can access what? how are changes controlled? where is sensitive data classified?

Most teams answer these questions retroactively, combing through code to produce evidence. Dazzle answers them by construction:

  • Access control is declared in the DSL and provably enforced. Every permission is statically verifiable.
  • State machines model approval workflows, transitions, and four-eyes authorization.
  • Compliance evidence is extracted automatically. Run dazzle compliance compile --framework soc2 and get a structured audit report showing which controls your DSL satisfies.
  • Grant-based RBAC supports delegated, time-bounded access with approval workflows — the kind of access governance auditors want to see.

Dazzle currently supports ISO 27001 and SOC 2 Trust Services Criteria out of the box, with automatic evidence mapping from your DSL declarations to specific framework controls.

From idea to running product, fast

module my_app
app todo "Todo Application"

entity Task "Task":
  id: uuid pk
  title: str(200) required
  completed: bool=false
  created_at: datetime auto_add

surface task_list "Tasks":
  uses entity Task
  mode: list
  section main:
    field title "Title"
    field completed "Done"

Save this as app.dsl, run dazzle serve, and you have:

  • A PostgreSQL-backed database with correct types and constraints
  • CRUD API endpoints with pagination, filtering, and sorting
  • A rendered list UI with sortable columns, search, and a create form
  • OpenAPI documentation at /docs
  • A health endpoint with deployment integrity verification

That's a todo app. But the same language scales to 39-entity accountancy platforms with double-entry ledgers, multi-step onboarding wizards, and role-based dashboards. You add complexity only where your business needs it.


What You Can Model

Capability What it does Why it matters
Entities Data models with types, constraints, relationships Your domain model, declared once
Surfaces List, detail, create, review views UI and API from the same declaration
Workspaces Role-based dashboards with filtered regions Each persona sees what they need
State Machines Lifecycle transitions with guards and approval Business processes enforced, not just documented
Access Control Cedar-style permit/forbid rules, scope predicates Provable RBAC — auditors can verify mechanically
Grant Schemas Delegated, time-bounded access with approval Four-eyes authorization, SOC 2-ready
Processes Multi-step workflows with saga patterns Durable business operations
Experiences Onboarding wizards, checkout flows Guided multi-step user journeys
Ledgers TigerBeetle-backed double-entry accounting Financial-grade transaction integrity
Graphs Entity relationships with CTE traversal and algorithms Network analysis, shortest paths, community detection
Integrations Declarative API bindings with triggers and mappings Connect to Stripe, HMRC, Xero, and more
LLM Jobs Classification, extraction, generation tasks AI capabilities without prompt engineering sprawl
Compliance Automated evidence extraction for ISO 27001 and SOC 2 Audit-ready from day one

For the full DSL reference, see docs/reference/index.md.


Compliance and Security

Dazzle treats compliance as a first-class concern, not an afterthought.

Automated evidence extraction

Every DSL construct that relates to security — access rules, data classification, state machine transitions, process workflows — is automatically mapped to compliance framework controls. Run:

dazzle compliance compile --framework iso27001   # ISO 27001 audit
dazzle compliance compile --framework soc2       # SOC 2 TSC audit
dazzle compliance gaps --framework soc2          # Show unmet controls

The output is a structured AuditSpec showing which controls are evidenced (your DSL satisfies them), which are gaps (your DSL should cover them but doesn't), and which are excluded (physical security, HR — outside DSL scope).

Provable access control

Scope rules compile to a formal predicate algebra, statically validated against the FK graph at dazzle validate time. The verification framework has three layers:

Layer What it proves
Static Matrix Every (role, entity, operation) combination is computed from the DSL
Dynamic Verification The running app is probed as every role to confirm runtime matches the matrix
Decision Audit Trail Every access decision is logged with the matched rule and outcome
dazzle rbac matrix    # Generate the access matrix (no server needed)
dazzle rbac verify    # Verify runtime matches the matrix (CI gate)
dazzle rbac report    # Compliance report for auditors

See RBAC Verification and Compliance for details.


Quick Start

# Install
brew install manwithacat/tap/dazzle   # macOS/Linux (auto-registers MCP server)
# or: pip install dazzle-dsl

# Run the example
cd examples/simple_task
dazzle serve

# Open http://localhost:3000 for the UI
# Open http://localhost:8000/docs for the API

AI-Assisted Development

Dazzle ships as both a runtime and an AI development environment. When used with Claude Code (via MCP), you get access to 26 tools with 170+ operations that span the full lifecycle:

Stage What the tools do
Spec to DSL Turn a natural-language idea into validated DSL — entity discovery, lifecycle identification, persona extraction
Test and Verify Generate stories, design tests, execute at three tiers (API, browser, LLM-guided), seed demo data
Analyze and Audit Quality pipeline, agent-powered gap discovery, visual composition analysis, RBAC policy verification
Site and Brand Manage public site structure, copy, theme, and design tokens from spec files
Stakeholder Ops Launch readiness scores, investor pitch generation, user/session management

The agent framework uses an observe-decide-act-record loop to autonomously explore running applications, discover gaps, and propose DSL fixes. Discovery modes include persona-based exploration, CRUD completeness analysis, workflow coherence checks, and headless DSL/KG analysis.

For the full MCP tool reference, see Architecture: MCP Server.

Claude Code Integration

# Homebrew: MCP server auto-registered during installation
brew install manwithacat/tap/dazzle

# PyPI: Register manually
pip install dazzle-dsl
dazzle mcp-setup

# Verify
dazzle mcp-check

Architecture

DSL Files  →  Parser + Linker  →  AppSpec (IR)  →  Runtime (live app)
                                                 →  OpenAPI / AsyncAPI specs
                                                 →  Test generation
                                                 →  Compliance evidence
                                                 →  Fidelity scoring

The DSL is parsed into a typed intermediate representation (AppSpec IR). The runtime executes the IR directly — no code generation step. Every artifact (API specs, tests, compliance reports, demo data) is computed from the same IR.

This architecture is deliberately anti-Turing: the DSL has no arbitrary computation, which means Dazzle can statically validate, lint, measure fidelity, and reason about your application. What you declare is what runs.

The frontend uses server-rendered HTML with HTMX — zero build toolchain, stable technology, and full visibility into what the runtime produces.

For the full architecture, see docs/architecture/overview.md.


Examples

Example Complexity What it demonstrates
simple_task Beginner 3 entities, state machine, personas, workspaces, access control
contact_manager Beginner CRM with relationships and list/detail surfaces
support_tickets Intermediate Ticket lifecycle with state machines and assignments
ops_dashboard Intermediate Workspace stages and aggregate metrics
fieldtest_hub Advanced Full-featured demo with integrations
pra Advanced 15 DSL files covering every construct: ledgers, processes, LLM, services

IDE Support

Full LSP implementation: real-time diagnostics, hover docs, go-to-definition, auto-completion, document symbols.

dazzle lsp run           # Start the LSP server
dazzle lsp check         # Verify dependencies
dazzle lsp grammar-path  # TextMate grammar for syntax highlighting

Works with VS Code, Neovim, Emacs, and any editor supporting LSP. See docs/reference/index.md for editor setup.


Documentation


Contributing

All contributions require AI co-authorship. See CONTRIBUTING.md.

License

MIT - see LICENSE

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dazzle_dsl-0.49.3.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dazzle_dsl-0.49.3-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

Details for the file dazzle_dsl-0.49.3.tar.gz.

File metadata

  • Download URL: dazzle_dsl-0.49.3.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dazzle_dsl-0.49.3.tar.gz
Algorithm Hash digest
SHA256 7a8e31dd250a26a6de164ab674b0fdd60ddabc8652d6f6f7f43d8b71edde9e7c
MD5 ed3cdfc79c49b65c27d11a8a5084acc1
BLAKE2b-256 22e0b520918090429309ac6af6f6ecbafa20a4475fde2cdd89e3d8fe8289b04a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dazzle_dsl-0.49.3.tar.gz:

Publisher: publish-pypi.yml on manwithacat/dazzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dazzle_dsl-0.49.3-py3-none-any.whl.

File metadata

  • Download URL: dazzle_dsl-0.49.3-py3-none-any.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dazzle_dsl-0.49.3-py3-none-any.whl
Algorithm Hash digest
SHA256 02aa404fdb4bac5aedbe63e47cb4dd198337fb1e341104270e250162d330c81d
MD5 9ed0ae5e777b87a47edb3923cf19c759
BLAKE2b-256 9b56da3b8d488ea93f9cd59920eb91234c60d1f6105446689ac706f77ec744e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for dazzle_dsl-0.49.3-py3-none-any.whl:

Publisher: publish-pypi.yml on manwithacat/dazzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page