Skip to content

Latest commit

 

History

336 Commits

Folders and files

Repository files navigation

CodeGenNew

A code generator built with Claude Code using WinUI3 for a developer's own box: point it at a SQL Server, PostgreSQL, MySQL or SQLite DB, pick a table, and generate code from T4 templates. It writes SQL stored procedures and functions; C# entities, enums, repositories, validators and ASP.NET minimal-API classes on Entity Framework Core, with OData and JWT sign-in; a Python API on FastAPI and SQLAlchemy; a Rust API on Axum and sqlx; and the screens for the same table in Angular, React, Blazor WebAssembly (standalone), WinUI 3 and Uno Platform. It has a WinUI 3 desktop app (right-click a table in a TreeView) and a scriptable command-line tool, codegen, that does the same without the GUI.

It replaces a series of hand-rolled "write lines to a text file with substitutions and smart loops" generators with a real templating engine (T4 via Mono.TextTemplating), while staying simple and portable (unpackaged, no installer) and easy to extend: a new template is just a new .tt file — no code changes.

CodeGenNew only reads. It introspects schema (and, for two templates, the table's rows) and writes files to an output folder. It never creates, alters or runs anything in your DB and never edits your project — you review the output and copy it in.

See Docs/specs.md for what the product promises and decides, and Docs/ARCHITECTURE.md for the code layout, how a run flows, the .tt.config keys and where a reviewer should look first.

Docs/QuickStart.md covers installing, building and running the command-line tool and the desktop app: every option, generating a whole project, essentials, project settings and the screen settings. Docs/Details.md covers the per-stack notes (Blazor, Uno, Python, Rust), the dashboard, access mode, SQLite, names, passwords, security and the drop-downs for listed values. Docs/OwnProject.md shows how to use the templates in your own project: the block of project settings at the top of each template, what each setting changes, and what the templates assume about your plumbing.

Status

image Project is actively being worked on. Issues and Pull Requests are welcomed. We welcome contributions.

Supported operating systems

Operating system Generator and codegen command-line tool Desktop app (CodeGenNew.App, WinUI 3)
Windows Supported (built and tested in CI) Supported
Linux Supported (built and tested in CI) Not available
macOS Supported (built and tested in CI) Not available

Browsers for the generated web apps

The generated React, Angular and Blazor apps are built for the current and the previous version of Chrome, Edge, Firefox and Safari (React: build.target es2022 in vite.config.ts; Angular: .browserslistrc; both match the ES2022 target of tsconfig.json). Internet Explorer and browsers older than that are not supported. The Uno browser head needs WebAssembly and draws on a canvas, so keyboard, text selection and assistive tools behave differently; it is checked in Chrome, Edge and Firefox, and its walk has failing steps in WebKit (see below). The web pages fit a phone-width window (the menu stacks above the page and a wide table scrolls inside the page); phones themselves are not tested.

Docs/Verification/Test-FrontEndPages.py --browser chrome|msedge|chromium|firefox|webkit [--narrow] walks a generated app in each of them, with the date and number boxes read back. React, Angular and Blazor pass the walk in Chrome and Firefox, at a normal and at a phone width (--narrow); All three pass in WebKit on Linux too. The Windows build of Playwright's WebKit has no date input (the date box reports type text), so the walk skips the date checks there, and Blazor's own script reports Invalid element type 'text' for that box. Safari itself has date inputs; a macOS WebKit run is still to be done. Uno passes in Firefox; in Playwright's WebKit it fails four keyboard-driven steps (an empty form refused, the Customer drop-down, the first page), not investigated: the walk drives Uno by focus and keys, and WebKit moves focus differently.

Known dependencies

Dependency Used by Notes
.NET 11 SDK (version 11 is required; the generated Uno project pins its global.json to an 11.0 SDK) all projects, and the generated projects Target framework (net11.0), and required at run time to compile templates.
Windows App SDK 2.7.0 (WinUI 3) CodeGenNew.App only GUI framework, unpackaged (no MSIX); its native runtime is bundled. .NET itself is framework-dependent — see specs.md.
CommunityToolkit.Mvvm 8.4.0 (WinUI 3) CodeGenNew.App only MVVM helpers ([ObservableProperty], [RelayCommand]), classic backing-field style — see ARCHITECTURE.md.
Microsoft.Data.SqlClient, Npgsql, MySqlConnector Connections, SchemaIntrospection The ADO.NET providers for SQL Server, PostgreSQL and MySQL.
Mono.TextTemplating CodeGenNew.TemplateEngine In-process T4 engine that runs outside Visual Studio (EF Core uses it for dotnet ef dbcontext scaffold).
MSTest 4 CodeGenNew.Tests only Test framework.
A reachable SQL Server, PostgreSQL or MySQL runtime Read-only access is all the tool ever needs. Not bundled.

CLI argument parsing is hand-rolled rather than pulling in a library, given the small number of flags (see ARCHITECTURE.md).

Databases

Database Connect from Schema read from SP_* templates write Search call in generated C# API_Junction, WinUI3_JunctionEditor
SQL Server app and CLI sys.* stored procedures EXEC yes
PostgreSQL app and CLI information_schema + pg_catalog functions (RETURNS SETOF, plpgsql) SELECT * FROM "f"(...) yes (call the functions)
MySQL app and CLI information_schema stored procedures (DELIMITER $$) CALL p(...) yes (call the procedures)
SQLite app and CLI (a file DB, opened read-only) sqlite_master, the pragma_* functions and the CREATE TABLE text (for CHECK constraints) nothing: SQLite has no routines (see AccessMode) LINQ over the context (CS_SearchQuery) yes (LINQ over the context)

Hosted services

A managed service that runs the same engine and speaks its protocol is read and generated for like the engine itself: pick SQL Server, PostgreSQL or MySQL as the database type and point the connection at the service.

Service Treated as Notes
Azure SQL Database, Azure SQL Managed Instance, Amazon RDS for SQL Server SQL Server Windows authentication is not available on these: use a SQL login (or Microsoft Entra on Azure) in the connection string. The database is the one named in the connection string (Azure SQL Database cannot switch databases with USE). Encryption is on by default in the SQL Server driver, so a service with a certificate the machine does not trust needs TrustServerCertificate=True or the right root certificate.
Amazon Aurora PostgreSQL-Compatible Edition, Amazon RDS for PostgreSQL, Azure Database for PostgreSQL PostgreSQL These services usually require TLS: add SSL Mode=Require to the connection string.
Amazon Aurora MySQL-Compatible Edition, Azure Database for MySQL MySQL These services usually require TLS: add SslMode=Required to the connection string. A service that has binary logging on may refuse CREATE TRIGGER and CREATE PROCEDURE from an account without the right privilege or the log_bin_trust_function_creators setting, which matters when you run the generated audit-trail and routine scripts (the tool itself never runs them).
MariaDB MySQL The schema reader asks the server for its version and treats a MariaDB server as MySQL with a flavour: the generated context names MariaDbServerVersion. Set MySqlFlavour to MariaDb or MySql to override what the server says (ApiTestContainers then starts a MariaDB container). Run against MariaDB 10.11: the schema reader, the create, audit and archive scripts, and the generated API tests in both access modes. Spatial columns work (MariaDB has no axis-order option, so the routines, the Rust and the Python stacks leave it out). Every template follows the server it read, so MySqlFlavour needs setting only to force a flavour.

These are expected to work because the schema read uses only the standard catalog views (information_schema, pg_catalog) and the generated code uses the ordinary PostgreSQL and MySQL drivers, but they are not part of the automated tests, which run against the engines themselves. Report anything that differs. Azure HorizonDB is not listed: it is a PostgreSQL-compatible service still in preview, and it has not been tried. SQLite has no hosted service to list: it is read from a file on disk, and a networked variant such as Turso or Cloudflare D1 is not a file the tool can open.

API protocols

Protocol Served by What a client gets Used by the generated screens Switch
REST the ASP.NET, Rust and Python APIs one route per table (/api/customers) with list, paging, search, read, create, update, delete and clone; JSON in camelCase, the same on every stack Angular, React and Blazor REST screens always on
OData v4 the ASP.NET API, next to the REST routes one entity set per table under /odata with $filter, $orderby, $top, $skip, $count, $select, $expand and writes, so Excel, Power BI and other OData tools can read the data; sign-in, read roles and owner scoping apply as on the REST routes Angular, React and Blazor OData screens: the several-column sort (Shift-click), the filter row and a slim $select grid OData=true
None no API nothing: the app talks to the DB itself the WinUI3 app: it reads the DB directly, so it uses neither REST nor OData the WinUI3 stack without an API

What it generates

The templates ship in Templates\ (the no-database essentials groups, such as WinUI3_EssentialApp, are listed in the grids too and described in Docs/QuickStart.md). A table's right-click menu (or the CLI's -T) offers them grouped by the text before the first underscore.

The templates are shown in 3 grids, one for each layer of an application.

Database layer

Stored procedures and scripts, plus the documents that describe the schema.

