Skip to content

Commit e3b4314

Browse files
InitRelease
1 parent 5257880 commit e3b4314

17 files changed

Lines changed: 3161 additions & 0 deletions

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,15 @@ cython_debug/
205205
marimo/_static/
206206
marimo/_lsp/
207207
__marimo__/
208+
209+
# Office
210+
*.ppt
211+
*.pptx
212+
*.doc
213+
*.docx
214+
*.xls
215+
*.xlsx
216+
217+
venv/
218+
.venv/
219+
temp/

ReadMe.md

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
# DOCXPress ✨
2+
3+
**Edit your document like filling a form — entirely in your browser, entirely offline.**
4+
5+
DOCXPress is a lightweight, local‑first DOCX editor built with FastAPI and python‑docx. It lets you update DOCX templates quickly while preserving every bit of original formatting — no Office suite required, ever again.
6+
7+
> 🧩 Think of it as a smart form editor for DOCX files: click, edit, save. All formatting stays exactly as designed.
8+
9+
| Editor View | Exported Document |
10+
|-------------|-------------------|
11+
| <img src="assets/editor.png" height="400" alt="DOCXPress Editor Interface"> | <img src="assets/exported.png" height="400" alt="Exported DOCX Preview"> |
12+
13+
*Left: DOCXPress editing interface. Right: Exported document with all edits applied and formatting preserved (template downloaded from [https://word.cloud.microsoft/](https://word.cloud.microsoft/)).*
14+
15+
---
16+
17+
## 🚀 Why DOCXPress?
18+
19+
Tired of opening heavy Word processors just to update a date, change a name, or fill in a template?
20+
DOCXPress is a **focused, local‑first** tool for anyone who:
21+
22+
- 🧑‍💻 **Needs to update DOCX templates** without installing Microsoft Word or LibreOffice
23+
- 🔒 **Values privacy and control** — everything runs locally, your documents never leave your machine
24+
- 🧩 **Prefers simple, constrained interfaces** that prevent accidental formatting changes
25+
-**Wants instant editing** — upload, click, edit, export, done
26+
- 🧠 **Appreciates tools built with clear design principles** and technical transparency
27+
28+
This isn’t a full‑featured Word replacement.
29+
It’s for **template‑based workflows, form filling, and controlled content updates** — all through your browser, with zero installation.
30+
31+
---
32+
33+
## ✨ Features
34+
35+
### 🖥️ Web‑Based & Intuitive
36+
- Edit DOCX files directly in your browser — no desktop office software needed
37+
- Clean, form‑like interface with visual highlighting of editable areas
38+
- Real‑time text editing with click‑to‑edit interaction
39+
- Full table cell editing support
40+
41+
### 🔒 Format‑Safe Editing
42+
- Edit text **without altering original fonts, styles, spacing, or layout**
43+
- Green dashed boxes = editable paragraphs | Green table cells = editable content
44+
- Export back to `.docx` with **all original formatting preserved**
45+
- Export to PDF using Aspose.Words — no Office installation required
46+
47+
### ⚡ Lightweight & Fast
48+
- Entirely local — no cloud uploads, no registration, no external APIs
49+
- Fast startup and instant parsing thanks to python‑docx and FastAPI
50+
- Session‑based editing with manual save control — you decide when to commit changes
51+
52+
### 📤 Flexible Export
53+
- Save edits to a new `.docx` file
54+
- Export directly to `.pdf` (using Aspose.Words evaluation version)
55+
- All processing happens on your machine — your data stays private
56+
57+
---
58+
59+
## 🛠️ How It Works
60+
61+
DOCXPress parses your `.docx` file into structured text and layout data, identifies editable regions (short paragraphs, placeholders, empty table cells), and renders them in a clean web form. Your edits are stored separately and then merged back into the original document — keeping the design completely intact.
62+
63+
Think of it as **“content‑editing decoupled from design‑editing.”**
64+
65+
---
66+
67+
## 📦 Tech Stack
68+
69+
### Backend
70+
- **FastAPI** – Modern, fast web framework for APIs
71+
- **python-docx** – DOCX reading/writing
72+
- **Aspose.Words** – DOCX → PDF conversion (evaluation version, full‑featured)
73+
- **Jinja2** – HTML templating
74+
- **Uvicorn** – ASGI server
75+
76+
### Frontend
77+
- Vanilla JavaScript – lightweight and framework‑free
78+
- CSS3 – clean, responsive styling
79+
- HTML5 – semantic markup
80+
81+
---
82+
83+
## 🚀 Getting Started
84+
85+
### Prerequisites
86+
- Python 3.7+
87+
- pip
88+
89+
### Installation
90+
91+
```bash
92+
# Clone the repository
93+
git clone https://github.com/paradox-solver/DOCXpress.git
94+
cd DOCXpress
95+
96+
# Install dependencies
97+
pip install -r requirements.txt
98+
99+
# Run the application
100+
python main.py
101+
```
102+
103+
Then open your browser to:
104+
👉 **http://localhost:8000**
105+
106+
---
107+
108+
## 🧭 Quick Tour
109+
110+
### 1. **Upload a DOCX Template**
111+
Start from the homepage — drag & drop or select a `.docx` file. *This file is saved to your system `User` repository by default.*
112+
113+
<img src="assets/main.png" width="500" alt="Upload Interface">
114+
115+
### 2. **Edit with Confidence**
116+
Click any blue‑highlighted text or table cell to edit. All changes are kept in your session until you save.
117+
118+
<img src="assets/editor.png" width="500" alt="Editor View">
119+
120+
### 3. **Save & Export**
121+
- **Save Changes** – store edits to your local machine (system `User` repository by default)
122+
- **Export DOCX** – download the edited document as `.docx`
123+
- **Export PDF** – download a PDF version (converted via Aspose.Words)
124+
125+
---
126+
127+
## 🎨 Design Rationale & Philosophy
128+
129+
DOCXPress is built on a clear, deliberate philosophy that emphasizes **constraint, clarity, and preservation**. It’s not trying to be Microsoft Word — instead, it carves out a specific niche where it can excel with reliability, simplicity, and user control.
130+
131+
### 🌟 Core Principles
132+
133+
**🔒 Local‑First & Offline‑Native**
134+
Every part of the workflow happens on your machine. No document data is sent externally, no cloud dependencies, no login required. Your documents stay private, and you can work completely offline.
135+
136+
**📄 Format Preservation as a Non‑Negotiable**
137+
DOCXPress does not redesign, reflow, or reinterpret your document. It extracts editable content, lets you modify it, and reassembles the document with pixel‑faithful formatting. The tool acts as a **custodian of your original design**.
138+
139+
**🎯 Editing as Form‑Filling**
140+
The interface is intentionally minimal — it feels like filling a web form, not a full‑featured word processor. This constraint is a feature: it focuses the user on **content updates only**, systematically preventing accidental formatting changes and reducing cognitive load.
141+
142+
**⚖️ Scope‑Aware Reliability**
143+
The tool is optimized for a specific workflow: **editing existing DOCX templates**. It doesn’t try to support every Word feature. By narrowing its scope, it delivers predictable, high‑quality results without the instability of a general‑purpose editor.
144+
145+
**🔄 Explicit User Control**
146+
You choose when to save, when to export, and what changes to keep. The system doesn’t auto‑save or modify your original file without your consent. This mirrors the “commit” model from version control — changes are intentional, traceable, and reversible.
147+
148+
**🧩 Modular & Transparent Architecture**
149+
Built on focused, well‑understood libraries (python‑docx, FastAPI, Jinja2). Each component has a clear responsibility, and the data flow — from DOCX parsing to HTML rendering to reassembly — is designed to be inspectable and debuggable.
150+
151+
### 🔧 Philosophy in Practice
152+
153+
These principles directly shape the implementation:
154+
155+
- **Structured Extraction** – Documents are parsed into editable elements (paragraphs, table cells) and immutable styling metadata
156+
- **Non‑Destructive Workflow** – Edits are stored separately from the original template, enabling clean merges and session‑based undo/redo
157+
- **Visual Guard Rails** – Green highlights clearly indicate what can be edited; everything else is protected
158+
- **Session‑Based Isolation** – Each editing session is self‑contained, preventing cross‑file contamination and simplifying state management
159+
- **Export‑Time Assembly** – The final DOCX is rebuilt at export time, ensuring the original template is the single source of truth for formatting
160+
161+
### 🧠 The Bigger Picture
162+
163+
DOCXPress is part of a growing ethos of **lightweight, respectful software**. In a world of bloated office suites, subscription lock‑in, and opaque cloud services, it offers a quiet alternative: a tool that does one thing well, respects your data, and stays out of your way.
164+
165+
It’s for anyone who believes that software should be **a lens, not a cage** — and that the best tools are often those that embrace constraints to deliver clarity and reliability. ✨
166+
167+
---
168+
169+
## ⚠️ Notes & Limitations
170+
171+
-**Great for** filling templates, updating forms, editing documents with fixed layouts
172+
- 🔄 **Supports** paragraphs, tables, text formatting preservation, local PDF export
173+
- ⚠️ **Not for** creating documents from scratch or designing complex layouts
174+
- 🧪 **Best results** with standard Word templates and conventional DOCX formatting
175+
- 📄 **PDF export** uses Aspose.Words evaluation version (watermark with this version)
176+
- 💾 **Remember to click “Save Changes”** before close the editor or return
177+
178+
---
179+
180+
## 🐛 Troubleshooting
181+
182+
### Common Issues
183+
184+
1. **PDF Export Fails**
185+
- Ensure `aspose-words` is properly installed
186+
- Check temporary file permissions
187+
- Verify DOCX file format compatibility
188+
189+
2. **Edits Not Saved**
190+
- Click **Save Changes** before exporting
191+
- Check browser console for JavaScript errors
192+
- Verify session is still active (`/debug/sessions`)
193+
194+
3. **File Upload Fails**
195+
- Ensure file format is `.docx`
196+
- Check file size
197+
- Verify file integrity
198+
199+
### Debug Endpoints
200+
- `/debug/sessions` – view active sessions
201+
- `/test-pdf-direct` – test PDF conversion
202+
- `/fix-session` – session recovery page
203+
204+
---
205+
206+
## 🤝 Contributing
207+
208+
Issues and Pull Requests are welcome! Whether you’ve found a bug, have a feature idea, or want to improve the docs — feel free to contribute.
209+
210+
---
211+
212+
## 📄 License
213+
214+
[MIT License](LICENSE) — free to use, modify, and share.
215+
216+
---
217+
218+
## 🙏 Acknowledgments
219+
220+
- [python-docx](https://github.com/python-openxml/python-docx) – excellent DOCX processing library
221+
- [FastAPI](https://fastapi.tiangolo.com/) – efficient and modern web framework
222+
- [Aspose.Words](https://products.aspose.com/words/) – reliable DOCX to PDF conversion
223+
- [Jinja2](https://jinja.palletsprojects.com/) – powerful templating engine
224+
225+
---
226+
227+
**Happy form‑filling — without the Word bloat.** 🎉

assets/editor.png

175 KB
Loading

assets/exported.png

76.2 KB
Loading

assets/main.png

95.5 KB
Loading

0 commit comments

Comments
 (0)