First off, thank you for considering contributing to MarketX! It's people like you that make MarketX such a great tool.
This guide will help you get started with your first contribution. Please read it thoroughly to understand our development workflow and standards.
Ensure you have the following installed:
- Node.js (v18+)
- npm (v9+)
- Docker & Docker Compose
Before you start debugging setup issues, run our diagnostics tool to ensure your environment is correctly configured:
npm run doctorOr if you prefer using make:
make doctorThis tool checks for required versions, .env configuration, and connectivity to services (Postgres, Redis, RabbitMQ).
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/MarketX-backend.git cd MarketX-backend - Add the upstream repository as a remote:
git remote add upstream https://github.com/Cybermaxi7/MarketX-backend.git
- Install dependencies:
npm install
- Set up your environment variables:
Edit
cp .env.example .env
.envand fill in the necessary credentials.
We use Docker Compose to spin up the required services (PostgreSQL, Redis, RabbitMQ).
docker compose --profile local-dev up -dFor more details, see docs/local-infra.md.
- Always create a new branch for your work:
feature/your-feature-namefor new features.bugfix/your-fix-namefor bug fixes.refactor/your-refactor-namefor code improvements.docs/your-doc-updatefor documentation changes.
We use ESLint and Prettier to maintain code quality and consistency.
- Linting:
npm run lint(validation only) - Auto-fixing lint issues:
npm run lint:fix - Formatting:
npm run format - Typechecking:
npm run typecheck
- Makefile: We provide a
Makefilewith common commands. Runmake helpto see all available targets. - Git Hooks: You can set up a pre-commit hook that runs linting and typechecking by running:
./scripts/setup_hooks.sh
Please ensure your code passes linting and typechecking before submitting a PR.
We follow the Conventional Commits specification.
We value high test coverage. Ensure you add tests for any new features or bug fixes.
- Run all tests:
npm run test - Run pre-PR confidence suite:
npm run pr:check - Check coverage:
npm run test:cov
- API Docs: Update Swagger metadata and run
npm run docs:generate. - ADRs: Add or update an ADR in
docs/adr/for significant architectural changes.
- Rebase: Ensure your branch is up to date with
upstream/develop. - Confidence Check: Run
npm run pr:checkandnpm run doctor. - Push: Push your branch to your fork.
- Open PR: Open a Pull Request against the
developbranch of the upstream repository.
Thank you for your contribution! 🚀