Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# server — Euro-Office

@../AGENTS.md

Guidance for Claude Code (and other AI agents) working in **server** — the Node.js backend.

## What this repo is
The stateful backend services for Euro-Office Document Server. Forked from `ONLYOFFICE/server`. Licensed **AGPL-3.0**.

## Architecture & Workflow
- **Async patterns:** Uses `function*` + `co` for async flows. **Do not** refactor to `async/await` unless the entire call chain is updated. Mixing patterns causes race conditions in co-editing state.
- **Storage:** All I/O must pass through the storage abstraction in `Common/sources/storage/` (`storage-base.js` + per-backend drivers `storage-fs.js` / `storage-s3.js` / `storage-az.js`). Never write directly to disk.
- **Persistence:** Database schema lives in `schema/<db>/` (one set per backend: `postgresql`, `mysql`, `mssql`, `oracle`, `dameng`), with `createdb.sql` and an `upgrade/` folder. A schema change must be applied across all backends, never mutated ad-hoc.
- **Packaging:** Uses `pkg`. Adding native modules (`.node`) requires updating `pkg` config.

## Rules
- **Never** modify `SpellChecker/` without installing its dependencies separately — it has its own `package.json` with a native C++ dependency (`nodehun`, built via node-gyp) and is excluded from the main ESLint config. Treat it as an isolated sub-service.
- **Never** commit `.node` binaries or `pkg` artifacts.
- **Never** bypass the storage abstraction in `Common/sources/storage/`.
- **Never** change the co-editing logic in `DocService/sources/` (e.g. `DocsCoServer.js`) without running the full unit test suite (`npm run "unit tests"`).
- **Always** run `npm run code:check` before PR.

## Findings & Long-tail
Comment thread
Alex-Arsys marked this conversation as resolved.
No centralized findings store exists in this repository yet. Edge-case debugging recipes and co-editing race conditions should be documented in code comments or tracked as GitHub issues until a findings store is established.
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
Loading