VariedMCForum is the source-of-truth repository for forum development.
It contains four things:
- NodeBB core source and deployable runtime files
- managed plugin source trees that belong in GitHub
- shared local testing helpers for developers
- a Markdown-only mirror of upstream NodeBB docs under
docs/nodebb/
The model is intentionally simple:
- local testing uses this repository plus a production-like MongoDB restore
- production receives code from this repository, not local runtime data
- plugin enabled state is restored by script, not by manual ACP clicking
Keep one clean split in mind:
- data comes from a restored production backup
- code comes from this repository
Local development uses:
- this repository
- local MongoDB from
config.local.json - restored production data when realistic testing is needed
- optional restored
public/uploads/for logos, favicons, and other file-backed assets
GitHub keeps:
- NodeBB core and managed plugin source
- local testing helpers such as
config.local.json,docker-compose.local-mongo.yml, andscripts/local-*.mjs - local testing documentation
- the Markdown mirror in
docs/nodebb/
Production receives:
- NodeBB runtime and core source
- managed plugin source trees
- deploy scripts and workflow-driven code updates
- repository-managed UI assets from plugins such as
variedmc-ui
Production does not receive:
- local MongoDB config
- local helper scripts
docs/backups/public/uploads/- local state snapshots used only for development workflows
- ACP Custom CSS/SASS or Custom JS as a long-term code storage layer
Those boundaries are enforced by .deployignore and scripts/verify-sync-safety.sh.
Put maintainable UI behavior in repository-managed plugins such as variedmc-ui instead of ACP Custom CSS/SASS or Custom JS.
- Node.js 20 or newer
npm- local MongoDB, either through Homebrew or Docker
- a MongoDB backup if you want local behavior to mirror production
- Install dependencies.
npm install-
Restore the production MongoDB backup into local MongoDB when you want realistic local testing.
-
Restore
public/uploads/if you need the same logos, images, or other uploaded assets. -
Start the local forum.
npm run local:dev- Open
http://localhost:4567.
npm run local:dev will:
- ensure local MongoDB is running
- sync plugin dependencies and
plugins:activefrom the shared production extension snapshot - build assets
- start NodeBB in dev mode
- Restore or refresh your local MongoDB data when needed.
- Run
npm run local:prepareif plugin dependencies or plugin enabled state may have drifted. - Run
npm run local:dev. - Modify NodeBB core or managed plugin source in this repository.
- Push to
mainwhen production should receive the code.
If local plugin state drifted but the database contents are already correct, you do not need to restore the full database again. Run npm run plugin-state:apply.
Main local commands:
npm run local:prepare
npm run local:build
npm run local:dev
npm run local:start
npm run local:stop
npm run local:upgradeCommand meaning:
local:prepare: ensure MongoDB is up and sync the shared production plugin statelocal:build: prepare the local runtime, then build assetslocal:dev: prepare, build, and run NodeBB in dev modelocal:start: prepare, build, and run NodeBB in background modelocal:stop: stop the background NodeBB process usingconfig.local.jsonlocal:upgrade: prepare the local runtime, then run NodeBB upgrade
Direct CLI equivalents:
- macOS/Linux:
./nodebb --config config.local.json <command> - Windows:
node .\\nodebb --config config.local.json <command>ornodebb.bat --config config.local.json <command>
The shared extension snapshot lives in state/production-nodebb-extensions.json.
The sync logic lives in scripts/sync-nodebb-extension-state.mjs.
Available commands:
npm run plugin-state:plan
npm run plugin-state:install
npm run plugin-state:apply
npm run plugin-state:syncMeaning:
plugin-state:plan: show local drift against the shared production snapshotplugin-state:install: update declared plugin and theme dependencies to match the snapshotplugin-state:apply: rewriteplugins:activeto match the snapshotplugin-state:sync: run install and apply, then build assets
Use plugin-state:apply when the database is already correct and you only need to restore enabled and disabled plugin state quickly.
Node-based MongoDB helpers:
npm run local:mongo:status
npm run local:mongo:start
npm run local:mongo:stop
npm run local:mongo:ensureRuntime selection:
- on macOS, the helper prefers Homebrew MongoDB when installed
- otherwise it uses Docker when available
You can force a mode:
LOCAL_MONGO_MODE=brew npm run local:mongo:start
LOCAL_MONGO_MODE=docker npm run local:mongo:startRelated files:
The Docker setup intentionally runs MongoDB without auth so it matches config.local.json.
If you already have a MongoDB archive, restore it into local MongoDB with:
mongorestore \
--uri mongodb://127.0.0.1:27017 \
--gzip \
--archive=/absolute/path/to/your-backup.archive.gz \
--dropThen start the forum again:
npm run local:devDatabase restore alone does not restore file-backed assets. If visual state matters, restore public/uploads/ as well.
Only Markdown files from the upstream NodeBB docs repository are kept under docs/nodebb/.
To inspect the current local mirror metadata, see docs/nodebb/LOCAL_COPY.md.
To refresh that mirror:
./scripts/update-nodebb-docs.shdocs/LOCAL_TESTING.md: detailed local testing guidescripts/local-nodebb.mjs: local bootstrap wrapperscripts/local-mongo.mjs: local MongoDB managerscripts/sync-nodebb-extension-state.mjs: plugin dependency and enabled-state syncscripts/deploy-prod.sh: production deploy entrypoint
public/uploads/is ignored by Git and excluded from production sync.backups/is ignored by Git and excluded from production sync.- Shared local runtime files stay in GitHub for developers, but
.deployignorekeeps them out of production. - If
nodebb-plugin-web-pushis enabled, startup onhttp://localhost:4567may log a VAPID subject warning. That does not block normal local testing.
Last reviewed: 2026-04-24