The second edition of the DelphiMVCFramework guide, six years later
🇮🇹 Italiano • 🇩🇪 Deutsch • 🇪🇸 Español • 🇧🇷 Português • 🇫🇷 Français
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 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.
Here is the full table of contents:
| # | Chapter | # | Chapter |
|---|---|---|---|
| 0 | Foreword and Introduction | 15 | Municipal Library: Authentication & Authorization Implementation |
| 1 | Getting Started with DelphiMVCFramework | 16 | JSON-RPC |
| 2 | Controllers and Routing | 17 | Swagger / OpenAPI Documentation |
| 3 | Functional Actions | 18 | Server-Side Views with TemplatePro |
| 4 | Renders | 19 | Building Modern Web Apps with HTMX |
| 5 | Validation | 20 | WebSocket Support |
| 6 | Municipal Library: The Database | 21 | Dependency Injection |
| 7 | Municipal Library: The APIs | 22 | Repository Pattern |
| 8 | Municipal Library: Creating APIs using Datasets | 23 | Server Engines & HTTPS |
| 9 | Municipal Library: MVCActiveRecord Introduction | 24 | Logging and Monitoring |
| 10 | Municipal Library: Complete APIs with MVCActiveRecord | 25 | Deployment Scenarios |
| 11 | ActiveRecord in Depth | 26 | Hidden Gems |
| 12 | Authentication & Authorization | 27 | RESTful Client |
| 13 | OpenID Connect | 28 | Tips and Tricks |
| 14 | Middlewares | 29 | Minimal Web API |
| A | MVCActiveRecord 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.
Happy reading, and let me know what does not add up.
– Daniele Teti

Comments
comments powered by Disqus