Official Examples and Hands-on Projects Repository
🌐 Language / Idioma: English | 🇧🇷 Edição em Português
This repository contains all the source code, runnable projects, .http interactive request files, and automated end-to-end test scripts featured in the book Professional Web Development with Delphi and Dext Framework, written by Cesar Romero.
This book is a comprehensive, production-grade guide to building modern, high-throughput cloud web applications and microservices with Delphi and the Dext Framework — covering Minimal APIs, Dependency Injection, high-performance ORM, Clean Architecture, CQRS, Docker containerization, Kubernetes observability, and AI-native integrations (Model Context Protocol - MCP).
Explore all available editions and retailers (Kindle & Paperback) on the official book page:
👉 https://www.cesarromero.com.br/books/dext-web-en/
All examples throughout this book are built with the Dext Framework — an advanced, native full-stack framework for Object Pascal / Delphi inspired by modern architectures like ASP.NET Core and Fastify.
- Official Dext Repository: https://github.com/dotpas/dext
- Quick installation via TMS Smart Setup:
tms install dotpas.dext
- Embarcadero Delphi 11 Alexandria or Delphi 12 Athens (Community, Professional, or Enterprise).
- Dext Framework installed or configured in your Delphi Library Path.
- PowerShell 7+ (optional, for running the automated validation test suite).
All 29 projects and their .dproj files are registered in the unified group project:
➡️ BookDextWebExamples.groupproj (open it directly in RAD Studio / Delphi IDE).
| Chapter | Directory | Project File | Description |
|---|---|---|---|
| Ch. 01 | chapter-01-first-api |
Chapter01_FirstAPI.dpr |
Minimal high-throughput HTTP server. |
| Ch. 02 | chapter-02-minimal-apis |
Chapter02_InvoicesMinimalAPI.dpr |
Minimal APIs, route/query parameters, and Results. |
| Ch. 03 | chapter-03-model-binding |
Chapter03_ModelBindingApp.dpr |
Multi-source model binding, on-disk upload, and QUERY. |
| Ch. 04 | chapter-04-http-pipeline |
Chapter04_MiddlewareApp.dpr |
Bidirectional middleware pipeline and global error handling. |
| Ch. 05 | chapter-05-validation |
Chapter05_ValidationApp.dpr |
Fluent validation and Problem Details (RFC 9457). |
| Ch. 06 | chapter-06-configuration |
Chapter06_ConfigApp.dpr |
YAML loading, environment variables, and IOptions. |
| Ch. 07 | chapter-07-controllers |
Chapter07_ControllerApp.dpr |
REST controllers and typed routes. |
| Ch. 08 | chapter-08-orm-basics |
Chapter08_OrmBasicsApp.dpr |
Basic persistence, relational mapping, and Unit of Work. |
| Ch. 09 | chapter-09-smart-properties |
Chapter09_SmartPropertiesApp.dpr |
Smart Properties, type-safe queries, and AST in Pascal. |
| Ch. 10 | chapter-10-specifications |
Chapter10_SpecificationsApp.dpr |
Specification Pattern and keyset pagination. |
| Ch. 11 | chapter-11-domain-cqrs |
Chapter11_DomainCqrsApp.dpr |
Rich domain model, POCO entities, and CQRS. |
| Ch. 12 | chapter-12-multi-tenancy |
Chapter12_MultiTenancyApp.dpr |
Relational mapping and multi-tenant isolation with ITenantAware. |
| Ch. 13 | chapter-13-database-as-api |
Chapter13_DataApiApp.dpr |
Database-as-API with governance and allowlist. |
| Ch. 14 | chapter-14-auth-jwt |
Chapter14_SecurityJwtApp.dpr |
JWT authentication, BCrypt, RBAC, and security headers. |
| Ch. 15 | chapter-15-authorization |
Chapter15_AuthorizationApp.dpr |
Role-, claim-, and policy-based authorization. |
| Ch. 16 | chapter-16-cache-resilience |
Chapter16_CacheCapacityApp.dpr |
L1/L2 Redis cache, dynamic compression, and rate limiting. |
| Ch. 17 | chapter-17-resilience |
Chapter17_ResilienceApp.dpr |
Asynchronous 202 Accepted, Circuit Breaker, and TDextJobs. |
| Ch. 18 | chapter-18-observability |
Chapter18_ObservabilityApp.dpr |
Kubernetes health probes and Prometheus metrics. |
| Ch. 19 | chapter-19-openapi-swagger |
Chapter19_SwaggerApp.dpr |
Interactive Swagger UI and OpenAPI 3.0. |
| Ch. 20 | chapter-20-frontend-ssr-htmx |
Chapter20_RealtimeApp.dpr |
SSR with Dext Templates and HTMX. |
| Ch. 21 | chapter-21-grpc-protobuf |
Chapter21_GrpcApp.dpr |
Binary APIs with gRPC and Protocol Buffers. |
| Ch. 22 | chapter-22-automated-testing |
Chapter22_TestRunnerApp.dpr |
Test suite with the Dext Testing Framework. |
| Ch. 23 | chapter-23-docker-runtime |
Chapter23_DockerRuntimeApp.dpr |
Native Linux64, multi-stage Dockerfile, and graceful shutdown. |
| Ch. 24 | chapter-24-ai-native-mcp |
Chapter24_McpServerApp.dpr |
AI-native APIs and Model Context Protocol (MCP) server. |
| Lab 01 | lab-01-customers-api |
Lab01_CustomersApi.dpr |
Full customers microservice with fluent validation. |
| Lab 02 | lab-02-persistence-billing |
Lab02_PersistenceBilling.dpr |
Billing persistence, Smart Properties, and keyset. |
| Lab 03 | lab-03-secure-multitenant |
Lab03_SecureMultiTenant.dpr |
Secure multi-tenant core with CQRS and JWT. |
| Lab 04 | lab-04-docker-microservice |
Lab04_DockerMicroservice.dpr |
Observable Docker microservice with OpenAPI. |
| Lab 05 | lab-05-enterprise-final |
Lab05_EnterpriseFinal.dpr |
Consolidated multi-channel enterprise application. |
Each project has a dedicated PowerShell script for endpoint validation and tests:
Test.ChapterXX_<ProjectName>.ps1/Test.LabXX_<ProjectName>.ps1: Runs the compiled binary, sends HTTP/gRPC/CLI validation requests, checks responses, and cleans up the background process.
compile_all_examples.ps1: Compiles all 29.dprprojects with RAD Studio'sdcc64.exe.test_all_examples.ps1: Runs everyTest.*.ps1script in sequence and prints a consolidated report.build_and_test_all_examples.ps1: Full pipeline: strict compile of all projects, then run and validate tests for all 29 projects.