Welcome to the Etherpad project. This guide provides essential context and instructions for AI agents and developers to effectively contribute to the codebase.
Etherpad is a real-time collaborative editor designed to be lightweight, scalable, and highly extensible via plugins.
- Runtime: Node.js
- Package Manager: pnpm
- Languages: TypeScript (primary), JavaScript, CSS, HTML
- Backend: Express.js, Socket.io
- Frontend: Legacy core (
src/static), New UI (ui/), Admin UI (admin/) - Build Tools: Vite (for
uiandadmin), custom scripts inbin/ - Testing: Mocha (Backend), Vitest, Playwright, custom backend test suite
src/node/: Backend logic, API, and database abstraction.src/static/: Core frontend logic (Legacy).ui/: Modern React-based user interface.admin/: Modern React-based administration interface.bin/: Utility and lifecycle scripts.doc/: Documentation in Markdown and Adoc formats.src/tests/: Test suites (backend, frontend, UI, admin).var/: Runtime data (logs, dirtyDB, etc. - ignored by git).local_plugins/: Directory for developing and testing plugins locally.
- Indentation: 2 spaces for all files (JS/TS/CSS/HTML).
- No Tabs: Use spaces only.
- Comments: Provide clear comments for complex logic.
- Backward Compatibility: Always ensure compatibility with older versions of the database and configuration files.
- Branching: Work in feature branches. Issue PRs against the
developbranch. - Commits: Maintain a linear history (no merge commits). Use meaningful messages in the format:
submodule: description. - Feature Flags: New features should be placed behind feature flags and disabled by default.
- Deprecation: Never remove features abruptly; deprecate them first with a
WARNlog.
- Requirement: Every bug fix MUST include a regression test in the same commit.
- Backend Tests: Run
pnpm --filter ep_etherpad-lite run testfrom the root. - Frontend Tests: Accessible at
/tests/frontendon a running instance. - Linting: Run
pnpm run lintto ensure style compliance. - Build: Run
pnpm run build:etherpadbefore production deployment.
The real-time synchronization engine. It is complex; refer to doc/public/easysync/ before modifying core synchronization logic.
Most functionality should be implemented as plugins (ep_...). Avoid modifying the core unless absolutely necessary.
Configured via settings.json. A template is available at settings.json.template. Environment variables can override any setting using "${ENV_VAR}" or "${ENV_VAR:default_value}".
AI/Agent contributions are explicitly welcomed by the maintainers, provided they strictly adhere to the guidelines in CONTRIBUTING.md and this guide. Always prioritize stability, readability, and compatibility.