How rasulboboev111-dotcom/docuflowversion2 works
Purpose and Runtime
DocuFlow is a Django-based electronic document-management system for creating, editing, approving, signing, archiving, and verifying documents. It runs as a server-rendered web application with HTMX/Alpine-enhanced UI, PostgreSQL persistence, MinIO/S3 file storage, and OnlyOffice browser editing.
Primary Django entry points are manage.py, config/settings.py, config/urls.py, and deployment composition in docker-compose.yml / Dockerfile.
Application Routing and UI Boundary
The Django project routes requests into three domain apps: core administration and audit, document workflow, and reference registries. Server views render templates; HTMX partial templates support live filtering/table refreshes rather than a separate SPA API.
Key paths: config/urls.py, core/urls.py, documents/urls.py, registry/urls.py, templates/base.html.
Identity, Roles, and Audit
core owns users, role/permission evolution, administrative user management, dashboards, reporting, monitoring, and audit visibility. Role-based access is a control boundary for document actions and registry/audit access; signals likely record cross-cutting lifecycle events.
Key paths: core/models.py, core/views.py, core/signals.py, templates/core/audit_list.html.
Document Domain and Approval Workflow
documents is the system’s central domain. Its models define documents, templates/registries, version history, status, priority, sender, UUID, and content hash evolution. Views and forms handle create/edit/detail/list/archive flows, while services centralize document processing.
The intended control flow is a five-stage approval sequence: Равзанаи ягона → Муҳандис → Мудир → Муовин → Директор. Approval state gates progression and finalization.
Key paths: documents/models.py, documents/views.py, documents/services.py, templates/documents/document_detail.html.
File Storage, Integrity, and Archive
Document binaries are stored externally in MinIO via its S3-compatible interface, while PostgreSQL stores document metadata and workflow state. UUID and hash migrations indicate durable document identity and integrity verification. Archive presentation is a first-class lifecycle state, not merely deleted content.
Key paths: documents/models.py, documents/migrations/0004_document_uuid.py, documents/migrations/0006_add_document_hash.py, templates/documents/archive_list.html.
OnlyOffice Editing and Visual Signing
OnlyOffice integration is isolated in document-specific views and local editor configuration. Browser editing/preview flows bridge Django document records to an OnlyOffice Document Server. Signing produces role-specific visual marks: QR codes for the Director and stamps for other approvers; static OnlyOffice QR plugin assets support editor-side functionality.
Key paths: documents/views_onlyoffice.py, config/onlyoffice_local.json, static/onlyoffice/plugins/qr_code/plugin.js, templates/documents/sign_document.html.
Registry Subsystem
registry is a separate reference-data domain, currently centered on mobile-phone records and import/list/edit UI. It is permission-controlled independently enough to have dedicated migration changes and routes, and can support document-related lookup/registry workflows without coupling its models into document views.
Key paths: registry/models.py, registry/views.py, registry/urls.py, templates/registry/phone_list.html.
Infrastructure and Operations
Docker Compose coordinates the application and its required service dependencies, notably PostgreSQL, MinIO, and OnlyOffice. Django provides ASGI and WSGI entry points for production server selection. Seed commands provide initial users and documents for bootstrap environments.
Key paths: docker-compose.yml, config/asgi.py, config/wsgi.py, core/management/commands/seed_users.py, documents/management/commands/seed_docs.py.
Main entry points: documents/views.py Document views and forms · urls.py Project routing · core/views.py Core administration · registry/views.py Reference registry
Components 18
Django application
- Django entry points · Management and ASGI/WSGI application entry points.
manage.py - Project routing
config/urls.py - Server-rendered UI · HTMX partials augment Django-rendered pages.
templates/base.html - Core administration · Owns users, roles, dashboards, reporting, and audit visibility.
core/views.py - Roles and audit · Role controls gate domain actions and lifecycle events are recorded.
core/models.py - Reference registry · Permission-controlled mobile-phone reference data and UI.
registry/views.py - User bootstrap
core/management/commands/seed_users.py
Document workflow
- Document views and forms · Handles create, edit, detail, list, and archive flows.
documents/views.py - Document records · Document metadata, versions, status, identity, and hash state.
documents/models.py - Five-stage approval · Равзанаи ягона → Муҳандис → Мудир → Муовин → Директор.
documents/services.py - Archive lifecycle · Archived documents remain a first-class presentation state.
templates/documents/archive_list.html - Visual signing · Director uses QR marks; other approvers use stamps.
templates/documents/sign_document.html - OnlyOffice integration · Bridges document records to browser editing and preview.
documents/views_onlyoffice.py - Document bootstrap
documents/management/commands/seed_docs.py
External services
- PostgreSQL · Persists document metadata, workflow state, users, and registries.
docker-compose.yml - MinIO / S3 · Stores document binaries externally.
docker-compose.yml - OnlyOffice Document Server
docker-compose.yml - Container composition · Coordinates application and required dependencies.
docker-compose.yml
Connections 26
- Django entry points → Project routing: starts
- Project routing → Core administration: routes
- Project routing → Document views and forms: routes
- Project routing → Reference registry: routes
- Core administration → Roles and audit: manages
- Roles and audit → Document views and forms: authorizes
- Roles and audit → Reference registry: authorizes
- Core administration → Server-rendered UI: renders
- Document views and forms → Server-rendered UI: renders
- Reference registry → Server-rendered UI: renders
- Document views and forms → Five-stage approval: advances
- Five-stage approval → Document records: updates state
- Document views and forms → Document records: reads and writes
- Document views and forms → Archive lifecycle: presents
- Document views and forms → Visual signing: initiates
- Visual signing → Five-stage approval: finalizes approvals
- Document records → PostgreSQL: persists metadata
- Document views and forms → MinIO / S3: stores binaries
- Document views and forms → OnlyOffice integration: opens editor
- OnlyOffice integration → OnlyOffice Document Server: integrates with
- Reference registry → PostgreSQL: persists reference data
- Container composition → PostgreSQL: runs
- Container composition → MinIO / S3: runs
- Container composition → OnlyOffice Document Server: runs
- User bootstrap → Core administration: initializes
- Document bootstrap → Document records: initializes