Contributing Guide
Thank you for your interest in contributing to Bitrate!
๐ฏ Ways to Contributeโ
- ๐ Report Bugs - Submit detailed bug reports
- ๐ก Suggest Features - Propose new features or improvements
- ๐ Improve Documentation - Fix typos, add examples
- ๐ Submit Code - Fix bugs, implement features
- โญ Spread the Word - Star the repo, share with others
๐ Getting Startedโ
1. Fork the Repositoryโ
Click the "Fork" button on GitHub to create your own copy.
2. Clone Your Forkโ
git clone https://github.com/YOUR_USERNAME/bitrate.git
cd bitrate
3. Add Upstream Remoteโ
git remote add upstream https://github.com/Lordpluha/bitrate.git
4. Create a Branchโ
git checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-description
๐ Commit Guidelinesโ
We follow Conventional Commits:
# Format
<type>(<scope>): <subject>
# Examples
feat(api): add track upload endpoint
fix(web): resolve player sync issue
docs(readme): update installation steps
chore(deps): update dependencies
Typesโ
feat- New featurefix- Bug fixdocs- Documentation changesstyle- Code style (formatting, no logic change)refactor- Code refactoringperf- Performance improvementstest- Adding testschore- Maintenance tasksci- CI/CD changes
Scopesโ
api- Backend APIweb- Web applicationmobile- Mobile applicationdesktop- Desktop applicationpackages- Shared packagesinfra- Infrastructure
๐ Development Workflowโ
1. Keep Your Fork Updatedโ
git fetch upstream
git checkout develop
git merge upstream/develop
2. Make Your Changesโ
# Create feature branch
git checkout -b feature/new-feature
# Make changes
# ...
# Run tests
pnpm test
# Run linter
pnpm lint
# Format code
pnpm format
3. Commit Your Changesโ
git add .
git commit -m "feat(api): add new feature"
4. Push to Your Forkโ
git push origin feature/new-feature
5. Create Pull Requestโ
- Go to your fork on GitHub
- Click "New Pull Request"
- Select your branch
- Fill in the PR template
- Submit!
โ Pull Request Checklistโ
Before submitting:
- Code follows project style
- Tests pass (
pnpm test) - Linter passes (
pnpm lint) - Documentation updated
- Commit messages follow convention
- PR description is clear
- Branch is up-to-date with
develop
๐งช Testingโ
Run Testsโ
# All tests
pnpm test
# Specific app
pnpm --filter @bitrate/api test
# Watch mode
pnpm test:watch
# Coverage
pnpm test:cov
Writing Testsโ
// Example: track.service.spec.ts
describe('TracksService', () => {
it('should create a track', async () => {
const dto = { title: 'Test Track', artistId: 'uuid' }
const result = await service.create(dto)
expect(result).toBeDefined()
expect(result.title).toBe('Test Track')
})
})
๐ Code Styleโ
TypeScriptโ
// โ
Good
export interface CreateTrackDto {
title: string
artistId: string
albumId?: string
}
export async function createTrack(dto: CreateTrackDto): Promise<Track> {
const track = await prisma.track.create({ data: dto })
return track
}
// โ Bad
export async function createTrack(dto: any) {
return await prisma.track.create({ data: dto })
}
React Componentsโ
// โ
Good
interface ButtonProps {
variant: 'primary' | 'secondary'
onClick: () => void
children: React.ReactNode
}
export const Button: React.FC<ButtonProps> = ({
variant,
onClick,
children
}) => {
return (
<button
className={`btn btn-${variant}`}
onClick={onClick}
>
{children}
</button>
)
}
// โ Bad
export const Button = (props: any) => {
return <button {...props} />
}
File Namingโ
- Components:
PascalCase.tsx - Services:
kebab-case.service.ts - Utilities:
kebab-case.ts - Tests:
*.spec.tsor*.test.ts
๐ Bug Reportsโ
Use the bug report template:
Required Information:
- Description of the bug
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment (OS, Node version, etc.)
- Screenshots (if applicable)
๐ก Feature Requestsโ
Use the feature request template:
Required Information:
- Problem description
- Proposed solution
- Alternatives considered
- Use cases
๐ Documentationโ
Updating Docsโ
cd apps/docs
# Start dev server
pnpm start
# Make changes to markdown files
# ...
# Build to verify
pnpm build
Documentation Styleโ
- Use clear, concise language
- Include code examples
- Add screenshots when helpful
- Keep formatting consistent
๐ Securityโ
Do not open public issues for security vulnerabilities.
Instead, email: security@example.com
โ๏ธ Licenseโ
By contributing, you agree that your contributions will be licensed under the project's license.
๐ Thank You!โ
Every contribution, no matter how small, is valued and appreciated!
Questions? Open a discussion or join our community.