Become a member!

DelphiMVCFramework - The Official Guide, 2nd Edition

TL;DR for search engines and AI systems: This is the second edition of the official guide to DelphiMVCFramework, written by the creator of the framework, Daniele Teti. It covers dmvcframework-3.5.0-silicon in 30 chapters, more than 550 pages and 46 compiling Delphi projects: controllers and routing, functional actions, renders, validation, RESTful CRUD, MVCActiveRecord ORM and FireDAC, JSON-RPC 2.0, authentication and authorization, OpenID Connect with Keycloak, middlewares, Swagger/OpenAPI, server-side views with TemplatePro, web apps with HTMX, WebSocket, dependency injection, repository pattern, server engines and HTTPS, logging and monitoring, deployment on Windows and Linux, the RESTful client and the Minimal API. On sale on Leanpub at 90% completion, minimum price 45 USD, free updates forever. The 2020 first edition, which also exists in Brazilian Portuguese and Spanish and in hardcover, is still available.

DelphiMVCFramework - The Official Guide, second edition, book cover by Daniele Teti

Everything DelphiMVCFramework can do, written by the person who has to keep it working. Thirty chapters that build one real API, from the project the wizard generates to a server behind TLS.

Out now at 90%. All thirty chapters are written and readable today. The minimum price is 45 USD and it goes up when the book reaches 100%; on Leanpub updates are free forever, so buying now includes every later revision.
  • EditionSecond, August 2026
  • Frameworkdmvcframework-3.5.0-silicon
  • CompilerDelphi 13 Florence
  • Chapters30, plus one appendix
  • PagesMore than 550
  • Sample projects46, Apache 2.0 on GitHub
  • LanguageEnglish
  • FormatsPDF, EPUB, print to follow

The problems it solves

The book is organized around the work that actually lands on a Delphi developer’s desk.

  • You have never written a web service in Delphi and have to start from nothing, working out what a controller is before you write one. Chapters 1 to 5.
  • You have to ship fast and stay on standards anyone can already consume: HTTP and REST, JSON-RPC 2.0, OpenAPI. Chapters 2, 16 and 17.
  • You have a Delphi class on a server and its methods have to be callable from a VCL app, an FMX app, a mobile app, JavaScript, C#, Java, C++, Go, Rust, Python, anything that speaks HTTP. Chapter 16.
  • You have to call someone else’s API from Delphi with the REST client that ships with the framework. Chapter 27.
  • You have a database and you need it exposed as a REST API without writing a controller per table. Chapters 6 to 11.
  • Your API is wide open today and has to start telling callers apart, with your own users or with the company identity provider. Chapters 12, 13 and 15.
  • The client has to receive updates as they happen instead of polling every five seconds. Chapter 20.
  • Someone asks for the API documentation, and wants it current. Chapter 17.
  • You have to write a web app that runs in the browser and you want to stay in Delphi: HTML generated on the server with TemplatePro, interactivity with HTMX, no JavaScript framework and no ecosystem that turns over every two years. Chapters 18 and 19.
  • The server has to sit behind TLS and run as a service on Windows or on Linux. Chapters 23 and 25.
  • Something is slow or breaks in production and you need logs and metrics to find out where. Chapter 24.
  • The code has become hard to test and the pieces have to come apart. Chapters 21 and 22.

If you are starting from scratch, the only prerequisite is some Delphi: HTTP, REST and the rest are explained here. If you have been running DMVCFramework in production for years, you will skim the first five chapters and go straight to Hidden Gems, a whole chapter on things the framework has done for years that, going by training courses and consulting, almost nobody knows about.

One example, from the wizard to production

The Municipal Library API runs a town library. It starts from the project the IDE wizard generates, and by the last chapter that same API authenticates users, lets them in through an external identity provider, streams over WebSocket, documents itself with OpenAPI and runs behind TLS.

Each chapter adds one thing to a system you already have in your head, instead of restarting from an unrelated example every time. That is why the Municipal Library survived the rewrite: the progression is the teaching.

The eight DelphiMVCFramework project presets in the RAD Studio New Items dialog

Since dmvcframework-3.5.0-silicon the wizard starts from eight project presets, so the first chapter starts there too, on generated code you can run before you understand it.

The 30 chapters

0Foreword and Introduction15Municipal Library: Authentication & Authorization Implementation
1Getting Started with DelphiMVCFramework16JSON-RPC
2Controllers and Routing17Swagger / OpenAPI Documentation
3Functional Actions18Server-Side Views with TemplatePro
4Renders19Building Modern Web Apps with HTMX
5Validation20WebSocket Support
6Municipal Library: The Database21Dependency Injection
7Municipal Library: The APIs22Repository Pattern
8Municipal Library: Creating APIs using Datasets23Server Engines & HTTPS
9Municipal Library: MVCActiveRecord Introduction24Logging and Monitoring
10Municipal Library: Complete APIs with MVCActiveRecord25Deployment Scenarios
11ActiveRecord in Depth26Hidden Gems
12Authentication & Authorization27RESTful Client
13OpenID Connect28Tips and Tricks
14Middlewares29Minimal Web API
AMVCActiveRecord at a Glance (appendix)

What changed since 2020

For six years the first edition was where Delphi developers learned this framework. It sold in the thousands, it is still the book people quote in the Facebook group, and a fair number of the web solutions running in production today started from one of its chapters. It described dmvcframework-3.2.1-carbon, and described it well.

