First off, thank you for considering contributing to this project! 🎉
Whether it's a bug report, new feature, correction, or additional documentation, your contributions are greatly appreciated.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Code Style
- Testing
- Submitting a Pull Request
- Issue Reporting
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/ecommerce-store-api.git cd ecommerce-store-api - Add the upstream repository as a remote:
git remote add upstream https://github.com/raouf-b-dev/ecommerce-store-api.git
- Node.js ≥ 22
- npm ≥ 11
- Docker Desktop ≥ 28
- Git ≥ 2.49
# Install dependencies
npm install
# Generate environment files
npm run env:init:dev
# Start infrastructure services (PostgreSQL, Redis)
npm run d:up:dev
# Run database migrations
npm run migration:run:dev
# Start development server
npm run start:devThe API will be available at http://localhost:3000 with Swagger docs at http://localhost:3000/api.
-
Create a new branch from
develop:git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix -
Make your changes following our code style guidelines
-
Write or update tests for your changes
-
Run the test suite to ensure everything passes:
npm test -
Commit your changes with a clear message:
git commit -m "Add: brief description of your change"
We follow a simple commit convention:
Add:for new featuresFix:for bug fixesUpdate:for changes to existing featuresRefactor:for code refactoringDocs:for documentation changesTest:for test-related changes
This project uses ESLint and Prettier to maintain code quality. Before committing:
# Run linter with auto-fix
npm run lint
# Check formatting
npm run format:check
# Fix formatting
npm run formatThis project follows Domain-Driven Design (DDD) and Hexagonal Architecture (Ports & Adapters). Please ensure:
- Core (
core/domain/): Pure business logic — entities, value objects, repository interfaces. Zero external dependencies. - Core (
core/application/): Use cases that orchestrate domain logic. Depends only on Domain. - Primary Adapters (
primary-adapters/): Driving adapters — DTOs, job handlers, event listeners. NestJS Controllers live at the module root and inject Use Cases directly (no intermediate controller classes). - Secondary Adapters (
secondary-adapters/): Driven adapters — repository implementations, ORM entities, mappers, external service integrations. - Shared Kernel (
src/shared-kernel/): Cross-cutting infrastructure (database, Redis, jobs, error types, interceptors).
We maintain high test coverage. Please include tests for any new functionality:
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Check coverage
npm run test:cov- Unit tests should be co-located with the code they test (e.g.,
usecase.spec.tsnext tousecase.ts) - Use the
testing/folder within each module for test utilities and factories
-
Update your fork with the latest upstream changes:
git fetch upstream git rebase upstream/master
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub with:
- A clear title describing the change
- A description of what changed and why
- Reference any related issues (e.g., "Fixes #123")
-
Wait for review - maintainers will review your PR and may request changes
- Code follows the project's style guidelines
- Tests pass locally (
npm test) - New functionality includes appropriate tests
- Documentation is updated if needed
- Commit messages are clear and descriptive
When reporting bugs, please include:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected vs actual behavior
- Your environment (Node.js version, OS, etc.)
- Any relevant logs or screenshots
For feature requests, please describe:
- The problem you're trying to solve
- Your proposed solution
- Any alternative solutions you've considered
Feel free to open an issue for any questions or discussions. We're happy to help!
Thank you for contributing! 🙏