This guide covers the local setup, architecture, testing workflow, and pull request expectations for Stellar-Batch-Pay.
- Node.js 20 or newer
- npm 10 or newer
- Bun 1.2.4
- Rust toolchain with
wasm32-unknown-unknown - Soroban CLI
- Clone your fork and add the upstream remote if needed:
git clone https://github.com/<your-user>/Stellar-Batch-Pay.git
cd Stellar-Batch-Pay
git remote add upstream https://github.com/jahrulezfrancis/Stellar-Batch-Pay.git- Install JavaScript dependencies:
npm install- Install the Soroban target for contract builds:
rustup target add wasm32-unknown-unknown- Install Soroban CLI if it is not already available:
cargo install --locked soroban-cliRun the web app locally:
npm run devThe Next.js application will be available at http://localhost:3000.
The repository is organized into three main areas:
app/: Next.js App Router pages and API routescomponents/: reusable client-side UI componentslib/stellar/: parsing, validation, batching, and transaction-building logiccontracts/batch-vesting/: Soroban smart contract for time-locked batch vestingtests/: Vitest unit tests for the JavaScript and TypeScript payment logic
lib/stellar/parser.ts: converts JSON and CSV files into payment rowslib/stellar/validator.ts: validates Stellar addresses, assets, and batch settingslib/stellar/batcher.ts: groups valid payment instructions into transaction-safe batchesapp/api/batch-build/route.ts: builds unsigned batch transactions for wallet signing
Run the main checks locally before opening a pull request:
npm test
npm run typecheckRun the production build:
npm run buildRun the Soroban contract tests from the contracts/ workspace:
cargo test --manifest-path contracts/Cargo.tomlBuild the Soroban contract artifacts:
cargo build --manifest-path contracts/Cargo.toml --target wasm32-unknown-unknownBefore opening a pull request, make sure the relevant local checks complete successfully.
The primary CI workflow now runs both Vitest and TypeScript typechecking, so npm test and npm run typecheck should both pass locally before you push.
- Create a focused branch from the latest
main - Keep each pull request scoped to a small set of related changes
- Add or update tests for behavior changes
- Update docs when the user-facing flow or developer workflow changes
- Include the linked issue numbers in the PR description
- Confirm the web app build and the relevant test suite pass locally before pushing
- Use clear commit messages describing the behavior change
- Avoid mixing refactors with unrelated fixes
- Do not force-push over someone else’s branch without coordination
A scheduled .github/workflows/security-audit.yml job runs npm audit and
cargo audit weekly on main and on every PR.
When an audit failure or security advisory lands:
- Read the advisory linked in the job summary and confirm the affected package is actually reachable from runtime code (vs. a transitive dev-only dep). High/critical runtime advisories are blockers.
- Bump the offending package or pin a patched version in
package.jsonorcontracts/Cargo.toml, then update the lockfile. - Run
bun installthennpm testandbun run buildlocally. For Cargo bumps, also runcargo test --manifest-path contracts/Cargo.tomlto catch soroban-sdk breakage. - Review dependency bumps for
stellar,next,better-sqlite3, andreactindividually before merging. - If the scheduled audit fails on
main, the workflow opens an issue with thesecurity-auditlabel. Triage using the steps above, then close the issue.
When opening an issue or PR, include:
- expected behavior
- actual behavior
- reproduction steps
- logs, screenshots, or failing test output when available
To ensure a consistent user experience, we have standardized on Sonner for all toast notifications. Please use the wrapper provided in lib/toast.ts instead of importing sonner or @/components/ui/use-toast directly. An ESLint rule is in place to enforce this.