Start your project in minutes, on your own architecture
Pick the architecture you already work with: Clean Architecture, N-tier, DDD or a single project. One command gives you a running solution with Attritect fully wired in: CRUD pages from attributes, validation, permissions, Arabic and English, an OpenAPI document, tests, and the AI kit for your coding assistant.
dotnet new install Attritect.Templates
dotnet new attritect-cleanarch -n MyApp
dotnet run --project MyApp/src/MyApp.Web
That’s real output from a freshly created app: search, sorting, paging and validation, with no controller, no DTOs and no query code.
Choose your architecture
| Template | Command | Projects | Best for |
|---|---|---|---|
| Clean Architecture | dotnet new attritect-cleanarch -n MyApp | Domain · Application · Infrastructure · Web | Most business apps and SaaS products |
| N-tier | dotnet new attritect-ntier -n MyApp | Presentation · Business · Data | Teams used to classic layered .NET apps |
| DDD | dotnet new attritect-ddd -n MyApp | A pure domain model (factories, behavior methods, domain events) driven by the engine through domain adapters | Rich domains with real business rules |
| Minimal | dotnet new attritect-minimal -n MyApp | One project, one page | Trying Attritect in two minutes |
Every solution template has the same sample (Categories and Products), so you can compare the architectures side by side. Add --db sqlserver to use SQL Server instead of SQLite.
What you get
- Working pages: Categories and Products, with search, sorting, paging, a category lookup, validation and unique checks, at
/api/crud/{page}. - Your architecture, enforced: the architecture (or tier) tests fail the build when a layer uses something it mustn’t, for example the Domain referencing EF Core.
- Integration tests that run the real API on a throwaway database.
- Arabic and English from day one: titles, labels and messages from
.resxfiles, right to left in Arabic. - Ready to run: the database is created on first run, and an OpenAPI document is served at
/openapi/v1.json. - The AI kit:
AGENTS.mdand the skills, so Claude Code, Cursor, Copilot or Windsurf follow Attritect’s rules from the first prompt. See AI and vibe coding.
Add your next page
One command creates the page model and its business-rules class:
dotnet new attritect-page -n Supplier -o src/MyApp.Application/Catalog --entity-namespace MyApp.Domain.Catalog
Or ask your AI assistant, in business words:
Add a Suppliers page: name (required, unique), phone, email, country as a lookup. Searchable by name and country.
The kit’s attritect-add-feature skill writes the entity, the EF configuration, the page, the translations and the tests, then builds and runs them.
Building a SaaS
Multi-tenancy is built into the engine. To make your app multi-tenant:
- Turn it on:
o.UseMultiTenancy<int>()inAddCrudEngine. - Give tenant-owned entities a
TenantId; pages over them become tenant data automatically. - Have your sign-in issue
tenant_idclaims.
From then on, every list, get, lookup and unique check is filtered to the caller’s tenant, new rows get the caller’s tenant, and another tenant’s row is a 404. Details: Security and multi-tenancy.
A --tenancy option that sets all of this up in the templates, with a tenant-leak test, is next on the roadmap.
Before you go live
- Replace the development sign-in. In Development every request is signed in as a developer with every permission (
Security/DevelopmentSignIn.cs). Use ASP.NET Core Identity, OpenID Connect or similar, issuingpermissionclaims such ascrud:products:view. - Start using migrations when your model settles; the generated
README.mdshows the two commands.
Keep the templates current
dotnet new update
The templates follow the Attritect packages: version 0.2.0 of the templates creates apps on Attritect 0.2.0.