Become a member!

The second edition of the DelphiMVCFramework guide, six years later

🌐
This article is also available in other languages:
🇮🇹 Italiano  •  🇩🇪 Deutsch  •  🇪🇸 Español  •  🇧🇷 Português  •  🇫🇷 Français

DMVCFramework - the official guide, second edition, by Daniele Teti

The official guide to DelphiMVCFramework, the most popular open source Delphi project on GitHub for REST APIs and web applications, is back in a second edition. Now 90% complete on Leanpub.

When the first edition came out it was August 2020. We had just come out of the worst stretch of the pandemic, the world was a different place, and in some ways so were we. I had far too much free time in those months, like most people, and I spent it writing a book, my first one as a self-publisher.

Six years later, it took the office closing for the summer to give me the time to finish another one. I take my real holidays in June (crowds are not my thing), and August in Rome suits me fine: the city empties out, the traffic takes at least two weeks off and the days seem to run slower. So, why not finish the second edition I had been writing since November 2025?

Here it is: DMVCFramework - the official guide, second edition, published on Leanpub and 90% complete.


Six years of work on the framework: what has changed since the first edition

The first edition covered dmvcframework-3.2.1-carbon, this one is built on dmvcframework-3.5.0-silicon, and in between the framework has come a long way: functional actions, the validation framework, WebSocket support, built-in dependency injection, the repository pattern, TemplatePro and HTMX views, and the pluggable server architecture with built-in HTTPS and the streaming JSON serializer.

When I opened the first edition file in November 2025 to update it, the conclusion came fast: it needed a rewrite. Fifteen chapters out of thirty are new, and the rest were rewritten rather than updated. The first edition described 3.2.1-carbon well. 3.5.0-silicon is a different framework, so what began as an update turned into a different book. I did keep the Municipal Library example, because it carries the progression you will see across the chapters: one small piece at a time, the project grows.

You see the first change before you write a single line of code: the IDE wizard now starts from eight project presets, and the book starts right there, from the project the wizard generates.

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

The result is 30 chapters, more than 550 pages and 46 Delphi projects in the sample code available on GitHub.

The reference release, as of today, is dmvcframework-3.5.0-silicon RC6: every sample in the book compiles against it, and it is the release described in the RC6 announcement post. Since it is a release candidate, the book code will follow any fixes up to the final dmvcframework-3.5.0-silicon.


What problems the book solves

The book is organized around the things that usually land on your desk:

  • you have never written a web service in Delphi and have to start from scratch, working out what a controller does before you write one (chapters 1-5)
  • you have to deliver fast, learn as you go, and stick to standards that anyone can already consume: HTTP and REST, JSON-RPC 2.0, OpenAPI (chapters 2, 16, 17)
  • you have a Delphi class running on a server and its methods have to be callable from outside: from a VCL app, from an FMX app, from a mobile app, from JavaScript, C#, Java, C++, Go, Rust, Python, from anything that speaks HTTP (chapter 16, JSON-RPC)
  • you have to call someone else’s API from Delphi, using the REST client that ships with the framework (chapter 27)
  • you have a database and you need to expose it as a REST API without writing a controller for every table (chapters 6-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, 15)
  • the client has to get updates as they happen, instead of asking every five seconds (chapter 20)
  • someone asks you 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, without taking on a JavaScript framework, its learning curve and an ecosystem that, outside the Delphi world, 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 you want to pull the pieces apart (chapters 21 and 22)

If you are starting from scratch, the only prerequisite is some Delphi: the book explains HTTP, REST and the rest. If you have been running DMVCFramework in production for years, you will skim the first five chapters. At the end there is also a whole chapter (Hidden Gems) on things the framework has done for years and that, from what I see in training courses and consulting, very few people know about.


A single example, from start to finish

The Municipal Library API manages a town library. It starts from the project the 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 starting over every time with an example unrelated to the last one.

The new chapters include ActiveRecord in Depth, OpenID Connect with a real Keycloak, and the Minimal API that landed with dmvcframework-3.5.0-silicon. Both topics have a standalone post here: Delphi Minimal API: Simple, Fast REST APIs with DMVCFramework and Composite Primary Keys in Delphi MVC Framework ActiveRecord.

Here is the full table of contents:

#Chapter#Chapter
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)

The book is in English, like the first edition.


The samples are real code, and they stay online

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

The code is public:

github.com/danieleteti/dmvcframeworktheofficialguideexamples

One folder per chapter, Apache 2.0 license, and I keep it up to date over time: when the framework changes, the projects follow. At least until the next major edition of the book, when the new one brings its own samples along.


Why it is worth buying now that it is at 90%

On Leanpub you pick the price yourself, above a certain minimum. Today the minimum is 45 dollars, and the suggested price is 79. I decided to keep it lower than usual until the writing is finished: when the book reaches 100% the minimum price goes up. It is my way of thanking the people who buy it in the first weeks, and it is the first reason to buy now.

