We love your input! We want to make contributing to BCTS API as easy and transparent as possible, whether it's:
- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
We follow the standard NestJS project conventions and best practices:
- We use ESLint with the default NestJS configuration
- The project extends
@nestjs/eslint-configandprettier - Run
npm run lintto check your code style - Run
npm run formatto automatically format your code
// .eslintrc.js example
{
"parser": "@typescript-eslint/parser",
"extends": ["plugin:@typescript-eslint/recommended"],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
}
}We maintain high test coverage using the following practices:
- Unit Tests: Use Jest (NestJS default testing framework)
- E2E Tests: Use SuperTest with Jest
- Test files should be placed next to the code they test with the
.spec.tssuffix - Run tests using:
npm run test- unit testsnpm run test:e2e- end-to-end testsnpm run test:cov- test coverage
We follow the Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, missing semi-colons, etc)refactor: Code refactoringtest: Adding missing testschore: Changes to the build process or auxiliary tools
Example:
feat(auth): implement JWT authentication
- Feature branches:
feature/description - Bug fixes:
fix/description - Documentation:
docs/description
- Update the README.md with details of changes if needed
- Update the CHANGELOG.md following the conventional commits format
- Ensure all tests pass and new code has adequate test coverage
- The PR must be approved by at least one maintainer
- Install dependencies:
npm install- Copy the example environment file:
cp .env.example .env- Run the development server:
npm run start:dev- Follow NestJS modular architecture
- Keep modules focused and single-responsibility
- Use dependency injection and avoid tight coupling
- Follow SOLID principles
- Document public APIs using Swagger decorators
Feel free to open an issue or submit a pull request if you have any questions or suggestions for improving these guidelines.