- Add ia_dev submodule (projects/smart_ide on forge 4nk) - Document APIs, orchestrator, gateway, local-office, rollout - Add systemd/scripts layout; relocate setup scripts - Remove obsolete nginx/enso-only docs from this repo scope
1.9 KiB
Local Office
Intégration monorepo : ce code provient de l’ancien dépôt git.4nkweb.com/4nk/local_office, fusionné dans smart_ide sous services/local-office/ (service HTTP au même titre que les autres dossiers de services/). Le dépôt distant peut être supprimé ; l’historique Git d’origine n’est pas conservé dans ce chemin (copie de fichiers).
Documentation projet : docs/features/local-office.md · docs/services.md.
API for third-party applications to upload and edit Office documents (docx, xlsx, pptx) on this machine.
Architecture
See docs/architecture-proposal.md.
Run on this machine
-
Create a virtualenv and install dependencies:
python3 -m venv .venv source .venv/bin/activate # or .venv\Scripts\activate on Windows pip install -r requirements.txt -
Set environment variables (no secrets in repo). Copy
.env.exampleto.envand set at leastAPI_KEYS. For a quick local run you can useexport API_KEYS=dev-key. -
Run the API:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000 -
Open http://localhost:8000/docs for Swagger UI.
API (summary)
- POST /documents — Upload file (multipart). Header:
X-API-Key. Request must send correctContent-Typefor the part (e.g. docx:application/vnd.openxmlformats-officedocument.wordprocessingml.document). Returnsdocument_id. - GET /documents — List documents for the API key.
- GET /documents/{id} — Metadata.
- GET /documents/{id}/file — Download file.
- POST /documents/{id}/commands — Apply commands (docx:
replaceText,insertParagraph). Body:{"commands": [{"type": "replaceText", "search": "foo", "replace": "bar"}]}. - DELETE /documents/{id} — Delete document and file.
All routes require header X-API-Key and are rate-limited per key.