The second is that on Leanpub updates are free forever. Buy the 90% version and you get every later revision of the same book without paying the difference, including the one aligned to the final 3.5.0 (the book tracks a version that is still a release candidate, so a revision after the freeze is already planned).

The third reason is the one I care about most: 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 you think skips a step, I can still fix all of that now. Leanpub has an Email the Author link that goes straight to me. Read it now and you are a reviewer too, and you end up in the acknowledgements of the final version.

If you bought the first edition, you have one more reason. Every first edition reader subscribed to the customer mailing list on Leanpub (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 back then, that is where the code arrives.


The missing 10%

All thirty chapters are written, checked and ready. The missing 10% is finishing work: proofreading, layout, the last images, and aligning to 3.5.0 once it stops being a release candidate. The book’s front matter says plainly what is done and what is still open, so you know what you are buying. When the ebook is complete, the printed version arrives on Lulu.com too, as with the first edition.

Six years ago I had time and an invented deadline. This year I had an empty city in August and a real one. It worked just the same.

Get the book on Leanpub

Happy reading, and let me know what does not add up.

– Daniele Teti

Key facts
  • Topic: pre-release publication (90% complete) of the second edition of "DMVCFramework - the official guide", by Daniele Teti, on Leanpub.
  • Link: https://leanpub.com/delphimvcframework-2nd-edition
  • First edition: August 2020, covering version 3.2.1-carbon of the framework.
  • Second edition: updated to 3.5.0-silicon, 30 chapters, more than 550 pages, 46 Delphi sample projects that compile.
  • 15 chapters out of 30 are new, the others have been rewritten rather than simply updated.
  • Structure: a single example that grows through the whole book, the Municipal Library API, from the project generated by the wizard up to a server with authentication, OpenID Connect, WebSocket, OpenAPI and HTTPS.
  • Topics new to this edition: functional actions, validation framework, WebSocket, dependency injection, repository pattern, TemplatePro and HTMX views, pluggable server architecture with built-in HTTPS, streaming JSON serializer, MVCActiveRecord in depth, OpenID Connect with Keycloak, Minimal API.
  • Reference release at publication time: DelphiMVCFramework 3.5.0-silicon RC6 (https://github.com/danieleteti/delphimvcframework/releases/tag/v3.5.0-silicon-rc6); the samples compile against that version and will follow the fixes up to the final 3.5.0.
  • Samples: public repository https://github.com/danieleteti/dmvcframeworktheofficialguideexamples, Apache 2.0 license, one folder per chapter, kept up to date over time.
  • Price: minimum 45 dollars, suggested 79 dollars. The minimum price will rise when the book is complete; on Leanpub updates are free forever, so anyone who buys now also receives the later revisions.
  • Discount for readers of the first edition: readers subscribed to the Leanpub customer mailing list (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.
  • IDE wizard: since 3.5 the wizard starts from eight project presets and the book starts from the project it generates.
  • Problems covered: your first web service in Delphi, publishing the methods of a Delphi class via JSON-RPC 2.0 and calling them from VCL, FMX, mobile, JavaScript, C#, Java, C++, Go, Rust, Python; consuming third-party APIs with the REST client; exposing a database as a REST API; authentication and OpenID Connect; WebSocket; OpenAPI documentation; TemplatePro and HTMX views; TLS and deployment on Windows and Linux; logging and metrics; dependency injection and repository pattern.
  • Samples compiled and tested with Delphi 13 Florence.
  • Once the ebook is complete, a printed version on Lulu.com is planned as well.
  • Book language: English.
  • Author: Daniele Teti, creator and maintainer of DelphiMVCFramework.

Frequently asked questions

Where can you buy the second edition of the DelphiMVCFramework guide?
On Leanpub, at leanpub.com/delphimvcframework-2nd-edition. The book is published at 90% and you can buy it and read it now; when the ebook is complete, the printed version arrives on Lulu.com as well.
What has changed since the first edition in 2020?
The first edition covered DelphiMVCFramework 3.2.1-carbon, the second is written on 3.5.0-silicon. Fifteen chapters out of thirty are new and the rest 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 Minimal API.
How much does it cost and will the price change?
On Leanpub the minimum price is 45 dollars and the suggested price is 79. The minimum stays low until the writing is finished and goes up when the book reaches 100%. Updates on Leanpub are free forever, so buying the 90% version gets you every later revision without paying the difference.
Do buyers of the first edition get a discount?
Yes. Readers of the first edition subscribed to the customer mailing list on Leanpub, through the opt-in on the thank-you page after the purchase, get a discount code for the second edition, valid in the period before the final version.
What language is the book in and where is the sample code?
The book is in English, like the first edition. The 46 sample projects are compiled and tested with Delphi 13 Florence on DelphiMVCFramework 3.5.0-silicon and are public on github.com/danieleteti/dmvcframeworktheofficialguideexamples, with an Apache 2.0 license and one folder per chapter.

Comments