Leanpub Header

Skip to main content

Building a Document Management System

with Django 6.1, HTMX and pgvector

Building a Document Management System
This book is 100% completeLast updated on 2026-10-08

Build a real document management system from scratch to production: OCR, keyword and semantic search, an AI assistant that cites its sources, sharing and approvals, Docker, Nginx and private HTTPS.

This book is a translation into English of Costruire un sistema documentale which was originally written in Italian

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
About

About

About the Book

Every archive ends up the same way: files in a dozen places, three copies of "contract_final_v2_DEFINITIVE.pdf", and no way to find what you know you have.

This book shows you how to build the software that fixes that, from the first line of code to a production server. The project is DjangoVault, a real system the author uses to keep his own documents in order. It is not a toy example. The choices you will meet, including the wrong ones that were later corrected, are the ones actually made, and every chapter explains why.

What you will build:

  • Upload, deduplication and a full version history: every change is a new version, nothing is overwritten
  • Background processing with Celery and Redis, including OCR for scanned documents
  • Keyword search and semantic search by meaning, powered by PostgreSQL and pgvector
  • An assistant that answers questions about your archive and cites the documents behind each answer
  • Automatic category suggestions, applied only when the system is very sure
  • Sharing at three levels (read, edit, administer) and review with approvals
  • Real-time updates, a watched folder, mail ingestion, and a phone app with document scanning
  • Production deployment with Docker Compose, Nginx, private HTTPS and automatic backups

The approach is deliberate: pages rendered by the server and small touches of HTMX, no second project to maintain, and a system a single person can run. Confidential documents never reach an external AI service unless you consent, document by document.

Who it is for: Python developers who have already built at least one small Django application. You do not need to know Celery, Docker, Redis, Nginx, pgvector or HTMX: each tool is introduced at the point where the project needs it, and the book explains the problem it solves before showing how to use it.

How it is organized: 17 chapters in five parts (foundations, reading, ordering, ingestion, production) and five appendices: an operating guide, a glossary, a command reference, a chapter-to-project map, and a bonus guide to building a file server with remote access. Every chapter ends with a summary and exercises, and the code for each chapter is on GitHub, so you can always compare your work and restart from the right point.

This book is a translation into English of Costruire un sistema documentale which was originally written in Italian

Author

About the Author

Franky Bonanno

Franky Bonanno is a software developer and entrepreneur based in Catania, Sicily, with more than twenty years of experience in IT, including a past as a CTO. He builds and maintains several SaaS platforms in Python and Django, and he also writes novels. This book grew out of a system he built for himself and uses every day.

Translations

Translations

Languages

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub