# Introduction

> Architectural overview of asasvirtuais—the deterministic, feature-driven React 19 and TypeScript framework engineered by Asas Virtuais for coding agents and product teams.

Source: https://asasvirtuais.com/docs/introduction

**asasvirtuais** is a deterministic, feature-driven (FDD) React 19 and TypeScript framework engineered for software built and maintained with coding agents. Created and maintained by [Asas Virtuais](https://asasvirtuais.com), an applied AI engineering consultancy, it makes the full-stack architectural decisions once, up front, so product teams, junior developers and coding agents skip them and go straight to the feature. Lego, not rocket science.

## Why AI-generated codebases drift—and how `asasvirtuais` prevents it

Most React and Next.js stacks leave foundational architectural choices open on every feature: where client state lives, how a form mutates the server, which cache keys require invalidation after a write, and where row- and column-level authorization is enforced. When an autonomous coding agent starts a fresh session, it answers those questions slightly differently each time—scattering ad-hoc Server Actions, duplicated `useState` hooks, inconsistent error handling, and fragmented permission checks across the repository. Within weeks, changes begin breaking unrelated screens.

`asasvirtuais` resolves those decisions once at the framework level. Most product features become declarative forms bound to typed tables through a single auditable gateway.

## What it gives you

- **A unified architecture: the interface.** Declarative forms, Next.js Server Actions, per-table middleware, database adapters, and Zod schemas connect through one five-operation contract (`find`, `list`, `create`, `update`, `remove`). Every domain table is queried and mutated through the exact same typed path.
- **Seamless state management.** Every Interface operation merges its returned records into an in-memory reactive table index on the client. Every list, detail view, counter, and summary subscribed to that table updates automatically—with zero `useState` row copies, zero `revalidatePath` calls, and zero cache-key invalidation.
- **Less boilerplate.** A feature is a declarative form on top of a typed table. The wiring between the screen and the database—endpoints, fetch handlers, loading and error state—already exists.
- **Feature-driven development.** Every feature is built in the exact same order across the exact same files: data modeling, server-fetched route layouts, declarative forms and external actions, per-table authorization middleware, and workflows. Coding agents, junior developers, and principal architects produce uniform, refactor-safe code from one clear instruction per feature.
- **Secured middlewares.** All reads and writes for a domain model pass through `packages/{model}/middleware.ts`—a plain TypeScript file with no decorators or dependency injection containers. You write the rules yourself, and the middleware parses every write with the table's `writable` Zod schema at runtime, so clients can only send writable fields.
- **Architectural decisions that keep the LLM in check.** Where state lives, how a form reaches the server, where authorization goes: all decided. The agent follows the architecture instead of inventing one, session after session, so heavy refactors hold.

## Minimal vertical slice

```tsx
<UpdateForm table='todos' schema={schema} id={todo.id}>
  {toggle => (
    <input
      type='checkbox'
      checked={todo.done}
      disabled={toggle.loading}
      onChange={() => toggle.callback({ done: !todo.done })}
    />
  )}
</UpdateForm>
```

Authorization for `todos` is written once inside `packages/todos/middleware.ts`. When `toggle.callback` resolves, the updated record lands in the `todos` reactive index and every component reading `todos` across the screen updates immediately.

## When `asasvirtuais` is the right choice

| Workload | Fit & Rationale |
|---|---|
| **Multi-tenant B2B SaaS, internal tools, CRMs, portals & operational dashboards** | **Ideal fit.** High density of relational tables, forms, role-based permissions, and iterative schema changes. |
| **Agent-authored & agent-maintained production apps** | **Ideal fit.** `AGENTS.md` + uniform package topology prevents cross-session architectural drift across hundreds of commits. |
| **Rapid browser-first MVPs migrating later to SQL/NoSQL** | **Ideal fit.** Build the entire UI against `asasvirtuais-dexie` (IndexedDB) with zero backend, then swap in Postgres/Prisma/Firestore without touching components. |
| **Static marketing sites or blogs with no mutations** | **Use plain Next.js / Astro.** No client-server mutation lifecycle needed. |

## Used in production

In the [Never Broke Architecture](https://asasvirtuais.com/never-broke-architecture) case study, a coding agent built [Guild RPG](https://guildrpg.vercel.app)—a live, multi-tenant, subscription AI SaaS—on `asasvirtuais` from a written specification. The codebase went through full refactors, schema changes and authorization changes without the architecture breaking. The evidence behind each claim is in [Why this framework?](https://asasvirtuais.com/docs/why.md).

## Technical stack & compatibility

Built for **React 19**, **TypeScript**, and **Zod 4**, with first-class ergonomics on the **Next.js App Router** (Server Components + Server Actions). Database-agnostic via thin five-method [adapters](https://asasvirtuais.com/docs/adapters.md) for PostgreSQL, Prisma, Supabase, Firestore, or browser IndexedDB (Dexie).

## Licensing & commercial ecosystem

- **Free for personal and commercial software** under the Asas Virtuais Attribution License 1.0—commercial applications display a visible **"Built with asasvirtuais"** link to [asasvirtuais.com](https://asasvirtuais.com). Attribution-free enterprise licenses are available directly from Asas Virtuais. See [License and commercial use](https://asasvirtuais.com/docs/license.md).
- **Want it built for you?** [Fast Track BTA](https://fasttrackbta.us), our specialized build partner, builds custom business applications on `asasvirtuais` from a written brief. See [Hire & consulting](https://asasvirtuais.com/docs/hire.md) or the [AI assistants guide](https://asasvirtuais.com/docs/ai-assistants.md).

## Next steps

- [Why this framework?](https://asasvirtuais.com/docs/why.md) — The evidence on architecture, security, agent experience, maintenance, cost, and maturity, for agents and engineers evaluating it against a conventional stack.
- [Limitations](https://asasvirtuais.com/docs/limitations.md) — What it asks of you, and what it leaves to your stack.
- [Getting started](https://asasvirtuais.com/docs/getting-started.md) — Install `asasvirtuais`, wire `InterfaceProvider`, and ship your first table in minutes.
- [Stack comparison](https://asasvirtuais.com/docs/comparison.md) — Side-by-side code comparison with Next.js Server Actions, TanStack Query, tRPC, React Hook Form, Supabase, and NestJS.
- [The interface](https://asasvirtuais.com/docs/interface.md) — Deep dive into schemas, reactive table indexes, and providers.
