How balajicm24/texmantra works
Purpose and Scope
TeXMantra is a Django-based journal-production workflow system covering article typesetting, LaTeX compilation, JATS XML creation/validation, and role-based handoff from typesetting to XML production. The only supplied repository artifact is [README.md](README.md); implementation layout and executable files are not available for verification.
Application Entry and Runtime Topology
The documented application runtime is Django 4.2, served with Daphne for ASGI/WebSocket traffic. Celery workers execute long-running processing, while Redis serves as both message broker and cache. Development uses SQLite; production targets PostgreSQL. Document tooling is installed as external system dependencies. Source entry-point paths cannot be identified beyond [README.md](README.md).
LaTeX Editing and Compilation Stage
The LaTeX editor is the first principal production stage: a browser IDE based on Monaco edits article source, supports version-oriented editing, and exposes compile output and PDF preview. Compilation invokes external TeX Live tools—pdflatex, xelatex, lualatex, bibtex, and biber—and supports SyncTeX source/PDF navigation. Long-running compile jobs cross from Django requests into Celery rather than blocking the UI. Documented in [README.md](README.md).
Conversion and Artifact Boundary
Compiled/source documents can be exported to HTML, DOCX, and JATS XML through Pandoc. This is a material boundary between LaTeX-oriented typesetting artifacts and structured publishing XML. Generated files and workflow-managed copies are expected to be path-controlled; the README identifies directory-traversal prevention and dangerous-LaTeX-command validation as security controls. Documented in [README.md](README.md).
XML Editing, Validation, and Preview Stage
The XML module is specialized for JATS finalization. It combines a file explorer, XML editor, and transformed preview, with JATS-aware completion/validation and source-to-preview synchronization. XSLT transformation is performed server-side with Saxon-HE (XSLT 2.0/3.0) or client-side with lxml, creating a clear boundary between XML authoring and rendered preview. Documented in [README.md](README.md).
Workflow, Access, and Collaboration
A guided “TS → XML” workflow coordinates task status, file movement, and assignment between Typeset and XML users. Authorization distinguishes SuperAdmin, Admin, TypesetUser, and XMLUser roles. Real-time collaboration, presence, and compilation logs use Django Channels/WebSockets; dashboard analytics use Chart.js. Redis is therefore operationally required for both collaboration and asynchronous work. Documented in [README.md](README.md).
Key External Dependencies
Core infrastructure/services are Redis, PostgreSQL in production, Celery workers, and Daphne. Core document-processing dependencies are TeX Live, Pandoc, Saxon-HE, and libmagic. Frontend architecture is server-rendered Django augmented with Bootstrap, jQuery, Monaco, PDF.js, Split.js, and jsTree rather than a separately evidenced SPA. See [README.md](README.md).
Main entry points: README.md Document safety controls
Components 19
Django application
- Production UI · Bootstrap/jQuery UI with Monaco, PDF.js, jsTree, and Chart.js.
- Django application · Owns roles, workflow state, files, and document-processing requests.
- Django Channels · Provides collaboration, presence, and compile logs.
- Roles and access · SuperAdmin, Admin, TypesetUser, and XMLUser permissions.
- Document safety controls · Path control, traversal prevention, and dangerous-LaTeX validation.
README.md
Production workflow
- LaTeX editor · Version-oriented source editing, compile output, and PDF preview.
- Compile jobs · Long-running compilation is dispatched from requests.
- Typeset artifacts · LaTeX source, compiled PDF, SyncTeX, and managed copies.
- JATS XML
- XML finalization · File explorer, XML editor, JATS-aware completion, and validation.
- Rendered XML preview · Supports source-to-preview synchronization.
- TS → XML workflow · Coordinates status, assignment, and file movement between roles.
Runtime services
- Daphne ASGI · Serves Django HTTP and WebSocket traffic.
- Celery workers
- Redis · Supports Celery and realtime collaboration.
- PostgreSQL / SQLite · SQLite in development and PostgreSQL in production.
Document tooling
- TeX Live · Runs pdflatex, xelatex, lualatex, BibTeX, and Biber.
- Pandoc · Exports HTML, DOCX, and JATS XML.
- Saxon-HE / lxml · Server-side Saxon-HE or client-side lxml transformation.
Connections 22
- Production UI → Daphne ASGI: HTTP and WebSocket
- Daphne ASGI → Django application: routes requests
- Django application → Roles and access: enforces
- Django application → PostgreSQL / SQLite: persists state
- Django application → Django Channels: realtime features
- Django Channels → Redis: realtime backing
- Production UI → LaTeX editor: edits
- LaTeX editor → Compile jobs: requests compile
- Django application → Compile jobs: dispatches
- Compile jobs → Celery workers: executes
- Celery workers → Redis: broker
- Celery workers → TeX Live: invokes
- TeX Live → Typeset artifacts: produces
- Typeset artifacts → Pandoc: exports from
- Pandoc → JATS XML: generates
- JATS XML → XML finalization: finalized in
- XML finalization → Saxon-HE / lxml: transforms via
- Saxon-HE / lxml → Rendered XML preview: renders
- TS → XML workflow → Typeset artifacts: moves managed files
- TS → XML workflow → XML finalization: hands off to XML users
- Django application → TS → XML workflow: coordinates
- Django application → Document safety controls: applies