Thank you for your interest in contributing to Station! This document provides guidelines and instructions for contributing.
- PHP 8.3+ (8.4 recommended)
- Laravel 11.x or 12.x
- Docker (for development environment)
- Node.js 18+ (for dashboard assets)
git clone https://github.com/ojbaeza/station.git
cd station
composer install
npm install# Start all services
docker compose up -d
# Start with debug tools (Kafka UI, Beanstalkd Console)
docker compose --profile debug up -dSee docker/README.md for full Docker environment documentation including service details and debug tools.
# Run tests to verify everything works
docker exec station_php bash -c "XDEBUG_MODE=off php artisan test"Station follows PER-CS 3.0 coding standards.
composer cs-checkcomposer cs-fixNote: Do not use Laravel Pint. Use composer cs-fix (PHP-CS-Fixer) instead. See .php-cs-fixer.php for the full configuration.
Station uses PHPStan at level 8 with Larastan for Laravel-specific rules.
docker exec station_php bash -c "./vendor/bin/phpstan analyse"- 95% minimum code coverage is required
- All new features must include tests
- All bug fixes must include regression tests
# All tests
docker exec station_php bash -c "XDEBUG_MODE=off php artisan test"
# With coverage report
docker exec station_php bash -c "XDEBUG_MODE=coverage php artisan test --coverage"
# Specific test
docker exec station_php bash -c "XDEBUG_MODE=off php artisan test --filter TestClassName"
# Driver-specific tests
docker exec station_php bash -c "XDEBUG_MODE=off php artisan test --filter RabbitMQ"Use camelCase pattern: test{Feature}{Scenario}{ExpectedResult}
public function testDispatchWithValidJobReturnsJobId(): void
public function testRecoveryWithStuckJobResumesSuccessfully(): void
public function testApiAuthenticationWithExpiredTokenReturns401(): void- Feature tests: Extend Laravel's
TestCase, useDatabaseTransactionstrait - Unit tests: Extend PHPUnit's
TestCase, use SUT pattern - Security tests: Include XSS, SQL injection, CSRF, rate limiting coverage
- Data providers: Use descriptive dataset keys
-
Create a feature branch from
maingit checkout -b feature/my-feature
-
Write tests for your changes
-
Ensure all checks pass:
composer cs-fix docker exec station_php bash -c "./vendor/bin/phpstan analyse" docker exec station_php bash -c "XDEBUG_MODE=off php artisan test"
-
Update documentation if your changes affect public APIs
- Push your branch to your fork
- Open a Pull Request against
main - Fill out the PR template completely
- Wait for CI checks to pass
- Request review from maintainers
- Keep PRs focused and reasonably sized
- One feature or fix per PR
- Write clear commit messages
- Reference related issues (e.g., "Fixes #123")
- Update CHANGELOG.md for user-facing changes
Follow conventional commit format:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Code style (formatting, no logic change)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(driver): add Kafka consumer group support
fix(recovery): handle checkpoint corruption gracefully
docs(readme): add troubleshooting section
src/
├── Commands/ # Artisan commands
├── Contracts/ # Interfaces
├── Core/ # JobManager, WorkerSupervisor, etc.
├── Drivers/ # Queue driver implementations
├── Facades/ # Laravel facades
├── Middleware/ # Job middleware
├── Recovery/ # Stuck job detection, checkpointing
├── Dashboard/ # Controllers, Pages, API
└── Testing/ # Test utilities
- Dependency Injection: Use Laravel's service container
- Interface-First: Define contracts before implementations
- Driver Abstraction: All drivers implement
DriverInterface - Best-Effort Compatibility: Features may vary by driver capability
- Create driver class in
src/Drivers/ - Implement
Station\Contracts\DriverInterface - Register in
StationServiceProvider - Add configuration schema
- Write comprehensive tests
- Update Feature Matrix documentation
- Questions: Open a GitHub Discussion
- Bug Reports: Open a GitHub Issue with reproduction steps
- Feature Requests: Open a GitHub Issue with use case description
This project follows our Code of Conduct. By participating, you agree to uphold this code.
In short: Be respectful, inclusive, and constructive. We're building something together.
By contributing, you agree that your contributions will be licensed under the MIT License.