Most legacy systems don't need a rewrite so much as a contract. ServiceStack's AutoGen reads an existing database's schema at startup and generates a complete, typed API over it — Request DTOs, data models, implementations and human-friendly pluralized routes — without migrating a single row.
From there the whole framework applies: instant UIs, typed clients in 15 languages, gRPC and MQ endpoints, declarative validation, authorization and audit history.
GenerateCrudServicesHow it works​
Enabling it is a single plugin option — AutoGen inspects the registered connection and registers AutoQuery and CRUD Services for each table it finds:
services.AddPlugin(new AutoQueryFeature {
MaxLimit = 1000,
GenerateCrudServices = new GenerateCrudServices {
DbFactory = ormLite.DbFactory,
}
});
INFO
Prefer to review the models before they become APIs? okai TypeScript Data Models takes the other route — export the DB schema to editable TypeScript models first, then generate the APIs, C# data models and migrations from those.
Your conventions, not just ours​
AutoGen's code generation is programmatically customizable. Generated types can be augmented with declarative attributes so your App's existing conventions — authorization, validation rules, tags, descriptions, formatting — are baked into the generated Services rather than bolted on afterwards.
When the conventions are right, the generated classes can be ejected into code-first C# and developed as normal. AutoGen is a way in, not something you're stuck with.
Reachable from everywhere​
Because AutoGen produces ordinary ServiceStack Services, they inherit every endpoint and client the framework supports. That makes it the fastest route to putting gRPC in front of an existing system — which in turn opens it to every language in gRPC's protoc universe.
The Smart, Generic C# / F# / VB.NET Service Clients still give the best UX for consuming gRPC Services, but the protoc-generated Dart client is a close second — a high-level language with native-class performance and script-like productivity, which makes it an ideal way to explore a freshly servicified system. And anything Dart reaches, Flutter reaches too.
Modernizing without rewriting​
This is what makes AutoGen useful beyond greenfield work: it lets you modernize parts of a legacy system incrementally, at low cost. Once a database is behind typed contracts you can enable Multitenancy, Optimistic Concurrency, declarative validation and Executable Audit History without changing the schema.
Business users can maintain validation rules in the RDBMS and manage them through the Admin UI, where they're applied instantly at runtime and surfaced through ServiceStack's client UI auto-binding options. Locode then gives stakeholders an instant UI to search their data, export queries to Excel, or work through a custom UI with fine-grained control over which tables and operations each user can reach.
Next steps​
Configure, customize and export the generated APIs and data models.
Understand the queryable APIs AutoGen is generating for each table.
Turn the generated APIs into a branded CRUD App for your stakeholders.