signoz-docs-editor
v0.2.10
Published
## Warning
Readme
SigNoz Doc Editor
Warning
This project is 100% vibecoded.
I do not have real frontend app experience, and this was built over one weekend to unblock docs editing work. It is useful, tested, and locally buildable, but it should be treated like a pragmatic internal tool rather than a polished product.
Why
Editing SigNoz docs directly in the signoz.io repo is slow for quick iteration when you want:
- a local file tree
- a source-first MDX editor
- a live preview
- local loading of shared SigNoz components
- compatibility fixes without touching the external
signoz.iocheckout
This repo exists to make that loop faster.
What
This is a Vite + React + TypeScript app with a small local Express server.
It provides:
- a source editor for MDX docs
- a live preview pane
- a local docs file tree
- session restore for open tabs and workspace state
- local resolution of shared SigNoz components and markdown imports
- local serving of
signoz.io/publicassets for preview rendering
The editor is designed to work alongside a sibling signoz.io checkout and keeps compatibility fixes inside this repo.
How it works
The app has two parts:
- frontend: React app served by Vite
- backend: local Express server that reads docs, resolves imports, and serves assets
By default it expects to be run from the signoz.io repo directory.
The backend reads docs from ./data/docs unless you override it with environment variables.
Environment variables
The backend process reads these variables:
SIGNOZ_DIR(optional)- default: current working directory (
process.cwd()) - typically points to your local
signoz.iocheckout
- default: current working directory (
DOCS_PATH(optional)- default:
data/docs - path under
SIGNOZ_DIRwhere docs are read from
- default:
PORT(optional)- default:
3001 - port used by the local Express API server
- default:
VITE_API_BASE(optional)- default:
/api - frontend API base for the React app and MDX compiler
- default:
VITE_API_BASE is useful when you run behind a different host/port setup.
Run by prefixing variables directly:
SIGNOZ_DIR=/abs/path/to/signoz DOCS_PATH=data/docs PORT=4001 npm run serverRequirements
- Node.js
20via.nvmrc - run from the
signoz.iocheckout wheredata/docsexists
Use from npm (main flow)
You can install and run without cloning this repo from within your signoz.io checkout:
cd /path/to/signoz.io
signoz-docs-editorIf you prefer a global install:
npm i -g signoz-docs-editor@latest
signoz-docs-editorOr run directly with npx (this is the recommended no-sync flow):
npx signoz-docs-editor@latestIf you see EBADENGINE warnings, upgrade to Node.js 20+.
This defaults SIGNOZ_DIR to the directory you launch from, so from any machine with signoz.io checked out you can run:
cd /path/to/signoz.io
npx signoz-docs-editor@latestIf you run the binary from outside signoz.io, pass the checkout path explicitly:
SIGNOZ_DIR=/path/to/signoz.io signoz-docs-editorLocal development flow (for contributors)
If you want to modify this package locally:
git clone <repo-url>
cd signoz-doc-editor
nvm use
npm installFrom the project root, run both frontend and backend with your local signoz.io path:
SIGNOZ_DIR=/path/to/signoz.io npm run start:devFrontend only:
npm run devBackend only:
npm run serverOr set SIGNOZ_DIR explicitly for any command:
SIGNOZ_DIR=/path/to/signoz.io npm run dev
SIGNOZ_DIR=/path/to/signoz.io npm run serverValidate
Run tests:
npm test -- --runBuild:
npm run buildKey files
src/components/Editor.tsx: main editor shellsrc/components/PreviewPane.tsx: preview renderingsrc/components/CodePane.tsx: CodeMirror editor wrappersrc/mdx-compiler.ts: browser-side MDX compile pathserver.js: local file/import/assets APIvite.config.ts: local compatibility and dev server configHANDOFF.md: implementation status and validation history
Known limits
- this is an internal tool, not a general-purpose CMS
- some compatibility behavior exists specifically for local
signoz.iointegration - build output still has large chunk warnings
- preview correctness depends on the local
signoz.iostructure staying broadly compatible - if the UI loads as blank, open DevTools Network/Console and verify requests to
/api/config,/api/tree, and/api/componentsare not failing
Philosophy
The source is authoritative.
The preview should stay renderable.
Compatibility fixes for signoz.io should happen here, not by editing the external repo.