Group Template Writes
MD MD_DataDictionary Table.md - one Markdown page per table: every column with type, null, default, key role, limits and notes, the foreign keys out and tables that refer to it.
MD MD_Erd ErDiagram.md - whole-DB: a Mermaid entity-relationship diagram (GitHub and VS Code draw it); ErdTables picks the tables.
SP SP_Insert, SP_Update, SP_Delete, SP_Save Table_Insert.sql … — the classic CRUD stored procedures; Save is insert-or-update in one. Audit, active/inactive, soft-delete and date-range columns are handled by rule.
SP SP_Lookup ID + display columns of a row and of every table it points to, so a drop-down needs no joins.
SP SP_EnumCasts EnumCasts.sql - whole-DB, PostgreSQL only: one guarded CREATE CAST (text AS <enum>) ... AS ASSIGNMENT per enum type a column uses, so EF Core can store the drop-down's value.
SP SP_CreateSchema CreateSchema.sql - whole-DB, SQL Server, PostgreSQL and MySQL: a create script written from the catalog (tables, columns, keys, indexes, foreign keys with their delete rule; no checks, filtered indexes, triggers or routines). Written for a project with ApiTests and ApiTestContainers that names no ApiTestSchema, so the test container needs no script of the project's own.
SP SP_Clone Copies a row into a new one and returns the new key (a grid's "Clone" button).
SP SP_Load Reads the table's rows and writes a re-runnable procedure that loads the same rows into another DB (seed data).
SP SP_Search Table_Search.sql — one optional LIKE '%...%' parameter per string column (audit columns excluded), AND-ed together, for a list screen's search box. Refuses a table with no searchable columns.
SP SP_LogIndex Sql/LogIndexes.sql — an index on the timestamp of each table in LogTables (descending where the database has it), unless one that starts with it exists; you run it, codegen never does.
SP SP_PartitionJob Sql/PartitionJobs.sql - for each table of PartitionTables (WebhookEvent,PageView:ViewedOn) the conversion to one partition for each month of a date column (SQL Server and MySQL in place, PostgreSQL by copying into a partitioned table) and a procedure that adds the coming months and drops the old ones, with the scheduling text commented out; the date joins the primary key; you run and schedule it, codegen never does.
SP SP_ArchiveJob Sql/ArchiveJobs.sql - for each table of ArchiveTables (ErrorLog:90,JobQueue:30:delete) the <Table>Archive table when the database has none and a procedure that moves the rows older than the days to keep to it (or deletes them) in batches, with the scheduling text commented out (SQL Server Agent job, pg_cron, MySQL event; a plain script for SQLite); a work queue gives up its finished rows only; you run and schedule it, codegen never does.
SP SP_Junction Table_Junction.sql — List/Link/Unlink for a many-to-many junction table (only offered when TableModel.IsJunctionTable is true).
SP SP_KeySequence KeySequence.sql - whole-DB, SQL Server only: a key-sequence table and a GetNextID routine as an alternative to IDENTITY, for the tables the project lists in KeySequenceTables (their SP_Insert then asks the sequence for the key); each counter starts from the table's highest key.
SP SP_ReplicationTriggers Table_ReplicationTriggers.sql - SQL Server only: insert, update and delete triggers that copy each change to the DBs named in ReplicationTargets (linked server, DB). A failing target rolls back the write: review it and try it on a copy.
SP SP_AuditTable Table_Audit.sql - an audit trail for a table with audit columns (a Create... column and a Modified... or Updated... column): a Table_History table (the old row, U or D, when, who) and the trigger that fills it on update and delete; SQL Server, PostgreSQL, MySQL and SQLite. Re-runnable.
SP SP_TenantIndex TenantIndexes.sql - for a multi-tenant project (TenantTable): each unique index of a tenant-owned table that leaves the tenant column out is dropped and made again as (TenantId, ...), in the dialect of the database; you review and run it.
SP SP_TemporalTable Table_Temporal.sql - SQL Server only: makes the tables named in TemporalTables system-versioned (period columns and SYSTEM_VERSIONING with a Table_History the DB keeps).
SP SP_ApprovalTable Sql/ApprovalTables.sql - whole-DB, for the tables of RowApprovals: the create script of each <Table>Approval side table (one row per request cycle: status, reason, requester, decider, note and revision) in the dialect of the source database; nothing for a table whose side table exists. You review and run it.
SP SP_BulkUpdate BulkUpdate.sql - whole-DB, SQL Server only: a procedure that rewrites the columns named in BulkUpdateColumns (for example UPPER({column})) in every table that has them, as plain UPDATE statements in one transaction.
SP SP_Dashboard DashboardQueries.sql - whole-DB, only with Dashboard=true: the dashboard's statements for the DB that was read, each under a comment saying why the widget exists; run it by hand to check a widget.
SP SP_ForeignKeyIndexes ForeignKeyIndexes.sql - whole-DB, all DBs: a CREATE INDEX for every foreign key that no index starts with, in the DB's own syntax (an advisory script: it is never applied).

Back-end layer

Entities, repositories, the HTTP APIs and the Rust and Python servers, plus the request collections and the F# and Protocol Buffers shapes.

Group Template Writes
API API_Crud TableApi.cs — a minimal-API class: get all, get by id, create, update, delete, each over the table's repository.
API API_Junction TableJunctionApi.cs — HTTP endpoints over SP_Junction's 3 procedures, called straight through the DbContext (no repository) — the HTTP companion TS_JunctionComponent needs (also junction-only).
API API_Search TableSearchApi.cs — a /search?...&pageNumber=&pageSize= endpoint over SP_Search/SP_SearchCount, called straight through the DbContext (no repository), returning TableSearchResult (Items/Page/PageSize/TotalCount/TotalPages) — the HTTP companion the Angular/React pagination wiring needs (only offered for a table with at least one searchable column).
API API_Registration ApiRegistration.cs — also whole-DB: AddGeneratedDbContext(configuration) and RegisterGeneratedApis(), so a sample's Program.cs lists no table.
API API_OpenApi openapi.yaml - whole-DB: an OpenAPI 3.0 document of the API the other API templates write (paths, search parameters, schemas with types, lengths, CHECK limits, enum lists, required and nullable), for Kiota, NSwag, openapi-generator or a Swagger UI.
API API_Http Table.http - a request file per table (all, one, search, create, update, delete, clone) with example bodies shaped by the columns, for Visual Studio, VS Code and Rider; also written for a Python or Rust stack (the same routes).
API API_Test TableApiTests.cs - an MSTest integration test class per table in its own test project (ApiTests=true): add, read, change and remove a row, a 404, the search page, and with ApiValidation the limits. Runs the API in process over a scratch DB (SQLite: a copy of the file; others: <PROJECT>_TEST_CONNECTION).
API API_Dashboard DashboardApi.cs - GET /api/dashboard (every widget) and ?table=Customer (that table's cards), cached for a minute.
API API_Csv Apis/Csv.cs - whole-DB, ApiCsv=true: GET /api/table/export.csv and an all-or-nothing POST /api/table/import for every table, no package.
API API_OData Apis/OData.cs - whole-DB, OData=true: the tables ODataPlan selects served as OData v4 under /odata ($filter, $orderby, $top, $skip, $count, $select, $expand, and writes), next to the REST routes; needs the Microsoft.AspNetCore.OData package.
API API_UserDirectory Apis/TableUserDirectory.cs - whole-DB, ApiAuth=true with UserTable=Employee: the sign-in looks people up in your own table (UserNameColumn, PasswordHashColumn, UserOwnerColumn, UserRoleColumn), and dotnet run -- set-password <name> writes a password hash from the environment variable NEW_PASSWORD.
API API_Gates Apis/Gates.cs - whole-DB, only with ChangeGates or GuardedColumns (and ApiAuth=true): rule may prevent status change (e.g. status that may not move while customer is in bad standing unless the customer is exempt: 409 change-not-allowed) and a column only some people may change (column-not-yours, stamped with who and when), checked in the table's API before a save, in a clone and, for the import, by an admin-only route; GET <route>/guards tells the Angular screen which fields to show as text. See Docs/TemplateNotes/API_Gates_v1.md.
API API_Queue Apis/Queue.cs - whole-DB, only with QueueTables: per table POST (a producer puts a row in the queue: pending, no retries, created now), GET stats, GET failed, POST claim (the oldest pending row, taken with one guarded UPDATE), POST {id}/renew (the worker is still busy: the claim starts again) and POST {id}/complete, {id}/fail and {id}/retry; the table itself is otherwise a read-only list (no update or delete route).
API API_Inbound Apis/Inbound.cs - whole-DB, only with InboundTables: per table POST receive and POST receive/{source} (open to anyone; a signature instead of a login, a replay window, a size limit, an event id kept once, the raw body kept as text), GET unprocessed and POST {id}/processed for a worker; the table is also a read-only list. Notes: Docs/TemplateNotes/API_Inbound_v1.md.
API API_Token Apis/Tokens.cs - whole-DB, only with TokenTables and ApiAuth: per table an administrator's GET without the hash, POST {id}/revoke, POST revoke-person/{personId} and POST spend (a token is spent once, by one guarded UPDATE), and IssueAsync and SpendAsync for the application's own sign-in or reset code. The table gets no ordinary API or screen.
API API_TestTokens <Table>TokenApiTests.cs - the test project, only with TokenTables, ApiAuth and ApiTests: 401 and 403, spend once, expired or unknown, revoke, and a person's tokens.
API API_Usage Apis/Usage.cs - whole-DB, only with UsageTables, ApiAuth and TenantTable: the usage ledger (an append-only table of billable events): RecordAsync, the only writer of an event, the month's sum that a plan limit of UsageLimits reads, GET (the events of a tenant summed per month and kind) and POST (a platform administrator records an event), and with UsageRollup the roll-up of old events into a monthly total table (RollUpAsync, POST <route>/roll-up); the table gets no ordinary API or screen. Notes: Docs/TemplateNotes/API_Usage_v1.md.
API API_TestUsage <Table>UsageApiTests.cs - the test project, only with ApiTests, UsageTables, ApiAuth and TenantTable: no sign-in, a role that is not the administrator's, the summary per month and kind and its filters, another tenant's events, a platform administrator names the tenant and records usage, the roll-up, and nothing edits or deletes an event.
API API_TestContentApprovals <Table>ApprovalPublishApiTests.cs - the test project, only with ApiTests, ApiAuth, a ContentTables table that is also in RowApprovals: publishing asks for a second person and the row waits as pending, the requester cannot approve their own request, an approval publishes the row, a rejection or an archive ends the request, and a person who is not in the user table is refused.
API API_TestInbound <Table>InboundApiTests.cs - the test project, only with ApiTests and InboundTables: no signature, a wrong one and an old one are refused and store nothing, a signed message is kept as it came and listed as unprocessed, marked processed (and again is harmless), an event id is kept once, a body over the limit is a 413, and the worker routes need a sign-in. Needs the shared secret in the environment (inconclusive without it). Notes: Docs/TemplateNotes/API_Inbound_v1.md.
API API_RowShapes Apis/RowShapes.cs - whole-DB, only with TreeTables, ContentTables, SoftDeleteTables or EffectiveDatedTables (and AccessMode=Ef): per table a <Table>Shape class the table's API calls before a save and a delete, and the extra routes. A tree refuses a parent that is the row or its descendant and a level past the limit, keeps a row with children (POST {id}/promote-children) and answers GET tree depth first (the writes of a tree take turns, and every front end has a Tree view with Add child); a soft-delete table sets its flag on delete (CS_DbContext hides flagged rows), GET deleted, POST {id}/restore; an effective-dated table refuses a backwards or overlapping period and answers GET current?on=; a content table (posts, pages) makes the slug from the title, owns the status (POST {id}/publish, unpublish, archive) and answers GET public and GET public/{slug} without a sign-in.
API API_Cart Apis/CartRoutes.cs - whole-DB, only with CartTable (and AccessMode=Ef): open a cart, set and remove a product, quick order, reorder, saved lists, checkout and expiry.
API API_TestCart CartApiTests.cs - the test project (CartTable with ApiTests): set and remove, quick order, checkout, short stock and a visitor's cart, over a customer and a product of its own.
API API_TestShipment ShippingRuleTests.cs - the test project (ShipmentTables with ApiTests): ship the open lines, no line beyond what was ordered, the order status that follows the shipments, the packing slip and the tracking page, over an order each case adds.
API API_Tenants Apis/Tenants.cs - whole-DB, only with TenantTable (and ApiAuth, AccessMode=Ef): TenantLoginClaims puts the tenant (and the role the person has in it) into the token at sign-in, GET /api/auth/tenants and POST /api/auth/switch-tenant for a person in several tenants (TenantMembership), POST <tenants>/onboard for a platform administrator, and TenantTestSupport for the generated tests. CS_DbContext writes the tenant filter, CrudApi the stamping of the tenant column.
API API_TestTenants <Table>ApiTests.cs in the test project - only with TenantTable and ApiTests: the test classes of the tenant table and of the tenant-owned Name and IsActive tables, which API_Test does not write (another tenant cannot reach a row, a new row belongs to the caller's tenant, onboarding is for a platform administrator).
API API_Approvals Apis/Approvals.cs - whole-DB, only with RowApprovals (and ApiAuth, UserTable): per table POST request, approve, reject and withdraw, GET toapprove and GET {id}/approvals over a <Table>Approval side table with one row per request cycle; an approver is an administrator or a person whose role flag is set, never the requester; each decision is one guarded UPDATE of the Pending row, and ApprovalHooks hold the project's own rules.
API API_Subscriptions Apis/Subscriptions.cs - whole-DB, only with SubscriptionTable (and TenantTable, ApiAuth): a check that pauses a tenant's writes (402) while its subscription is not active, plan limits on creates and on adding members (PlanLimitTable, PlanLimits), GET /api/subscription for the tenant's administrator, PUT /api/subscription/{tenantId} for a platform administrator and SubscriptionGateway for a webhook handler. The subscription, plan and plan limit tables get no ordinary API.
API API_Features Apis/Features.cs - whole-DB, only with FeatureTables (and ApiAuth): feature flags in two tables (a flag, an override per tenant or person), FeatureFlags.EnabledAsync and http.FeatureEnabledAsync("name"), GET /api/features, PUT /api/features/{name}; the two tables get no ordinary API
API API_TestFeatures FeatureApiTests.cs in the test project - with ApiTests, FeatureTables and a tenant column on the override table: the defaults, a tenant override, who may change a flag, what a platform administrator may name
API API_TestSubscriptions SubscriptionApiTests.cs in the test project - only with SubscriptionTable and ApiTests: writes pause and resume, a tenant with no subscription, a create past a plan limit, a trial that ends, who changes a subscription.
API API_EssentialProgram <ProjectName>.Api.csproj, Program.cs, appsettings.json and GlobalUsings.cs - an essentials group: the web API project with the EF Core provider of DatabaseProvider, CORS for the front ends, and the connection string without a password; ApiProduction=true adds a Dockerfile.
API API_EssentialApiBase Apis/BaseApi.cs - an essentials group: BaseApi<T>, the base of the generated table APIs, which works out the route names the way the web clients do.
API API_EssentialCrudApi Apis/CrudApi.cs - an essentials group: CrudApi<TEntity, TRepo> (and NameActiveCrudApi), the base of every generated table API: the standard endpoints and the one set of answers; run it once before generating.
API API_EssentialJwt Apis/Auth.cs and Apis/OwnerScope.cs - an essentials group (with ApiAuth=true): POST /api/auth/login, the JWT bearer wiring, a fallback policy that needs a token on every other endpoint, and the owner scope.
API API_EssentialLaunch Properties/launchSettings.json and <ProjectName>.Api.http - an essentials group: how the API starts from Visual Studio or dotnet run, and a .http file with a first request.
API API_EssentialTests <ProjectName>.Api.Tests.csproj, ApiFixture.cs and GlobalUsings.cs - an essentials group: the test project API_Test lives in; ApiFixture starts the API in process over a scratch database (or a throwaway container with ApiTestContainers=true).
API API_JunctionTest <Table>JunctionApiTests.cs in the test project - with ApiTests=true: the junction routes of API_Junction in process: the list with the linked flag, link and unlink, repeats, a missing target, and with ApiAuth the 401 and 403.
WinUI3 WinUI3_TestSubscriptions SubscriptionGuardTests.cs in the WinUI3 test project - with DesktopTests=true, SubscriptionTable and the desktop sign-in: the plan check the app runs in process, over an in-memory SQLite database made from the generated context (a paused subscription, a new row past a plan limit until it is raised, a trial that ends, no subscription, a caller in no tenant).
TSX TSX_Subscription src/api/subscription.ts, src/pages/SubscriptionPage.tsx and its test - whole-DB, only with Auth, ApiAuth, SubscriptionTable and TenantTable: the administrator's page with the plan, the status and the limits (what the plan allows and what the tenant has). TSX_Screens puts it in the menu.
TS TS_Subscription subscription.service.ts and the subscription component with its spec - the same page for Angular; TS_Screens puts it in the menu.
BLZ BLZ_Subscription, BLZ_SubscriptionTest Pages/Subscription.razor and its bUnit tests - the same page for Blazor; BlazorMenu puts it in the menu.
UNO UNO_Subscription Views/SubscriptionPage.xaml and .xaml.cs - the same page for Uno; UNO_Screens puts it in the menu.
WinUI3 WinUI3_Subscription Repositories/SubscriptionGuard.cs and Views/SubscriptionPage.xaml - the same rule written for the app that reads the database itself (a paused subscription or a full plan refuses the save of a detail dialog and the Add member dialog) and the administrator's page.
PY PY_Subscriptions app/routes/subscriptions.py - whole-DB, only with SubscriptionTable: the pause, the plan limits and the two subscription routes of API_Subscriptions for the Python API.
PY PY_Features app/routes/features.py - whole-DB, only with FeatureTables: the Python counterpart of API_Features (all_flags, is_enabled, GET /api/features, PUT /api/features/{name})
RS RS_Features src/features.rs - whole-DB, only with FeatureTables: the Rust counterpart of API_Features (all_flags, is_enabled, GET /api/features, PUT /api/features/{name})
TSX TSX_Features src/api/features.ts, src/pages/FeaturesPage.tsx and its test - whole-DB, with Auth, FeatureTables and a tenant column on the override table: getFeatures and the page where a tenant's administrator switches a flag for the tenant; the shell reads the flags after sign-in and hides the screens FeatureScreens names
TSX TSX_Tokens src/pages/<Table>TokensPage.tsx and its test, for each table of TokenTables (with Auth and ApiAuth): the administrator's list of the rows without the hash, Revoke and Sign out everywhere.
TSX TSX_Usage src/pages/<Table>SummaryPage.tsx and its test, for each table of UsageTables (with Auth, ApiAuth and TenantTable): the administrator's table of the months and kinds the API adds up, with a kind filter.
TSX TSX_Approvals api/approvalsApi.ts, pages/ApprovalsPage.tsx, pages/ApprovalPanel.tsx, pages/approvals.css and the tests of both pages - whole-DB, with RowApprovals: for each table the requests waiting for the signed-in approver with Approve and Reject, and a row's request, withdrawal and history; the panel is also drawn on a saved row's edit form.
TS TS_Features features.service.ts and features/features.component.* - whole-DB, with Auth, FeatureTables and a tenant column on the override table: FeatureService (the flags once after sign-in and on a switch of tenant) and the screen where a tenant's administrator switches a flag for the tenant; the shell hides the screens FeatureScreens names
TS TS_Tokens <table>-tokens/<table>-tokens.component.ts, .html, .css and .spec.ts, for each table of TokenTables (with Auth and ApiAuth): the same list, Revoke and Sign out everywhere.
TS TS_Usage <table>-summary/<table>-summary.component.ts, .html, .css and .spec.ts, for each table of UsageTables (with Auth, ApiAuth and TenantTable): the same table and filter.
TS TS_Approvals services/approvals.service.ts, the approvals and approval-panel components (ts, html, css, spec) - whole-DB, with RowApprovals: for each table the requests waiting for the signed-in approver with Approve and Reject, and a row's request, withdrawal and history; the panel is also drawn on a saved row's edit form.
BLZ BLZ_Features Services/FeatureFlags.cs and Pages/Features.razor - with Auth and FeatureTables (the page with a tenant column on the override table): the flags of the signed-in person read after sign-in, the menu hides the screens FeatureScreens names, and the page where a tenant's administrator switches a flag
BLZ BLZ_Tokens Pages/<Table>Tokens.razor, for each table of TokenTables (with Auth and ApiAuth): the same list, Revoke and Sign out everywhere.
BLZ BLZ_Usage Pages/<Table>Summary.razor, for each table of UsageTables (with Auth, ApiAuth and TenantTable): the same table and filter.
BLZ BLZ_Approvals Services/ApprovalsClient.cs, Pages/Approvals.razor and Components/ApprovalPanel.razor - whole-DB, with RowApprovals: for each table the requests waiting for the signed-in approver with Approve and Reject, and a row's request, withdrawal and history; the panel is also drawn on a saved row's edit form.
BLZ BLZ_TestApprovals ApprovalsPageTests.cs in the Blazor test project - with BlazorTests=true and RowApprovals: the tests of the approvals page.
UNO UNO_Features Services/FeatureFlags.cs, Views/FeaturesPage.xaml and .xaml.cs - whole-DB, with Auth and FeatureTables (the page with a tenant column on the override table): the flags of the signed-in person read from the API, the menu hides the screens FeatureScreens names, and the page where a tenant's administrator switches a flag
UNO UNO_Tokens Views/<Table>TokensPage.xaml and .xaml.cs, for each table of TokenTables (with Auth and ApiAuth): the same list, asked of the API.
UNO UNO_Usage Views/<Table>SummaryPage.xaml and .xaml.cs, for each table of UsageTables (with Auth, ApiAuth and TenantTable): the same table and filter, asked of the API.
UNO UNO_Approvals Services/ApprovalSupport.cs, Services/ApprovalsClient.cs and Views/ApprovalsPage.cs - whole-DB, with RowApprovals: the approvals page of the Uno app, over the API, showing its own sentence on a refusal.
UNO UNO_TestApprovals ApprovalsClientTests.cs in the test project - with DesktopTests=true and RowApprovals: the tests of ApprovalsClient.
WinUI3 WinUI3_Features Repositories/FeatureFlags.cs, Views/FeaturesPage.xaml and .xaml.cs - whole-DB, with the desktop sign-in and FeatureTables: the rule of the API written for the app's own context (the app reads the database itself), the menu hides the screens FeatureScreens names, and the page where a tenant's administrator switches a flag
WinUI3 WinUI3_Tokens <ViewsFolder>/<Table>TokensPage.xaml and .xaml.cs, for each table of TokenTables (with the desktop sign-in): the same list, read from the database through the app's context.
WinUI3 WinUI3_Usage <ViewsFolder>/<Table>SummaryPage.xaml and .xaml.cs, for each table of UsageTables (with the desktop sign-in and TenantTable): the same table and filter, read from the database through the app's context.
WinUI3 WinUI3_Approvals Repositories/ApprovalSupport.cs, Repositories/ApprovalService.cs and Views/ApprovalsPage.cs - whole-DB, with RowApprovals: the approvals page of the desktop app, with the rules of API_Approvals run in process (a request per row, a decision by someone else, withdrawal, the history). The API is where they are enforced.
WinUI3 WinUI3_TestApprovals ApprovalServiceTests.cs in the test project - with DesktopTests=true and RowApprovals: the tests of ApprovalService.
WinUI3 WinUI3_Assets Repositories/Assets.cs - whole-DB, only with AssetTables: the asset rules for the desktop app, which reads the database itself: the store (a local folder), the key rules and limits, and one <Table>Assets class per table with PrepareAsync, UploadAsync, ExportAsync (the list page's Upload and Download buttons) and the removal of the file after a delete.
WinUI3 WinUI3_Content Repositories/Content.cs - whole-DB, only with ContentTables: one <Table>Content class per table with the same slug and draft rules the API writes (the slug made from the title, kept when the title changes, numbered when taken; a new row is a draft); the list page changes the status itself.
BLZ BLZ_FeaturesTest FeaturesTests.cs - with BlazorTests: the bUnit tests of the features page
RS RS_TestFeatures tests/api/feature_routes.rs - with RustTests, FeatureTables and a tenant column on the override table: the tests of the flag routes
PY PY_TestFeatures tests/test_features.py - with PythonTests, FeatureTables and a tenant column on the override table: the pytest tests of the flag routes
RS RS_Subscriptions src/subscriptions.rs - the same for the Rust API.
CS CS_Entity Table.cs — an EF Core entity: key, foreign keys, navigation properties, attributes.
CS CS_DbContext <Context>.cs — one file for the whole DB (the CLI needs no -t; the app has a toolbar button, Alt+D): the EF Core context as a partial class with a DbSet per table, both constructors, OnConfiguring and the one place the provider is chosen (UseSqlServer, UseNpgsql or UseMySql; PostgreSQL's timestamp convention; the MySQL password from MYSQL_PWD).
CS CS_Validation TableValidation.cs — a [MetadataType] buddy class adding [Required]/[StringLength]/[DataType]/[Display] to the entity (works for a hand-maintained entity too; the entity class must be partial).
CS CS_Enum Table.cs — a C# enum whose members are the rows of a small lookup table.
CS CS_Repo TableRepo.cs — thin repo class over your shared generic repo, plus a HasDuplicate<Column> check and (for a string column) a SuggestUnique<Column> name generator for every column in a unique index other than the primary key.
CS CS_Dashboard DashboardData.cs - whole-DB, only with Dashboard=true: chosen widgets with their fixed SQL and LoadAsync, which runs them through the context; web API and the desktop page both call it.
CS CS_SearchQuery TableSearchQuery.cs - search as LINQ (filter by contains, sort from a fixed list, default order), written when the project uses AccessMode=Ef (always for SQLite); CS_Repo and API_Search call it instead of the routines.
CS CS_Validator TableValidator.cs - a FluentValidation AbstractValidator<Entity>: required, length, ranges from the name rules and CHECK constraints, CHECK lists, email / phone / URL / latitude / longitude by column name.
CS CS_Faker TableFaker.cs - Bogus fake-data generator per table: text of the right kind and length, numbers inside their CHECK ranges, choices from CHECK lists, nullable columns sometimes NULL, a seed for repeatable rows.
CS CS_Seed TableSeed.cs - rows a small table holds when you generate, as a class that adds them when the table is empty (a lookup table that is not an enum); the project's SeedTables names the tables, a parent before its children.
CS CS_SeedData SeedData.cs - whole-DB: runs the seed class of every seeded table and app.SeedGeneratedDataAsync() for Program.cs.
CS CS_Dto TableDto.cs - plain transfer class filled from any IDataRecord: a Populate method (required columns, then optional ones), an IsIdentical comparer over the columns that matter, a ToString on the display column.
CS CS_DtoInput TableInput.cs - Dtos=true: the request body of a table's create and update (only the columns a caller may set) with ToEntity() and ApplyTo(entity); the API answers the CS_Dto class.
CS CS_Mapper TableMapping.cs - static class copying a table between its entity (CS_Entity) and its transfer class (CS_Dto): ToDto, ToEntity, list versions and FromReader.
CS CS_RoundTripTest TableRoundTripTests.cs - an MSTest class per table in the API test project (Dtos=true and ApiTests=true) that needs no database: the transfer class through a JSON round trip (every column, and with every optional column NULL), the reader constructor over a DataTable, IsIdentical, and the CS_Mapper copy of the entity both ways.
CS CS_SerializationTest TableSerializationTests.cs - an MSTest class for the three classes CS_SerializationDtos writes: Basic and Serializable (the custom ISerializable contract) through the DataContractSerializer, Xml through the XmlSerializer, every column compared, once with the optional columns NULL. Run by hand beside CS_SerializationDtos.
CS CS_MapperlyTest TableMapperlyTests.cs - an MSTest class for the Mapperly mapper: an entity to the transfer class and back, and ProjectToDto, every column compared. Needs the Riok.Mapperly package; name it with CS_MapperlyMapper in PlanAlso.
CS CS_DataShapesTest TableDataShapesTests.cs - an MSTest class for CS_DataContractDto (the DataContractSerializer round trip and the DataRow, reader and copy constructors) and CS_TypedDataRow (typed properties, Is<Column>Null, the StrongTypingException, a cloned table). Run by hand beside those two.
CS CS_MapperlyMapper TableMapper.cs - Mapperly counterpart of CS_Mapper: a [Mapper] partial class (ToDto, ToEntity, ProjectToDto) whose bodies Mapperly writes at compile time.
CS CS_DataContractDto TableContract.cs - [DataContract] class with 4 constructors (empty, from a DataRow, from a reader row, copy), for a WCF-style service.
CS CS_TypedDataRow TableDataTable.cs - typed-DataSet shape of a table: a DataTable with its columns and a DataRow with one typed property per column and IsXNull / SetXNull pairs.
CS CS_SerializationDtos TableSerializationDtos.cs - same data class in 3 contracts side by side: plain [Serializable], custom ISerializable, and XmlSerializer attributes.
CS CS_EfConfiguration Data/Configurations/TableConfiguration.cs - IEntityTypeConfiguration per table (table, key, column details, indexes); with EfConfigurations=true the context applies them with ApplyConfigurationsFromAssembly.
CS CS_CqrsHandlers Application/ - whole-DB, only with PlanAlso: commands, queries and handlers per table (create, update, delete, get by id, paged list) behind two small interfaces, and AddApplicationHandlers(). No package.
CS CS_EssentialBase Entities/BaseEntity.cs, Repositories/IGenericRepo.cs and GenericRepo.cs - an essentials group (API and WinUI3): the base classes the generated entities and repositories derive from; delete reports "in use" when a foreign key blocks it.
CS CS_EssentialNameActive Entities/BaseNameActiveEntity.cs, Repositories/INameActiveRepo.cs and NameActiveRepo.cs - an essentials group: the base of a table with a Name and an IsActive column: the duplicate-name rule, the active list and find by name.
CS CS_EssentialEditorConfig .editorconfig and .gitignore - an essentials group: the style rules the generated C# follows as IDE warnings, and a .gitignore for a Visual Studio project.
FS FS_Entity Table.fs - immutable F# record (a nullable column is an option) and module with validate and ofStrings, both returning Result that lists every problem; limits include DB's CHECK ranges.
FS FS_Rop Rop.fs - no table, no DB: shared Result helpers, error-collecting <*> operator and text parsers the records use.
MD MD_Postman, MD_Bruno collections/<Project>.postman_collection.json and collections/bruno/ - whole-DB, only with PlanAlso: Postman and Bruno API requests (folder per table: all, one, search, add, change, remove, copy) with sample bodies and baseUrl variable.
MD MD_Dashboard Dashboard.md - whole-DB, only with Dashboard=true: the widgets the dashboard shows, each with schema fact that chose it and statement that fills it, then what caps left out.
PROTO PROTO_Message Table.proto - proto3 message per table, its key message, list messages and a CRUD service (a decimal is a string, a date a Timestamp, a nullable column optional).
PY PY_Model, PY_Schema app/models/table.py and app/schemas/table.py - SQLAlchemy 2.0 class and Pydantic 2 table schema, for Python stack (all DBs).
PY PY_Routes app/routes/table.py - FastAPI router with contract of other stacks (201 and Location, 400, 404, clone, search with paging and sort).
PY PY_Validate app/validation/table.py - validate, schema's rules for a row (ApiValidation=true).
PY PY_Dashboard app/routes/dashboard.py - GET /api/dashboard for the Python stack: the widgets and statements of DashboardPlan, kept for a minute, without the widgets of tables the caller's role may not read (Dashboard=true).
PY PY_Cart app/routes/cart_routes.py - the cart routes of API_Cart for the Python API (CartTable).
PY PY_TestCart tests/conftest.py and tests/test_cart.py - the cases of API_TestCart (PythonTests=true; not for SQL Server).
PY PY_Mod package lists and list of routers that main.py includes: every table's, the junction tables' (PY_Junction), the dashboard's and, with ApiCsv=true, the CSV routes (listed first, so a table's /{id} route does not read export.csv as a key).
PY PY_Junction app/routes/table_junction.py for a many-to-many junction table - junction routes of API_Junction (list with isSelected, link, unlink) for the Python API, so the junction screens of every UI stack work against it.
PY PY_Csv app/routes/csv_files.py - GET /api/table/export.csv and POST /api/table/import for every table (ApiCsv=true); the import is all or nothing.
PY PY_Gates app/gates.py - checks of ChangeGates and GuardedColumns (409 change-not-allowed, 403 column-not-yours, stamps, the clone reset) that the routes call, and GET /api/table/guards (ApiAuth=true).
PY PY_Approvals app/routes/approvals.py and the model of each side table - whole-DB, only with RowApprovals (and ApiAuth): the Python counterpart of API_Approvals (request, approve, reject and withdraw, GET toapprove and GET {id}/approvals over the <Table>Approval side table, each decision one guarded UPDATE, never by the requester).
PY PY_TestApprovals tests/conftest.py and tests/test_approvals.py - pytest tests of the approval routes (PythonTests=true with RowApprovals) over a scratch database: the same cases as the Rust tests and the two hooks.
PY PY_Queue app/routes/queue.py - whole-DB, only with QueueTables: the same stats, failed, claim, {id}/renew, {id}/complete, {id}/fail and {id}/retry routes as API_Queue, each change of status one guarded UPDATE; PY_Mod lists the router before the tables' routers.
PY PY_Inbound app/routes/inbound.py - whole-DB, only with InboundTables: the same inbound routes as API_Inbound (receive and receive/{source} on a public router, unprocessed, {id}/processed), with the same sentences, problem types and status codes.
PY PY_Token app/routes/tokens.py - whole-DB, only with TokenTables and ApiAuth: the same token routes as API_Token over a SQLAlchemy table(), each change one guarded UPDATE.
PY PY_Usage app/routes/usage.py - whole-DB, only with UsageTables, ApiAuth and TenantTable: the same routes, sentences and plan-limit reading as API_Usage, with record_usage, used_this_month and remaining.
PY PY_Assets app/routes/asset_files.py - whole-DB, only with AssetTables: the Python counterpart of the asset routes of API_RowShapes: POST <route>/upload (a multipart form, 400 with no file, 413 over AssetMaxBytes, 415 for a type outside AssetAllowedTypes) and GET <route>/{id}/download, with the file kept by a local AssetStore.
PY PY_Links app/routes/link_rules.py - whole-DB, only with PolymorphicLinks: the Python counterpart of the link rules of API_RowShapes: SQLAlchemy events refuse a link whose record type names no listed table or whose id is no row of it (400) and a delete of a linked row (409, or remove the links with :remove).
PY PY_Tenants app/routes/tenancy.py - whole-DB, only with TenantTable and ApiAuth: the Python counterpart of API_Tenants: the tenant of a sign-in, GET /api/auth/tenants and POST /api/auth/switch-tenant, and the helpers the tables' routers call so a caller reads and writes only the rows of their tenant.
PY PY_TestQueue tests/conftest.py and tests/test_queue.py - pytest tests of the queue routes (PythonTests=true, a queue table the schema can fill; not for SQL Server): the claim in turn, a row completed once, the retries and Retry, a missing row, a stale claim.
PY PY_TestParties tests/conftest.py and tests/test_parties.py - pytest tests of the party rule and search (PythonTests=true, a party table of PartyTables the tests can fill; not for SQL Server): a scheme and value pair another row holds is refused on create and update, a party is found by an identifier.
PY PY_TestManufacturerNumbers tests/conftest.py and tests/test_manufacturer_numbers.py - pytest tests of the manufacturer number rule, search and address (PythonTests=true, a product table of ManufacturerNumberTables the tests can fill; not for SQL Server): a repeated pair is refused, a product is found by its numbers, an old number redirects.
PY PY_TestOrderQuantity tests/conftest.py and tests/test_order_quantity.py - pytest tests of the order quantity rule (PythonTests=true, a line table of OrderQuantityTables the tests can fill; not for SQL Server): the rule is answered, a quantity below the minimum or off the multiple is refused with the rule named, and a refused change saves nothing.
PY PY_TestRates tests/conftest.py and tests/test_rates.py - pytest tests of the rate rule and lookup (PythonTests=true, a rate table of RateTables the tests can fill; not for SQL Server): trimmed upper case currencies, two different ones, a rate above zero, one rate per pair and day on create and update, and the rate in force on a day.
PY PY_TestTax tests/conftest.py and tests/test_tax.py - pytest tests of the tax lines (PythonTests=true, a line table of TaxLines the tests can fill; not for SQL Server): the copied rate and the tax, the rate kept when the category's rate changes, an unknown category, the validity and the subtotals.
PY PY_TestAllowance tests/conftest.py and tests/test_allowance.py - pytest tests of the allowances and charges (PythonTests=true, a table of AllowanceCharges the tests can fill; not for SQL Server): the amount from the base and the percentage, the percentage from the amount, the refusals, the totals of a document and of one line.
PY PY_TestCatalog tests/conftest.py and tests/test_catalog.py - pytest tests of the facet routes (PythonTests=true, a product table of FacetTables the tests can fill; not for SQL Server): the counts, alternatives within an attribute, the keyword over the attribute values, paging, the refusals and the ranges.
PY PY_TestLedger tests/conftest.py and tests/test_ledger.py - pytest tests of a payment ledger (PythonTests=true, LedgerTables): the paid amount, refunds and captures within their limits, a retried call and the refused change or delete.
PY PY_TestStock tests/conftest.py and tests/test_stock.py - pytest tests of the stock routes (PythonTests=true, a stock table of StockTables or StockLocationTables the tests can fill; not for SQL Server): receive, reserve, commit, release, stock-take and the check against the ledger, and per location a transfer.
PY PY_TestShipment tests/conftest.py and tests/test_shipments.py - the cases of API_TestShipment (PythonTests=true; not for SQL Server).
PY PY_TestTotals tests/conftest.py and tests/test_totals.py - pytest tests of document totals (PythonTests=true, DocumentTotals; not for SQL Server): the totals the server writes as lines are added and removed, the payable amount and the check route.
PY PY_TestInbound tests/conftest.py and tests/test_inbound_<table>.py - tests of the inbound routes, only with PythonTests=true and InboundTables: the cases of API_TestInbound through the routes over the scratch database; the tests put the shared secret in the environment and remove the events they wrote.
PY PY_TestTokens tests/conftest.py and tests/test_tokens.py - pytest tests of the token routes (PythonTests=true, ApiAuth and a token table the schema can fill; not for SQL Server): no sign-in, a role that is not the administrator's, a token spent once, an expired or unknown or blank one, a hash in capitals, a revoked token, and an anonymous spend, a family and a person's tokens when the table has them.
PY PY_TestTenants tests/conftest.py and tests/test_tenants.py - pytest tests of a multi-tenant API (PythonTests=true, TenantTable; not for SQL Server): another tenant cannot reach a row, the tenant column is the caller's, a caller in no tenant sees nothing, the names of Name and IsActive tables, the tenant table.
PY PY_TestSubscriptions tests/test_subscriptions.py - pytest tests of the plans, subscriptions and limits of the Python API (PythonTests=true, TenantTable, SubscriptionTable; not for SQL Server): writes pause and resume, a tenant with no subscription, a create past a plan limit, a trial that ends, who changes a subscription, the plan list and the signed webhook. Needs the files of PY_TestTenants.
PY PY_TestUsage tests/test_usage_<table>.py - pytest tests of each usage ledger of the Python API (PythonTests=true, TenantTable, UsageTables; not for SQL Server): no token, a role that is not the administrator's, the summary per month and kind with its filters, another tenant's events, the platform administrator who names the tenant and records usage, the roll-up and no edit or delete route. Each test records its events through the record route and removes them again.
PY PY_TestAssets tests/conftest.py and tests/test_assets.py - pytest tests of the asset routes (PythonTests=true with AssetTables; not for SQL Server): an upload to a temporary store and its download, the delete that removes the file, the refusals (no file, over AssetMaxBytes, a type outside AssetAllowedTypes) and a save that cannot name the storage key.
PY PY_UserDirectory app/users.py - people who sign in, read from UserTable of project, and python -m app.users set-password (ApiAuth=true with UserTable).
PY PY_EssentialApp app/__init__.py, db.py, support.py and main.py - an essentials group: the declarative base, engine and session of DatabaseProvider (the password only from the environment), ApiError, the validation problems in the ASP.NET problem form, Page and the app.
PY PY_EssentialAuth app/auth.py - an essentials group (with ApiAuth=true): POST /api/auth/login, a bearer check on every other router, the owner scope of OwnedTables and the same password hash the ASP.NET API writes.
PY PY_EssentialProject requirements.txt, .env.example, .gitignore and README.md - an essentials group: the packages (FastAPI, uvicorn, SQLAlchemy 2.0, Pydantic 2 and the driver), the variables the API reads and the commands to install and run it.
RS RS_Struct src/models/table.rs - Rust struct of a table (serde and sqlx), with JSON names other stacks send; for the Rust stack (PostgreSQL, MySQL, SQLite).
RS RS_Repo src/repos/table.rs - table's fixed SQL for DB that was read and sqlx functions: get, insert, update, delete, clone, and search with filters, fixed sort list and paging; with ApiCsv=true also insert_all, that adds all the rows of CSV import in one transaction.
RS RS_Routes src/routes/table.rs - Axum handlers with contract of other stacks (201 and Location, 400, 404, /search, /clone).
RS RS_Validate src/validation/table.rs - validate, schema's rules for a row (ApiValidation=true); answer is ASP.NET validation problem.
RS RS_Dashboard src/routes/dashboard.rs - Rust dashboard: widgets and statements of DashboardPlan, kept for a minute (Dashboard=true).
RS RS_Cart src/routes/cart_routes.rs - the cart routes of API_Cart for the Rust API (CartTable).
RS RS_TestCart tests/api/cart_routes.rs - the cases of API_TestCart (RustTests=true).
RS RS_Mod module lists and router that merges every table's routes, junction routes (RS_Junction), dashboard, CSV routes (ApiCsv=true) and gates router (RS_Gates).
RS RS_Junction src/routes/table_junction.rs for a many-to-many junction table - junction routes of API_Junction for Rust API.
RS RS_Csv src/routes/csv_files.rs - CSV export and import routes for every table (ApiCsv=true); rows are inserted in one transaction.
RS RS_Gates src/routes/gates.rs - same checks for Rust API, and guards routes.
RS RS_Test tests/api/table.rs - integration tests of a table's routes that run the crate's router in process (RustTests=true): add, read, change and remove a row, a 404, the search and its sorts, a copy, a unique value, the validation limits, and with ApiAuth the 401 and 403 answers and the owner rule of OwnedTables. Run by cargo test over a scratch database (SQLite: a copy of the file; others: <PROJECT>_TEST_CONNECTION).
RS RS_TestBodies tests/api/main.rs and tests/api/test_bodies.rs - the request bodies of the tests, with a row added to a parent that has none (RustTests=true).
RS RS_TestCsv tests/api/csv_routes.rs - tests of the CSV export and import of every table (RustTests=true with ApiCsv=true): the header, an import, a bad row that adds none, a formula text, and the administrator-only routes.
RS RS_TestDashboard tests/api/dashboard_routes.rs - tests of GET /api/dashboard against the plan's widgets and strips (RustTests=true with a dashboard).
RS RS_TestGates tests/api/gate_routes.rs - tests of the guards route, a guarded column and the 409 of a change gate, with the condition set through the parent's API (RustTests=true with ChangeGates or GuardedColumns).
RS RS_Approvals src/routes/approvals.rs - whole-DB, only with RowApprovals (and ApiAuth; PostgreSQL, MySQL and SQLite): the Rust counterpart of API_Approvals (request, approve, reject and withdraw, GET toapprove and GET {id}/approvals over the <Table>Approval side table, each decision one guarded UPDATE in a transaction, never by the requester).
RS RS_TestApprovals tests/api/approval_routes.rs - tests of the approval routes (RustTests=true with RowApprovals): the people and a row added with SQL, a stranger, a second request, a person who may not decide, withdrawal, the four eyes and the history.
RS RS_Queue src/routes/queue.rs - whole-DB, only with QueueTables: the same queue routes as API_Queue over sqlx, each change of status one guarded UPDATE; a wrong state answers 409 in the problem-details form with or without sign-in.
RS RS_Inbound src/routes/inbound.rs - whole-DB, only with InboundTables: the same inbound routes as API_Inbound over sqlx, the receive routes in a public_router that main.rs merges after the sign-in check.
RS RS_Token src/routes/tokens.rs - whole-DB, only with TokenTables and ApiAuth: the same token routes as API_Token over sqlx, each change one guarded UPDATE of the row that is still active.
RS RS_Usage src/routes/usage.rs - whole-DB, only with UsageTables, ApiAuth and TenantTable: the same routes, sentences and plan-limit reading as API_Usage.
RS RS_Assets src/routes/asset_files.rs - whole-DB, only with AssetTables: the Rust counterpart of the asset routes of API_RowShapes: POST <route>/upload (a multipart form, 400 with no file, 413 over AssetMaxBytes, 415 for a type outside AssetAllowedTypes) and GET <route>/{id}/download, with the file kept by a local AssetStore.
RS RS_Links src/routes/link_rules.rs - whole-DB, only with PolymorphicLinks: the Rust counterpart of the link rules of API_RowShapes: a link whose record type names no listed table or whose id is no row of it is refused with 400, a delete of a linked row is refused with 409 (or removes the links with :remove).
RS RS_Tenants src/tenancy.rs - whole-DB, only with TenantTable and ApiAuth: the Rust counterpart of API_Tenants: the tenant of a sign-in, GET /api/auth/tenants and POST /api/auth/switch-tenant, and the helpers the tables' routers call so a caller reads and writes only the rows of their tenant.
RS RS_TestQueue tests/api/queue_routes.rs - tests of the queue routes (RustTests=true, a queue table the schema can fill), the same cases as the Python tests.
RS RS_TestParties tests/api/party_routes.rs - tests of the party rule and search (RustTests=true, a party table of PartyTables the tests can fill), the same cases as the Python tests.
RS RS_TestManufacturerNumbers tests/api/manufacturer_routes.rs - tests of the manufacturer number rule, search and address (RustTests=true, a product table of ManufacturerNumberTables the tests can fill), the same cases as the Python tests.
RS RS_TestOrderQuantity tests/api/order_quantity_routes.rs - tests of the order quantity rule (RustTests=true, a line table of OrderQuantityTables the tests can fill), the same cases as the Python tests.
RS RS_TestRates tests/api/rate_routes.rs - tests of the rate rule and lookup (RustTests=true, a rate table of RateTables the tests can fill), the same cases as the Python tests.
RS RS_TestTax tests/api/tax_routes.rs - tests of the tax lines (RustTests=true, a line table of TaxLines the tests can fill), the same cases as the Python PY_TestTax.
RS RS_TestAllowance tests/api/allowance_routes.rs - tests of the allowances and charges (RustTests=true, a table of AllowanceCharges the tests can fill), the same cases as the Python PY_TestAllowance.
RS RS_TestCatalog tests/api/catalog_routes.rs - tests of the facet routes (RustTests=true, a product table of FacetTables the tests can fill), the same cases as the Python PY_TestCatalog.
RS RS_TestLedger tests/api/ledger_routes.rs - tests of a payment ledger (RustTests=true, LedgerTables), the same cases as the Python PY_TestLedger.
RS RS_TestStock tests/api/stock_routes.rs - tests of the stock routes (RustTests=true, a stock table of StockTables or StockLocationTables the tests can fill), the same cases as the Python PY_TestStock.
RS RS_TestShipment tests/api/shipment_routes.rs - the cases of API_TestShipment (RustTests=true).
RS RS_TestTotals tests/api/totals_routes.rs - tests of document totals (RustTests=true, DocumentTotals), the same cases as the Python PY_TestTotals.
RS RS_TestInbound tests/api/inbound_<table>_routes.rs - tests of the inbound routes, only with RustTests=true and InboundTables: the same cases in process over the scratch database; the tests put the shared secret in the environment once and remove the events they wrote.
RS RS_TestTokens tests/api/token_routes.rs - tests of the token routes (RustTests=true, ApiAuth and a token table the schema can fill), the same cases as the Python tests.
RS RS_TestTenants tests/api/tenant_support.rs and tests/api/tenant_routes.rs - the tenants the Rust tests work in (their tokens carry the first one) and the tests of the tenant table and the Name and IsActive tables of a tenant (RustTests=true, TenantTable); the other tenant-owned tables get their cases in their RS_Test module.
RS RS_TestSubscriptions tests/api/subscription_routes.rs - the same tests for the Rust API (RustTests=true, TenantTable, SubscriptionTable; not for SQL Server), with the tenant made by make_tenant of RS_TestTenants.
RS RS_TestUsage tests/api/usage_<table>.rs - the same tests for each usage ledger of the Rust API (RustTests=true, TenantTable, UsageTables); every Rust test works in a database of its own, so the events need no clean-up.
RS RS_TestAssets tests/api/asset_routes.rs - tests of the asset routes (RustTests=true with AssetTables): an upload to a temporary store and its download, the delete that removes the file, the refusals (no file, over AssetMaxBytes, a type outside AssetAllowedTypes) and a save that cannot name the storage key.
RS RS_TestJunction tests/api/table_junction.rs - tests of the junction list, link and unlink routes of a many-to-many table (RustTests=true).
RS RS_UserDirectory src/users.rs - people who sign in, read from UserTable of project, and set-password command (ApiAuth=true with UserTable).
RS RS_EssentialCargo Cargo.toml, .env.example and .gitignore - an essentials group: the crate (RustCrateName), the dependencies pinned to the versions this release was checked with, and the sqlx features of DatabaseProvider; no password is written.
RS RS_EssentialMain src/lib.rs, src/main.rs and src/support.rs - an essentials group: the application as a library (the router over a pool, CORS, openapi.yaml with ApiDocs=true, the built front end), run() listening on PORT, and the pool, error type and HTTP answers the generated files share.
RS RS_EssentialAuth src/auth.rs - an essentials group (with ApiAuth=true): POST /api/auth/login, a require_user middleware, the owner scope of OwnedTables and the same password hash the ASP.NET API writes.
RS RS_EssentialTests tests/api/test_support.rs - an essentials group: the Client that sends the crate's router requests in process over a scratch database, shared by the RS_Test modules.
RS RS_EssentialTauri desktop/Cargo.toml, build.rs, tauri.conf.json, capabilities/default.json and src/main.rs - an optional essentials group: a Tauri 2 desktop shell that starts the API on a free local port and opens a window on the built React or Angular front end.

UI layer

Angular, React, Blazor, Uno and WinUI3 code: models, services, screens and dashboards. "Blazor" in this document means a standalone Blazor WebAssembly app, which runs in the browser and calls the generated API with an HttpClient. It is not a Blazor Web App, Blazor Server or Blazor Hybrid project.

Group Template Writes
BLZ BLZ_Model, BLZ_Client Models/Table.cs and Services/TableClient.cs - class a table's JSON becomes in Blazor app and its HttpClient calls (get, search with paging and sort, create, update, delete, clone).
BLZ BLZ_GridColumns Services/GridColumns.cs - whole-DB support code for Columns list every Blazor grid has: saved choice of columns and cut of a long text.
BLZ BLZ_Page Pages/TablePage.razor - Blazor screen: grid, search, sortable headers, paging, add / edit panel with drop-downs for foreign keys.
BLZ BLZ_Dashboard Blazor dashboard page (Services/DashboardClient.cs, Components/DashboardWidgetView.razor, Pages/Dashboard.razor; money shown as currency; with DashboardStrip=true, Components/DashboardStrip.razor above each table page).
BLZ BLZ_Cart, BLZ_CartTest Blazor shopping cart page, its client and the add to cart bar above the product list, with bUnit tests (CartTable; tests with BlazorTests=true).
BLZ BLZ_ODataClient Services/TableODataClient.cs for each table the project serves as OData: a short class on ODataClient (BLZ_EssentialOData) with entity set, key, search boxes, header sorts and REST route a clone goes through (opt in with OData=true).
BLZ BLZ_Junction Pages/TableJunctionPage.razor and Services/TableJunctionClient.cs for a many-to-many junction table - a routed page (/table-links) that picks a row of the anchor table and moves rows of the other table between an Available and a Selected list over the junction routes; each move is saved at once.
BLZ BLZ_ODataPage BLZ_Page run as its OData form (Base/Variant in its config): Pages/TableODataPage.razor, same page over table's OData client with several-column sort (Shift-click) and filter row; ODataScreens=Replace gives it REST page's route.
BLZ BLZ_Screens Layout/NavMenu.razor, Pages/Home.razor and Services/ApiClients.cs - whole-DB: the menu in Screens order and the registration of every client.
BLZ BLZ_EssentialProject <ProjectName>.Blazor.csproj, Program.cs, App.razor, _Imports.razor, wwwroot/index.html, wwwroot/appsettings.json and launchSettings.json - an essentials group: a standalone Blazor WebAssembly app that calls the API with an HttpClient (ApiBaseUrl, DevPort).
BLZ BLZ_EssentialLayout Layout/MainLayout.razor and wwwroot/css/app.css - an essentials group: the page frame (the menu, a hamburger button) and the stylesheet the generated pages assume; with Auth=true the menu shows only to a signed-in person.
BLZ BLZ_EssentialSupport Services/ApiSupport.cs, Components/CurrencyInput.razor, RowShapeDialog.razor and TreeDialog.razor - an essentials group: ApiException, PagedResult<T>, the response helpers, the money box and the deleted-rows and tree dialogs.
BLZ BLZ_EssentialAuth Services/AuthSession.cs, Pages/Login.razor and Components/RedirectToStart.razor - an essentials group (with Auth=true): the sign-in kept in sessionStorage, the authentication state [Authorize] reads and a bearer handler.
BLZ BLZ_EssentialTests <ProjectName>.Blazor.Tests.csproj, FakeApi.cs and PageTestContext.cs - an essentials group: the bUnit test project BLZ_Test lives in, over a FakeApi that stands in for the API.
BLZ BLZ_EssentialGit .gitignore - an essentials group: what a Blazor WebAssembly app keeps out of version control.
BLZ BLZ_Test <Table>PageTests.cs in the Blazor test project - with BlazorTests=true: bUnit tests of the page BLZ_Page writes (and the OData page with OData=true) over FakeApi: the heading, a row, Edit opening the dialog, Save sending a PUT, a header sort, search, paging and the master-detail child grids.
BLZ BLZ_TestMenu MenuTests.cs in the Blazor test project - with BlazorTests=true: one menu link to every screen in menu order, the hamburger, and with Auth=true what a signed-out person and each role see.
BLZ BLZ_JunctionTest <Table>JunctionPageTests.cs in the Blazor test project - with BlazorTests=true: the two-list page of a junction table: the anchor drop-down, a row moving to Selected with a POST to link, Remove all, and the sentences of a refusal.
BLZ BLZ_People Services/PeopleApi.cs and Pages/Members.razor - whole-DB, with Auth=true, ApiAuth and a UserTable: ChangePasswordAsync and, with a TenantMembership, the members page where an administrator says who works in the tenant and in which role.
BLZ BLZ_PeopleTest MembersTests.cs in the Blazor test project - the bUnit tests of the members page: the list, adding a person, changing a role and removing a member.
TS TS_GridColumns grid-columns.ts - whole-DB support code for the Columns list every Angular grid has: the saved choice of columns, the rule that reads it back, the cut of a long text and the GridColumns object a screen holds.
TS TS_GridSort grid-sort.ts - Angular counterpart: how the sort is saved, loaded and flipped.
TS TS_Screens app.routes.ts - whole-DB: Angular app's screens and routes, from same list.
TS TS_Dashboard Angular dashboard: service, page, widget component, strip and host that puts it above a screen.
TS TS_Cart Angular shopping cart screen, service, add to cart bar and spec (CartTable).
TS TS_Model models/table.ts — Angular interface matching JSON the API really sends.
TS TS_Validators validators/table.validators.ts - Angular Validators schema states for each field (required, length, allowed values, ranges, email, phone, URL), keyed by property name.
TS TS_Service services/table.service.ts — HttpClient wrapper with same table method names.
TS TS_Component 4 files in components/table/ — CSS, HTML, spec and TypeScript for a grid + add/edit form screen.
TS TS_ODataComponent TS_Component run as its OData form (Base/Variant in its config): 4 files in components/table-odata/, same screen over the table's OData service, with its own route and menu entry; OData=true, tables served as OData.
TS TS_ODataDetailMasterComponent TS_DetailMasterComponent run as its OData form (Base/Variant in its config): master-detail screen over table's OData service in components/table-odata/, with filter row, several-column sort and slim grid; child grids read child's entity set filtered by parent's key when it is served too. OData=true.
TS TS_ODataService services/table-odata.service.ts for each table served as OData - whole-DB: a short class on ODataCrudService (odata/<set>), OData=true.
TS TS_JunctionComponent 4 files in components/table-junction/ — 2-<select multiple> shuttle-control screen calling API_Junction (also junction-only).
TS TS_DetailMasterComponent 4 files in components/table-detail-master/ — TS_Component's own grid + form plus one read-only grid per child table (only offered when there's at least one).
TS TS_EssentialShell src/index.html, src/main.ts, src/app/app.ts, app.html and app.css - an essentials group: the page, the bootstrap and the root component with the menu (a hamburger button, remembered) around the router outlet.
TS TS_EssentialConfig src/app/app.config.ts and proxy.conf.json - an essentials group: HttpClient for every service, the router with the routes TS_Screens writes, and the dev server's proxy of /api.
TS TS_EssentialBuild package.json, angular.json and the tsconfig files - an essentials group: the build files as ng new writes them, with Angular Material; the package ranges, builders and test runner follow AngularVersion.
TS TS_EssentialStyles src/styles.css - an essentials group: the global stylesheet the generated components assume (grids, forms, tabs, dialog, search row, row buttons).
TS TS_EssentialCrud services/crud.service.ts, api-error.ts, notifier.ts, components/crud-screen.ts, row-shape-dialog.ts, tree-dialog.ts, currency-input.ts and the specs - an essentials group: the base classes the generated services and screens are short classes on; run it once before generating.
TS TS_EssentialOData services/odata-query.ts, odata-crud.service.ts and their specs - an essentials group: the base of the OData services and the helper that writes an OData query (quoted literals, a URL-encoded query, the server's next link).
TS TS_EssentialAuth auth.service.ts, auth.interceptor.ts, auth.guard.ts and the login component - an essentials group (with Auth=true): the session kept per tab, the bearer interceptor that signs the person out on a 401, and the guard that sends a person to /login.
TS TS_EssentialDocker Dockerfile, nginx.conf.template and .dockerignore - an optional essentials group: a Node build stage and an nginx stage that serves the build and forwards /api/ to API_UPSTREAM.
TS TS_EssentialGit .gitignore - an essentials group: the list ng new writes.
TS TS_People people.service.ts and the members component (ts, html, css, spec) - whole-DB, with Auth=true, ApiAuth and a UserTable: changePassword and, with a TenantMembership, the members screen where an administrator says who works in the tenant and in which role.
TSX TSX_Screens screens.tsx - also whole-DB: React app's screen list (route, menu text, page) in menu order; App.tsx imports it, so a new table is a regenerate, not an edit of shell.
TSX TSX_ODataApi api/tableODataApi.ts for each table served as OData - whole-DB: a short module on createODataApi (/odata/<set>) with same method names as TSX_Api; OData=true.
TSX TSX_ODataPage TSX_Page run as its OData form (Base/Variant in its config): pages/TableODataPage.tsx and its test, same page over table's OData api module with several-column sort (Shift-click), filter row and slim grid; OData=true.
TSX TSX_ODataDetailMasterPage TSX_DetailMasterPage run as its OData form: master-detail page over the table's OData api module; child grid whose table is served too reads child's entity set filtered by parent's key. OData=true.
TSX TSX_GridColumns components/gridColumns.tsx - whole-DB support code for Columns list every React grid has: Columns button, saved column choices, cut of a long text.
TSX TSX_GridSort components/gridSort.tsx - whole-DB support code every React grid imports: sortable header, the right-click Clear sort menu and saved sort.
TSX TSX_Dashboard React dashboard (cards, bar lists, a sparkline, recent rows; no chart package) and, with DashboardStrip=true, strip above each table's grid.
TSX TSX_Cart React shopping cart page, api module, add to cart bar and test (CartTable).
TSX TSX_Api api/tableApi.ts — React Service: plain object of fetch-based functions instead of an HttpClient class (reuses TS_Model's own output for row type — no separate React model template exists).
TSX TSX_Schema schemas/table.ts - zod schema of editable fields with same limits, and form type inferred from it.
TSX TSX_Page pages/TablePage.tsx plus a colocated pages/__tests__/TablePage.test.tsx — React counterpart of TS_Component: one function component (grid + add/edit form) using useState/useEffect instead of a class.
TSX TSX_LogPage pages/TablePage.tsx plus its test for a table in LogTables: a read-only list that opens on a date range (From, To) and the search boxes, newest first, with no Add New, Edit, Clone, Delete or form; TSX_Page writes nothing for such a table.
TSX TSX_DetailMasterPage pages/TableDetailMasterPage.tsx plus its test — TSX_Page's own grid + form plus one read-only grid per child table (only offered when there's at least one).
TSX TSX_JunctionPage components/TableJunction.tsx plus its test — 2-<select multiple> shuttle-control component (an anchorId prop, not routed on its own) calling API_Junction (also junction-only).
TSX TSX_EssentialShell index.html, src/main.tsx and src/App.tsx - an essentials group: the page, the entry point with the router, and App with the menu (a hamburger button, remembered) and the routes from src/screens.tsx.
TSX TSX_EssentialBuild package.json, vite.config.ts, tsconfig.json and src/vite-env.d.ts - an essentials group: the Vite, React and TypeScript build with the Vitest setup; the dev server proxies /api to the API.
TSX TSX_EssentialStyles src/index.css - an essentials group: the one stylesheet the generated pages assume (menu, tables, edit form and tabs, dialog, search bar, pagination bar, row buttons).
TSX TSX_EssentialSupport src/api/client.ts, PaginationBar.tsx, RowShapeDialog.tsx, TreeDialog.tsx, CurrencyInput.tsx and src/setupTests.ts - an essentials group: the fetch helper with ApiError (it sends the token and signs the person out on a 401 with Auth=true), the Previous / Next bar, the money box and the test setup.
TSX TSX_EssentialOData src/api/odataQuery.ts, odataClient.ts, src/components/odataScreen.tsx, odataGrid.css and their tests - an essentials group: the helpers of the OData pages (quoted literals, the filter row, a URL-encoded query, the server's next link).
TSX TSX_EssentialAuth src/api/auth.ts, pages/LoginPage.tsx, components/RequireAuth.tsx, auth.css and their tests - an essentials group (with Auth=true): the session kept per tab, the sign-in page, and a guard that sends a person to /login or to the first screen their role may open.
TSX TSX_EssentialDocker Dockerfile, nginx.conf.template and .dockerignore - an optional essentials group: a Node build stage and an nginx stage that serves dist and forwards /api/ to API_UPSTREAM.
TSX TSX_EssentialGit .gitignore - an essentials group: what a Vite and React app keeps out of version control.
TSX TSX_People src/api/people.ts, src/pages/MembersPage.tsx and its test - whole-DB, with Auth=true, ApiAuth and a UserTable: changePassword and, with a TenantMembership, the members page where an administrator says who works in the tenant and in which role.
UNO UNO_Model, UNO_Client Models/Table.cs and Services/TableClient.cs - class a table's JSON becomes in Uno app and its HttpClient calls, Blazor client's.
UNO UNO_MasterScreen, UNO_DetailScreen, UNO_DetailMasterScreen UNO list page and add / edit dialog (Views/TableListPage.xaml, Views/TableDetailDialog.xaml, and for a table with child tables Views/TableDetailMasterDialog.xaml with a grid per child) and their view models, reading and writing through clients.
UNO UNO_Dashboard, UNO_JunctionEditor UNO dashboard page over GET /api/dashboard (Dashboard=true, with DashboardStrip=true a strip above each list page), and 2-list editor of a many-to-many junction table over junction routes.
UNO UNO_Cart Uno shopping cart page and add to cart bar over the cart routes (CartTable).
UNO UNO_ODataClient, UNO_ODataPage OData client and list page per served table (OData=true), with a menu entry Table (OData).
UNO UNO_GridColumns ViewModels/GridColumnStore.cs and Views/GridCells.cs - whole-DB support code for the Columns menu of every Uno list page: saved choice of columns, cut of a long text, the cells of a row.
UNO UNO_Screens MainPage.Screens.cs and Services/ApiClients.cs - menu, screen switch and one client per table.
UNO UNO_SingleRowScreen Views/<Table>Page.xaml and .xaml.cs, for each table of SingleRowTables: the Uno counterpart of WinUI3_SingleRowScreen (the one row as a form, Save and Reload, no list and no Delete), read and saved through the table's API client.
UNO UNO_EssentialApp App.xaml, App.xaml.cs, MainPage.xaml and MainPage.xaml.cs - an essentials group: the application class and a main page with a NavigationView, the one HttpClient the API clients share (API_BASE_URL, else ApiPort) and the selection handler; the menu comes from UNO_Screens.
UNO UNO_EssentialProject <ProjectName>.Uno.csproj, global.json, Directory.Build.props, GlobalUsings.cs, the manifests, the desktop and WebAssembly Program.cs files and launchSettings.json - an essentials group: a single-project Uno app (Uno.Sdk) with the heads that build without a phone SDK.
UNO UNO_EssentialControls ViewModels/ViewModelBase.cs, ViewModels/GridSortStore.cs, Views/BusyOverlay, Views/PaginationBar, Views/CurrencyNumberFormatter.cs and Views/TreeViewDialog.cs - an essentials group the table templates use, so run it once before generating screens.
UNO UNO_EssentialSupport Services/ApiSupport.cs - an essentials group: ApiException, PagedResult<T> and the helpers the API clients use to read a response.
UNO UNO_EssentialOData Services/ODataSupport.cs - an essentials group (with OData=true): the helpers of the OData pages and clients: ODataApiException and ODataQuery (quoted literals, Contains, And, OrderBy, a URL-encoded query).
UNO UNO_EssentialAuth Services/AuthSession.cs, Views/LoginPage.xaml and .xaml.cs - an essentials group (with Auth=true): the sign-in against POST /api/auth/login: the token and user kept in memory, a bearer handler that signs the person out on a 401.
UNO UNO_EssentialTests <ProjectName>.Uno.Tests.csproj, FakeApi.cs, TestJson.cs and PlatformShims.cs - an essentials group: the plain net11.0 test project UNO_Test lives in, over a stand-in for the API (no window, no device).
UNO UNO_EssentialGit .gitignore - an essentials group: what an Uno app keeps out of version control.
UNO UNO_Test <Table>DetailViewModelTests.cs (<Table>DetailMasterViewModelTests.cs for a table with child tables) in the test project - with DesktopTests=true: the same cases as WinUI3_Test over a stand-in for the API, and the sentence the dialog shows when the API refuses a save or cannot be reached.
UNO UNO_People Services/PeopleApi.cs, Views/MembersPage.xaml and .xaml.cs - whole-DB, with Auth=true, ApiAuth and a UserTable: ChangePasswordAsync (the Set password box of the user table's form) and, with a TenantMembership, the members page where an administrator says who works in the tenant and in which role.
WinUI3 WinUI3_GridColumns ViewModels/GridColumnStore.cs and Views/GridCells.cs - whole-DB support code for the Columns menu of every WinUI3 list page: saved choice of columns, cut of a long text, the cells of a row.
WinUI3 WinUI3_Screens MainWindow.Screens.cs - whole-DB: other half of partial class MainWindow (AddScreens() adds menu entries, ShowPage(tag) shows page).
WinUI3 WinUI3_DashboardPage dashboard page for desktop, built in code, with strip above each list page.
WinUI3 WinUI3_Cart desktop shopping cart page and add to cart bar, with the cart's rules over the app's own database context (CartTable).
WinUI3 WinUI3_JunctionEditor 3 files (View, code-behind, ViewModel) — same shuttle-control idea as a desktop ContentDialog, calling SP_Junction directly through EF Core (also junction-only).
WinUI3 WinUI3_DirectoryListing 4 files — no table and no database: a Page listing files in a folder (sortable Name / Size / Modified, a filter box, Add File..., Open, Rename, Delete, Open Folder). The project settings ListingName, ListingFolder and ListingPattern name it; run it with the CLI without -S, -d or -t.
WinUI3 WinUI3_MasterScreen 3 files — a Page listing every row (grid + Add/Edit/Delete), calling TableRepo (CS_Repo) directly.
WinUI3 WinUI3_DetailScreen 3 files — a ContentDialog add/edit form, one field per column, drop-downs for foreign keys.
WinUI3 WinUI3_DetailMasterScreen WinUI3_DetailScreen's form plus one read-only child grid per table in TableModel.ChildForeignKeys (only offered when there's at least one).
WinUI3 WinUI3_SingleRowScreen Views/<Table>Page.xaml and .xaml.cs, for each table of SingleRowTables (a company's settings, a posting account): the one row as a form on the page itself with Save and Reload, no list, no Delete and no second row; an empty table shows a blank form and the first Save adds the row. The fields and the view model are the ones WinUI3_DetailScreen writes for the dialog.
WinUI3 WinUI3_EssentialApp App.xaml and App.xaml.cs - an essentials group (no table, no database): the application class: the control resources and OnLaunched, which opens MainWindow.
WinUI3 WinUI3_EssentialMainWindow MainWindow.xaml and .xaml.cs - an essentials group: a NavigationView with a content area, the shared database context and the selection handler (the menu entries come from MainWindow.Screens.cs, which WinUI3_Screens writes); with the desktop sign-in it shows the sign-in first, then the menu, the person's name and Sign out.
WinUI3 WinUI3_EssentialProject <AppNamespace>.csproj, app.manifest, appsettings.json and GlobalUsings.cs - an essentials group: the unpackaged x64 project with the packages the screens need and the EF Core provider of DatabaseProvider, and the connection string (never a password).
WinUI3 WinUI3_EssentialControls ViewModels/ViewModelBase.cs, ViewModels/GridSortStore.cs, Views/BusyOverlay, Views/PaginationBar, Views/CurrencyNumberFormatter.cs and Views/TreeViewDialog.cs - an essentials group the table templates use, so run it once before generating screens.
WinUI3 WinUI3_EssentialTests <ProjectName>.WinUI3.Tests.csproj, TestDb.cs, TestJson.cs and PlatformShims.cs - an essentials group: the plain net11.0 test project WinUI3_Test lives in, over an in-memory SQLite database made from the generated context (no window, no device).
WinUI3 WinUI3_Test <Table>DetailViewModelTests.cs (<Table>DetailMasterViewModelTests.cs for a table with child tables) in the test project - with DesktopTests=true: a blank row is refused with the first required field's sentence, a row opened and saved unchanged keeps every value, and each rule of the form refuses a spoiled value.
WinUI3 WinUI3_Auth Repositories/DesktopSignIn.cs, Views/LoginView.xaml and .xaml.cs - whole-DB, with Auth=true, a UserTable and ApiAuth: the sign-in of the desktop app, which checks the password against the user table with the hash the API writes and, with TenantTable, picks the tenant.
WinUI3 WinUI3_Members Views/MembersPage.xaml and .xaml.cs - whole-DB, with the desktop sign-in, TenantTable and a TenantMembership: the people of the current tenant with their role, Add member, Edit role and Remove.
WinUI3 WinUI3_Gates Gates.cs - whole-DB, with ChangeGates or GuardedColumns: the API's change checks for the desktop app, which reads the database itself: one <Table>Gates class per table whose CheckAsync the dialogs call before a save, answering a sentence; a guarded field is enabled only when the person may change it.

Screen-family mapping across platforms

WinUI3 (and Uno, which shares its XAML) needs 3 list/form templates where Angular, React and Blazor each need only 2 or 1, because they split the job differently rather than covering different ground:

Concept WinUI3 Uno (UNO) Angular (TS) React (TSX) Blazor (BLZ)
List grid WinUI3_MasterScreen UNO_MasterScreen folded into TS_Component folded into TSX_Page folded into BLZ_Page
Add/edit form WinUI3_DetailScreen UNO_DetailScreen folded into TS_Component folded into TSX_Page folded into BLZ_Page
Master-detail (parent + child grids; editable child rows and one-to-one extension sections with EditableChildren) WinUI3_DetailMasterScreen UNO_DetailMasterScreen TS_DetailMasterComponent TSX_DetailMasterPage folded into BLZ_Page
Junction (many-to-many editor) WinUI3_JunctionEditor UNO_JunctionEditor TS_JunctionComponent TSX_JunctionPage BLZ_Junction

WinUI3's list page and its add/edit form are 2 separate templates because the idiomatic WinUI3 pattern is a ContentDialog opened from the grid page. TS_Component and TSX_Page each generate a single file that already contains both the grid and an inline add/edit form on one screen, matching how a hand-written CRUD screen in those frameworks is usually built. Uno runs the same XAML as WinUI3, so its templates mirror the WinUI3 ones but read and write through the generated API instead of the database. Blazor, like Angular and React, fits the list and the form into one page (BLZ_Page, which also draws the child grids of a master-detail table); its junction page is a template of its own, routed at /<table>-links. Every platform ends up with the same coverage — list, add/edit, master-detail, junction — the web stacks just fit 2 or 3 of WinUI3's roles into one generated file.

Templates carry a version in file name (SP_Save_v1.tt). The menu shows only newest version of each; older ones stay on disk. Files you customize are never overwritten by an update — new shipped copy is written beside yours as <name>.new.

Solution structure

CodeGenNew.slnx
├── CodeGenNew.App                 WinUI 3 UI, MVVM via CommunityToolkit.Mvvm (TreeView, Connection/Location/Template Management dialogs)
├── CodeGenNew.Cli                 Scriptable console entry point (bypasses the WinUI 3 app)
├── CodeGenNew.Connections         Connect + test SQL Server, PostgreSQL and MySQL connections
├── CodeGenNew.SchemaIntrospection Reads tables/columns/PK/FK from DB; builds TableModel
├── CodeGenNew.TemplateEngine      Wraps Mono.TextTemplating; discovers/runs .tt templates; writes output files; seeds defaults
├── CodeGenNew.Core                Shared model classes (TableModel, ColumnModel, ForeignKeyModel, settings)
├── CodeGenNew.Tests               MSTest suite (see below)
├── Templates\                     The shipped .tt templates and their .tt.config files
└── Docs\                          specs.md (the specification), ARCHITECTURE.md (the reviewer guide), template notes, verification scripts

Tests

dotnet test CodeGenNew.Tests\CodeGenNew.Tests.csproj

The suite needs no database (live PostgreSQL and MySQL integration tests run only when CODEGENNEW_PG_* / CODEGENNEW_MYSQL_* environment variables name a server, and are skipped otherwise). It covers the file-writing engine (@@@FILE splitting, unsafe paths, output naming), template discovery and versioning, the seeder (created / refreshed / kept-customized, and that every file in Templates\ is actually shipped), the literal and display-column helpers, and it runs every shipped template against hand-built tables to check what it writes — the API, entity, validation, enum, repository, model, service, component and React-page rules, each template's refusals (composite keys, enum tables), and that changing a project setting changes the output. Most of the time goes to compiling templates.

Functionality Status

SQL Server, PostgreSQL and MySQL are supported, in the command-line tool and in the desktop app (choose the database type in the connection dialog; on the command line --provider SqlServer|PostgreSql|MySql, -S host[:port], -U / -P for PostgreSQL and MySQL; the default schema is public for PostgreSQL and database name for MySQL). Every template works for all three, and every SP_* template writes what the database has: stored procedures for SQL Server and MySQL, functions for PostgreSQL; the C# that calls them (CS_Repo, API_Search, API_Junction, WinUI3_JunctionEditor) calls each database's own kind. A database whose names are snake_case (customer_item, customer_id) is read with the project setting NamingStyle=Pascal (or --naming Pascal): the generated code says CustomerItem / CustomerId and the SQL keeps the real names. Only tables (not views).

License

MIT