Nicolas Cantu 088eab84b7 Platform docs, services, ia_dev submodule, smart_ide project config
- 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
2026-04-03 16:07:58 +02:00

43 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Local Office
**Intégration monorepo** : ce code provient de lancien 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é ; lhistorique Git dorigine nest pas conservé dans ce chemin (copie de fichiers).
Documentation projet : [docs/features/local-office.md](../docs/features/local-office.md) · [docs/services.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](docs/architecture-proposal.md).
## Run on this machine
1. Create a virtualenv and install dependencies:
```bash
python3 -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -r requirements.txt
```
2. Set environment variables (no secrets in repo). Copy `.env.example` to `.env` and set at least `API_KEYS`. For a quick local run you can use `export API_KEYS=dev-key`.
3. Run the API:
```bash
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
```
4. Open http://localhost:8000/docs for Swagger UI.
## API (summary)
- **POST /documents** — Upload file (multipart). Header: `X-API-Key`. Request must send correct `Content-Type` for the part (e.g. docx: `application/vnd.openxmlformats-officedocument.wordprocessingml.document`). Returns `document_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.