Appearance
For developers
This page collects the project details that are useful for contributors and maintainers, so the public README.md can stay focused on quick start.
Repository model
main— releases onlydev— integration branch for changes that are not yet live-tested- Topic branches are cut from a release and merged back into
dev, not directly intomain
GitLab is the canonical repository for development, issues, merge requests, and releases. GitHub is a read-only mirror.
Local development
The project runs in Docker. node, npm, and npx are expected to run inside the container.
Main commands:
sh
docker compose up -d --build
docker compose exec app bashInside the container:
sh
npm run dev
npm start
npm test
npm run lint
npm run build-cssMain project structure
src/lib/calculator.js— grid buildersrc/lib/job.js— state machine for one pair cyclesrc/lib/rebalanceClose.js— recomputes the close from real fillssrc/modules/jsonTimerSender.js— main bot loopsrc/lib/websocketRouter.js— browser websocket serversrc/lib/invokeAPI.js— Binance REST wrappersrc/lib/UserStreamApi.js— Binance user data streamsrc/data/*.json— persisted pair state
Environment notes
BINANCE_MODE=test|realselects the Binance environmentSTATUS_APPunset means the bot logic is effectively a no-opSTATUS_LOGIN=falsedisables authentication- real mode without real keys falls back to testnet
Production notes
Production uses compose.prod.yml and pm2-runtime through docker-config/entrypoint.sh. The production image bakes in the runtime code and mounts only persistent state.
Validation
Run inside the container when available:
sh
npm test
npm run lintDocs build from the repository root:
sh
npm --prefix docs ci
npm --prefix docs run buildFormatting
Formatting is handled by the configured linters, not Prettier:
- JavaScript: ESLint +
@stylistic/eslint-plugin - SCSS/CSS: Stylelint +
@stylistic/stylelint-plugin - EJS:
js-beautify
Release notes
Keep public release documentation and tags in the established project format. Development happens on GitLab; publish the GitHub mirror only after the GitLab side is ready.
Release commands
For this project, bump the version in src/package.json without creating a git tag automatically:
sh
docker compose exec app sh -lc "cd /var/www/src && npm version 2.0.2 --no-git-tag-version"Then create and push the release tag from the host:
sh
git tag -a v2.0.2 -m "Release v2.0.2 — test"
git push origin v2.0.2