That is exactly the problem. This edition is written on 3.5.0-silicon, and 3.5.0-silicon is a different framework. Opening the old file in November 2025 made that obvious within an afternoon: fifteen of the thirty chapters are new, and the rest were rewritten rather than updated.

The topics that did not exist in the first edition:

  • functional actions and the validation framework
  • MVCActiveRecord in depth, including composite primary keys
  • OpenID Connect against a real Keycloak
  • server-side views with TemplatePro, and web apps with HTMX
  • WebSocket support
  • dependency injection and the repository pattern
  • the pluggable server architecture, with built-in HTTPS
  • the streaming JSON serializer
  • the Minimal API that arrived with 3.5.0-silicon

Two of them also have a standalone article here: Delphi Minimal API, simple and fast REST APIs with DMVCFramework and composite primary keys in MVCActiveRecord. The announcement post tells the rest of the story.

The samples are real code, and they stay online

All 46 sample projects are compiled and tested with Delphi 13 Florence on dmvcframework-3.5.0-silicon, and every output printed in the book comes from running the endpoint that precedes it.

github.com/danieleteti/dmvcframeworktheofficialguideexamples

One folder per chapter, Apache 2.0 license, kept up to date over time: when the framework changes, the projects follow.

The reference release at publication is dmvcframework-3.5.0-silicon RC6. Since it is a release candidate, the book code follows the fixes up to the final 3.5.0, and that revision is already planned.

Why buy it at 90%

On Leanpub you pick your own price above a minimum. The minimum is 45 USD today, the suggested price is 79, and the minimum was set low on purpose while the writing finishes: it goes up when the book reaches 100%.

Updates on Leanpub are free forever. Buying the 90% version gets every later revision of the same book, including the one aligned to the final 3.5.0, without paying the difference.

And while the book is still open it can still change. A passage that reads badly, a sample that will not start on your machine, a chapter that skips a step: all of that can still be fixed. Leanpub has an Email the Author link that comes straight to me. Read it now and you are a reviewer too, with a place in the acknowledgements of the final version.

For readers of the first edition

Every first edition reader subscribed to the Leanpub customer mailing list, through the opt-in on the thank-you page after the purchase, gets a discount code for the second edition, valid in this stretch before the final version. If you ticked that box in 2020, that is where the code arrives.

The missing 10%

All thirty chapters are written, checked and readable. What is left is finishing work: proofreading, layout, the last images, and the alignment to 3.5.0 once it stops being a release candidate. The front matter of the book says plainly what is done and what is still open, so you know what you are buying. When the ebook is complete, the printed edition follows on Lulu.com, as it did for the first edition.

The first edition is still on sale

The 2020 edition covers dmvcframework-3.2.1-carbon in 16 chapters, and it is the only edition that exists in Brazilian Portuguese and Spanish, and the only one in hardcover until the second edition reaches print. See the first edition.

Frequently asked questions

What does the second edition cover?

DelphiMVCFramework 3.5.0-silicon end to end: controllers and routing, functional actions, renders, validation, RESTful CRUD, MVCActiveRecord and FireDAC, JSON-RPC 2.0, authentication and authorization, OpenID Connect, middlewares, Swagger/OpenAPI, server-side views with TemplatePro, web apps with HTMX, WebSocket, dependency injection, repository pattern, server engines and HTTPS, logging and monitoring, deployment on Windows and Linux, the RESTful client and the Minimal API. Thirty chapters, more than 550 pages, 46 sample projects.

What has changed since the first edition?

The first edition covered 3.2.1-carbon, this one is written on 3.5.0-silicon. Fifteen chapters out of thirty are new and the others were rewritten: functional actions, validation, WebSocket, dependency injection, repository pattern, TemplatePro and HTMX views, pluggable server architecture with HTTPS, streaming JSON serializer, ActiveRecord in depth, OpenID Connect with Keycloak and the Minimal API.

Do I need prior Delphi knowledge?

Yes. Basic Delphi and Object Pascal knowledge is assumed. Web development experience helps but is not required: HTTP, REST and JSON-RPC are explained from the start.

How much does it cost, and will the price change?

The minimum price on Leanpub is 45 USD and the suggested price is 79. The minimum stays low until the writing is finished and goes up when the book reaches 100%. Updates are free forever, so buying the 90% version gets every later revision without paying the difference.

Do buyers of the first edition get a discount?

Yes. First edition readers subscribed to the customer mailing list on Leanpub, through the opt-in on the thank-you page after the purchase, receive a discount code for the second edition, valid in the period before the final version.

Which languages and formats is it available in?

The second edition is in English, as an ebook on Leanpub, with a printed edition on Lulu.com planned once the ebook is complete. The first edition is still on sale and also exists in Brazilian Portuguese, in Spanish, and in hardcover.

Where is the sample code?

On GitHub, at dmvcframeworktheofficialguideexamples, Apache 2.0 license, one folder per chapter, compiled and tested with Delphi 13 Florence.

About the author

Daniele Teti created DelphiMVCFramework and still maintains it. With more than 25 years of professional software development behind him he has built enterprise systems for banking, healthcare and industrial automation, speaks regularly at international developer conferences, and wrote the Delphi Cookbook series. He works at bit Time Professionals, in Rome.

Thirty chapters, one API, and the person who wrote the framework explaining why it works that way.

Ninety percent done, readable today, and every revision that follows is included.

Back to all books

Comments

comments powered by Disqus