Thank you for contributing to SynapsVault/deploy! This repository contains
the deployment scripts, Dockerfiles, Kubernetes Kustomize manifests, monitoring
configurations, and operational runbooks for the SynapsVault platform.
- Prerequisites & Setup
- Running Tests & Quality Checks
- Repository Conventions
- Submitting a Pull Request
- Reporting Issues
- Security Vulnerabilities
| Tool | Version | Purpose |
|---|---|---|
| Node.js | >= 22.12.0 |
Run and test scripts (@stellar/stellar-sdk v17+ requirement) |
| npm | bundled with Node | Dependency management |
| Bash | any | Shell scripts in scripts/*.sh |
| ShellCheck | any | Lint shell scripts |
Install Node.js via nvm (version is read from .nvmrc):
nvm use
node --version # should print v22.x.x or newer
npm ci| Tool | Purpose |
|---|---|
| Docker & Docker Compose | Validate and smoke-test docker-compose.yml |
| kubectl | Validate Kubernetes manifests (k8s/) |
| kubeconform | Schema-validate rendered manifests |
| kube-linter | Policy-lint rendered manifests |
| promtool / amtool | Validate monitoring/ config |
Clone the sibling application repos, then start the full stack from this repo's root — Compose builds images from those checkouts:
git clone https://github.com/SynapsVault/backend ../backend
git clone https://github.com/SynapsVault/frontend ../frontend
cp .env.example .env
# Optional: edit .env to set real secrets if you need live Stellar/Supabase
node scripts/check-env.js --target compose # flag missing/placeholder values
docker compose up --buildService URLs (configurable via .env):
| Service | URL |
|---|---|
| Frontend | http://localhost:8080 |
| Backend | http://localhost:3000 |
| Postgres | localhost:5432 |
| Prometheus | http://localhost:9090 |
| Grafana | http://localhost:3001 |
All pull requests are verified by .github/workflows/ci.yml. Run the same
checks locally before opening a PR.
Before starting the stack or running integration tests, verify that no
placeholder values remain in your .env:
node scripts/check-env.js --target compose # local compose stack
node scripts/check-env.js --target k8s # Kubernetes deploynpm testRuns the Node.js built-in test runner against test/**/*.test.cjs.
# ESLint
npm run lint
# Prettier (check only)
npm run format:check
# Prettier (auto-fix)
npm run formatshellcheck scripts/*.sh
for f in scripts/*.sh; do bash -n "$f"; donekubectl kustomize k8s/ > rendered.yaml
kubeconform -strict -summary rendered.yaml
kube-linter lint rendered.yamlpromtool check rules monitoring/alert-rules.yml
promtool test rules monitoring/tests/*.yml
amtool check-config monitoring/alertmanager.yml
python3 -m json.tool monitoring/grafana-dashboard.json > /dev/nullnpm ci
npm test
npm run lint
npm run format:check
node scripts/check-env.js --target compose
shellcheck scripts/*.sh
kubectl kustomize k8s/ > /dev/null
cp .env.example .env && docker compose config --quiet- Module format: The package uses ES Modules (
"type": "module"). Step scripts (01–06) and utilities (.js) use ESM. The standalone contract CLI tools (deploy-contracts.cjs,rollback-contracts.cjs) use CommonJS (.cjs) so their helpers can berequire()-d bytest/*.test.cjs. - Exit codes: Scripts must exit non-zero (
process.exit(1)) whenever required environment variables are missing, validation fails, or an RPC step fails. Never swallow errors silently. - No hard-coded secrets or mainnet defaults: Default to
testnet; require explicit--yesbefore executing destructive or mainnet operations. - Offline unit tests: Export CLI argument parsers, environment validators,
and file helpers so they can be unit-tested in
test/without live network calls.
- Start with
#!/usr/bin/env bashandset -Eeuo pipefail. - Quote all variable expansions:
"${VAR}". - Keep scripts clean under
shellcheck. - Document supported flags, environment variables, and exit codes in the header
comment block so
--helpstays accurate.
- No real secrets in version control.
k8s/secrets.yamlis a placeholder template and must not be added tok8s/kustomization.yaml. - All workloads must run as non-root with
allowPrivilegeEscalation: falseand explicit resource requests/limits. - Use Kustomize overlays (
k8s/overlays/staging,k8s/overlays/production) to separate environment-specific values from the base.
- Each doc must have a clear purpose and cross-link to related docs rather than duplicating content.
- Railway deployment is documented once in
docs/railway-deploy.md; all other mentions link there. - Update
docs/ENVIRONMENT-VARIABLES.mdwhenever a variable is added or renamed — that is the single source of truth.
Use Conventional Commits:
feat(k8s): add HorizontalPodAutoscaler for backend
fix(scripts): handle missing DEPLOYER_SECRET gracefully
docs: update Railway guide with Supabase pooler URL
test(contract): cover rollback with unknown contract ID
chore(deps): update @stellar/stellar-sdk to 17.3.0
Reference resolved issues in the commit body: Closes #42.
- Fork the repository and create a branch from
main:git checkout -b feat/your-feature-name
- Make your changes, following the conventions above.
- Run the full pre-push checklist (see §2).
- Open a PR against
main. Fill in the PR template — link the issue, describe what changed and how you tested it. - At least one member of
@SynapsVault/coremust approve before merging. - Merge by squash-and-merge so every commit on
maincorresponds to one PR and references one issue.
Keep PRs focused. A PR that touches k8s/, scripts/, and docs/ for the
same feature is fine; a PR that mixes unrelated changes is not. If you are
fixing a bug you found while working on a feature, open a separate PR for the
fix.
Use the GitHub issue templates:
- Bug report — for failures in scripts, manifests, Dockerfiles, CI workflows, or runbooks.
- Feature / Enhancement — for improvements to deployment automation, observability, or documentation.
Redact any secrets, keys, or connection strings before pasting logs.
Do not report security vulnerabilities through public issues.
See SECURITY.md for the responsible disclosure process.