Contributing - BruGeth/Cinerama GitHub Wiki
This guide explains how to contribute correctly to the repository, including branches, commits, PRs, and code review.
- Git Workflow
- Commit Convention
- Steps to collaborate
- Pull Request structure
- Pull Request Review Process
- Development Guidelines
- Project Structure
- Bug Reports
- Feature Requests
- Getting Help
- Recognition
-
main
: stable code in production -
develop
: base branch for integrating new features -
release/*
: versions ready for production
Each developer should create branches using the appropriate prefix based on the type of work:
Branch Prefix | Primary Use | Example |
---|---|---|
feature/ |
New functionality | feature/seat-selection-ui |
bugfix/ |
Bug fixes during development | bugfix/login-failure |
hotfix/ |
Urgent fixes for production (main ) |
hotfix/fix-payment-crash |
chore/ |
Maintenance tasks, configuration or minor improvements | chore/add-eslint-config |
test/ |
Experimentation or temporary testing | test/load-testing-checkout |
docs/ |
Documentation changes or additions | docs/update-readme |
refactor/ |
Code reorganization or improvement without changing functionality | refactor/checkout-module |
feature/user-authentication
bugfix/payment-validation
hotfix/critical-security-patch
chore/update-dependencies
We use Conventional Commits convention:
<type>(component): brief message
-
feat
: new feature -
fix
: bug fix -
docs
: documentation -
style
: formatting (no logic changes) -
refactor
: code restructuring without behavior change -
test
: tests -
chore
: maintenance
feat(backend): add endpoint to create movies
fix(frontend): fix bug in signup form
docs: update README with deployment instructions
π€ Everything must be done in English: branch names, commits, PRs.
-
Clone the repository (if you haven't already)
git clone https://github.com/BruGeth/Cinerama.git cd cinerama
-
Update your local
develop
branchgit checkout develop git pull origin develop
-
Create a new branch with the appropriate prefix
# For new features git checkout -b feature/your-feature-name # For bug fixes git checkout -b bugfix/issue-description # For hotfixes (branch from main) git checkout main git checkout -b hotfix/critical-fix
-
Add your changes
git add .
-
Commit with correct convention
git commit -m "feat(component): add new feature"
-
Push to your branch
git push origin feature/your-feature-name
-
Create a Pull Request (PR) to
develop
(ormain
for hotfixes)
## π Description
Please include a summary of the change and the related issue.
Also mention any context or dependencies if relevant.
Closes: #<issue-number>
---
## β
Checklist
- [ ] Code compiles and runs correctly
- [ ] All existing and new tests pass
- [ ] Follows coding conventions/style
- [ ] No unnecessary console.logs or commented code
- [ ] Proper error handling implemented
- [ ] Responsive design (if applicable)
- [ ] Connected to backend (if required)
---
## π§ͺ How to Test
1. Go to `...`
2. Click on `...`
3. Observe `...`
Provide clear steps or test credentials if needed.
---
## π· Screenshots (if UI was changed)
| Before | After |
|--------|-------|
|  |  |
---
## π¬ Additional Notes
- Any concerns, future improvements, or technical debt to be aware of?
- Add @Brugeth as reviewer
- Wait for review and fix requested changes
- If PR is approved, it can be merged
- If there are serious errors, the PR will be closed
- Code follows project conventions
- All tests pass
- Documentation is updated
- No breaking changes without discussion
- Code is properly commented
- Follow consistent naming conventions
- Write meaningful comments (see Best Practices for Comments)
- Include unit tests for new features
- Keep functions small and focused
- Use descriptive variable names
Comments should explain the "why", not the "what". Code should be self-explanatory first.
Use JavaDoc for public APIs:
/**
* Processes movie booking and updates seat availability
* @param bookingRequest booking details including movie, seats, and user info
* @param paymentMethod selected payment method
* @return booking confirmation with transaction details
* @throws BookingException if booking fails due to seat unavailability
* @throws PaymentException if payment processing fails
*/
@Transactional
public BookingResult processMovieBooking(BookingRequest bookingRequest, PaymentMethod paymentMethod) {
// Implementation
}
Comment on complex business decisions:
// Apply 20% discount for students as per cinema policy CP-2024-15
// Valid only for movies before 6 PM on weekdays
if (isStudentDiscount(user) && isEligibleForStudentDiscount(showtime)) {
applyStudentDiscount(booking, 0.20);
}
Explain specific Spring configurations:
@Configuration
public class SecurityConfig {
// Disable CSRF for REST APIs since we use JWT tokens
// JWT tokens are stateless and don't require CSRF protection
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
return http
.csrf().disable()
.build();
}
}
Comment on complex hooks and effects:
useEffect(() => {
// Debounce movie search to avoid excessive API calls
// while user is typing in the search box
const timeoutId = setTimeout(() => {
if (searchQuery.length >= 3) {
searchMovies(searchQuery);
}
}, 300);
return () => clearTimeout(timeoutId);
}, [searchQuery]);
Explain complex conditional rendering logic:
const SeatSelector = ({ movie, showtime }) => {
// Show different seat colors based on availability and pricing
// Premium seats cost 50% more and are highlighted differently
const shouldShowPremiumSeats = movie.hasLuxurySeating &&
showtime.isPeakHour;
return (
<div>
{shouldShowPremiumSeats && <PremiumSeatLegend />}
{/* rest of component */}
</div>
);
};
Document complex props with JSDoc:
/**
* Movie booking summary component
* @param {Object} props
* @param {Array<Seat>} props.selectedSeats - Array of selected seat objects
* @param {Movie} props.movie - Movie details object
* @param {Showtime} props.showtime - Selected showtime information
* @param {Function} props.onBookingConfirm - Callback when booking is confirmed
*/
const BookingSummary = ({ selectedSeats, movie, showtime, onBookingConfirm }) => {
// Implementation
};
β Do not comment obvious code:
// BAD
int totalSeats = 0; // initialize total seats to 0
totalSeats++; // increment seat counter
// GOOD - code is self-explanatory
int availableSeats = 0;
availableSeats++;
β Do not leave commented-out code without explanation:
// BAD
// const oldPriceCalculation = basePrice * 0.8;
const finalPrice = calculateMovieTicketPrice(basePrice, discounts);
// BETTER - if you need to keep it
// Old calculation kept for reference until new pricing
// algorithm is validated in production (ticket #CIN-456)
// const oldPriceCalculation = basePrice * 0.8;
const finalPrice = calculateMovieTicketPrice(basePrice, discounts);
- Update README.md if you add new features
- Add JSDoc comments for new functions
- Update API documentation for new endpoints
- Include examples in code comments
- Comment on architectural decisions or complex business logic
- Explain non-trivial algorithms or calculations specific to the cinema domain
When reporting bugs, please include:
- Clear description of the issue
- Steps to reproduce the bug
- Expected behavior
- Actual behavior
- Screenshots if applicable
- Environment details (OS, browser, versions)
Bug reports and feature requests should be created as GitHub Issues.
When creating a new issue, you can select the appropriate template (bug report or feature request) directly from the GitHub "New Issue" page in the repository.
When suggesting new features:
- Check existing issues to avoid duplicates
- Describe the use case clearly
- Explain the benefits to users
- Provide examples if possible