Thank you for your interest in contributing to Deen Bridge! We welcome contributions from the community to help make Islamic education more accessible.
- Find or open an issue describing the change.
- Create a focused branch from
mainand implement the change. - Run the relevant checks described below.
- Open a pull request against
main, link the issue, and summarize the changes and checks.
Everyone is welcome to contribute to the platform's engineering work.
- Node.js 18+
- MongoDB (local or Atlas)
- npm or yarn
- Git
# Fork the repository
# Clone your fork
git clone git@github.com:YOUR_USERNAME/dnb-backend.git
cd dnb-backend
# Add upstream remote
git remote add upstream git@github.com:Deen-Bridge/dnb-backend.git
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your values
# Start development server
npm run dev| Branch | Purpose |
|---|---|
main |
Active integration and production branch — pull requests target here |
dev |
Legacy development branch; target only when a maintainer directs |
Changes merged to main may be deployed to production. Keep pull requests focused and ensure their required checks pass.
Always open PRs against
main, notdev. The auto-merge workflow only runs for PRs targetingmain, and recent merged PRs all targetmain. CI workflows also run ondev, but a PR opened againstdevwill not be auto-merged.
Use a short, descriptive prefix: feature/<name>, fix/<name> (or fix/issue-<number>), docs/<name>, chore/<name>, refactor/<name>, test/<name>.
-
Create a branch from the latest
main:git fetch upstream git checkout -b feature/your-feature-name upstream/main
-
Make your changes following our coding standards
-
Test your changes:
npm test -
Commit with a descriptive message:
git commit -m "feat: add transaction retry logic" -
Push and create a PR with
mainas the base branch:git push origin feature/your-feature-name
- The backend is JavaScript using native ES modules (
"type": "module"inpackage.json): useimport/export, and include the.jsextension in relative imports. Write new code in JavaScript. A number of existing.tsfiles live undersrc/, but the repo has notsconfig.jsonor TypeScript build step, so do not rely on TypeScript tooling. - Use ES6+ features
- Use async/await for asynchronous code
- Follow existing file structure
- Use descriptive variable and function names
- Handle errors properly with try/catch
- Validate request input with
express-validator. Put reusable rule sets insrc/validators/and run them through thesrc/middlewares/validate.jsmiddleware, following the existing validators there. - Do not introduce a different validation library without discussing it in an issue first.
- Follow RESTful conventions
- Use appropriate HTTP status codes
- Return consistent response formats
- Document new endpoints
- Use Mongoose schemas for all models
- Add proper indexes for queries
- Validate input data
- Use transactions where appropriate
We follow Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
When a PR conflicts with main, rebase your branch onto the latest upstream/main (git fetch upstream && git rebase upstream/main) and force-push with --force-with-lease. Do not merge main into your branch. Auto-merge skips PRs that have conflicts.
Before opening a PR, run:
npm testCI (.github/workflows/ci.yml) runs npm ci, npm test, a node --check syntax pass over every .js file, and a boot-and-/health smoke test. Changes under contracts/ must also pass the Contracts CI (cargo fmt --check, cargo clippy, cargo test). There is currently no ESLint, Prettier, or coverage-threshold script, so none is required; match the style of the surrounding code. A mutation-testing workflow (Stryker) also runs on PRs.
- Base Branch: open the PR against
main - Title: Use conventional commit format
- Description: Explain what and why
- Link Issue: Include a closing reference such as
Closes #123; the issue is closed as completed after merge - Testing: Describe how you tested
- API Changes: Document any endpoint changes
- Auto-merge gates: eligible, non-draft PRs are squash-merged when CI and all reported statuses pass, the branch has no conflicts, review requests and threads are resolved, and no
hold,do-not-merge, ormanual-reviewlabel is present. Contract changes must also pass Contracts CI.
Maintainers apply labels; mention the one you think fits in your PR or issue.
- Type:
bug,chore,refactor,testing,ci,documentation,security,performance,database - Complexity: the issue's complexity label (for example low, medium, or high) indicates the size of the task; check the issue before picking it up.
- Blocking:
hold,do-not-merge, andmanual-reviewstop auto-merge.
Include:
- Clear description of the bug
- Steps to reproduce
- Expected vs actual behavior
- API endpoint affected
- Request/response samples
- Environment info
Include:
- Clear description of the feature
- Use case and motivation
- Proposed API design (if applicable)
- Database schema changes (if applicable)
- Never commit secrets or credentials
- Use environment variables for configuration
- Validate and sanitize all input
- Follow OWASP guidelines
- Report security issues privately
When working on Stellar-related features:
- Test on testnet first
- Never log private keys or seeds
- Verify transactions on-chain
- Handle network errors gracefully
- Follow Stellar best practices
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Contributors of all backgrounds and faiths are welcome
- Open a GitHub Discussion
- Check existing issues and PRs
- Review the documentation
By contributing, you agree that your contributions will be licensed under the MIT License.