Thank you for your interest in contributing! This document provides guidelines and instructions for contributing.
Please read and follow our Code of Conduct.
Before creating a bug report, please check the issue list to avoid duplicates.
Create a bug report including:
- Clear, descriptive title
- Detailed description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Screenshots if applicable
- Your environment (OS, PHP version, PostgreSQL version)
Submit enhancement suggestions as GitHub issues with:
- Clear, descriptive title
- Detailed description of the enhancement
- Use case and benefits
- Possible implementation approach (optional)
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes following the code style guide
- Add or update tests
- Run tests:
php spark test - Commit with clear messages:
git commit -m 'Add feature X' - Push to your fork:
git push origin feature/your-feature - Open a Pull Request with a clear description
- Clone your fork:
git clone https://github.com/yourusername/helpdesk-api.git
cd helpdesk-api- Install dependencies:
composer install- Configure environment:
cp .env.example .env
# Edit .env with your database credentials- Create database:
php spark migrate
php spark db:seed DatabaseSeeder- Run tests:
php spark test- Follow PSR-12 coding standards
- Use meaningful variable and function names
- Add comments for complex logic
- No emojis or symbols in code/comments (keep professional)
- Type hint all function parameters and return types
public function updateTicket(int $id, array $data): array
{
$ticket = $this->model->find($id);
if (!$ticket) {
return ['success' => false, 'message' => 'Ticket not found'];
}
if (!$this->model->validate($data)) {
return ['success' => false, 'errors' => $this->model->errors()];
}
$this->model->update($id, $data);
return ['success' => true, 'data' => $this->model->find($id)];
}- Write tests for new features
- Update tests when modifying existing code
- Maintain test coverage above 80%
- Run full test suite before submitting PR
# Run all tests
php spark test
# Run specific test file
vendor/bin/phpunit tests/Unit/Services/TicketServiceTest.php- Update README.md if changing user-facing features
- Add docs for new endpoints in docs/API.md
- Update CHANGELOG.md with your changes
- Add code comments for complex logic
Use clear, descriptive commit messages:
- Good: "Add ticket assignment feature"
- Good: "Fix validation error in user creation"
- Bad: "fix stuff"
- Bad: "wip"
- All PRs require at least one review
- CI/CD tests must pass
- Code review focuses on:
- Code quality and style
- Test coverage
- Documentation
- Performance
- Security
By contributing, you agree that your contributions will be licensed under the MIT License.
Feel free to open an issue or discussion for any questions about contributing.
Thank you for helping make HelpDesk API better!