Nginx edge
TLS · rate limits · write-stop
Signed manifest
Ed25519 · feature switches
Django web
Read-only container · health probes
Realtime
Server-sent events
PostgreSQL
4 scoped roles · no public port
One-shot jobs
bootstrap → migrate → finalize
Backups
sha256 · restore-verified offline
01 / Platform delivery
One codebase. Locked-down, repeatable deployments.
A Persian-first CRM/ERP for sales, billing, inventory, telephony, and after-sales. I built the application and the delivery around it: each installation runs as an isolated Compose stack whose features are switched by a signed manifest, behind an Nginx edge, with least-privilege PostgreSQL roles.
- Django
- PostgreSQL
- Docker Compose
- Nginx
- Ed25519
Delivery / Shipped as tagged releases (v2.40.42 in October 2026), with a deploy script that backs up, migrates, and can roll back.
Engineering notes
Problem
The same CRM has to run as separate installations, each with its own database, secrets, and feature set, and an administrator on the host must not be able to change which features are enabled.
My role
Sole author of the repository: application, PostgreSQL bootstrap, Compose topology, Nginx edge, deployment scripts, and the operations runbook.
Approach
- Feature availability comes from a manifest signed with an Ed25519 key that never leaves the platform owner. Production refuses to start if the manifest is missing, tampered with, or signed by an unknown key.
- Four PostgreSQL logins with separate rights: bootstrap, migration owner, runtime application, and a read-only backup role. One-shot jobs (db-bootstrap → migrate → db-finalize) apply exact grants before the web service may start.
- Images are referenced by sha256 digest and built from the tagged commit, not the working tree.
Security & reliability
- deploy.sh refuses to half-apply an upgrade: backup, migrations, grant refresh, and Nginx config reload run in a fixed order, with --rollback to the previous image.
- An Nginx write-stop mode rejects POST/PUT/PATCH/DELETE during maintenance while reads keep working.
- Backups are checksummed and restored into an isolated container with networking disabled, so a backup counts only once it has been restored.
- Containers run read-only with all capabilities dropped and no-new-privileges.
Result
- Versioned releases with a changelog for each one; the repository records a suite of about 3,500 automated tests.
- A single deployment runbook covers first install, update, backup/restore, rollback, and incident response.
