Contributing Guide - chintan992/letsstream2 GitHub Wiki
Thank you for your interest in contributing to Let's Stream V2.0! This guide will help you get started with contributing to the project.
- Code of Conduct
- Getting Started
- Development Workflow
- Pull Request Process
- Style Guide
- Testing
- Documentation
We are committed to providing a welcoming and inclusive experience for everyone. Please follow these guidelines:
- Use welcoming and inclusive language
- Be respectful of differing viewpoints
- Accept constructive criticism gracefully
- Focus on what is best for the community
- Show empathy towards other community members
-
Fork the Repository
- Click the "Fork" button on GitHub
- Clone your fork locally:
git clone https://github.com/chintan992/letsstream2.git cd lets-stream-v2.0
-
Set Up Development Environment
- Install dependencies:
npm install
- Set up environment variables:
cp .example.env .env
- Fill in the required environment variables
- Install dependencies:
-
Create a Branch
- For features:
feature/description
- For fixes:
fix/description
- For docs:
docs/description
git checkout -b feature/your-feature-name
- For features:
-
Run Development Server
npm run dev
-
Code Style
- Follow the TypeScript style guide
- Use ESLint and Prettier configurations
- Run linting before committing:
npm run lint
-
Commit Messages Follow the conventional commits specification:
- feat: A new feature
- fix: A bug fix
- docs: Documentation changes
- style: Code style changes
- refactor: Code refactoring
- test: Adding or updating tests
- chore: Maintenance tasks
Example:
git commit -m "feat: add dark mode support"
-
Before Submitting
- Update documentation
- Add/update tests
- Run all tests locally
- Ensure CI/CD pipeline passes
- Update changelog if applicable
-
PR Description
- Clear description of changes
- Link to related issues
- Screenshots/GIFs for UI changes
- List of testing steps
-
Review Process
- Address review comments
- Keep commits atomic
- Rebase if needed
- Squash commits when ready
// Use interfaces for objects
interface User {
id: string;
name: string;
email: string;
}
// Use type for unions/intersections
type MediaType = 'movie' | 'tv' | 'sport';
// Use functional components
const MyComponent: React.FC<Props> = ({ prop1, prop2 }) => {
// ...
};
// Use hooks for state/effects
const [state, setState] = useState<string>('');
useEffect(() => {
// Side effects here
}, [dependencies]);
// 1. Imports
import { useState, useEffect } from 'react';
import { useAuth } from '@/hooks';
// 2. Types/Interfaces
interface Props {
// ...
}
// 3. Component
const ComponentName: React.FC<Props> = ({ prop1, prop2 }) => {
// 3.1 Hooks
const [state, setState] = useState();
// 3.2 Effects
useEffect(() => {
// ...
}, []);
// 3.3 Handlers
const handleClick = () => {
// ...
};
// 3.4 Render
return (
// JSX
);
};
// 4. Export
export default ComponentName;
-
Unit Tests
- Test individual components
- Test hooks and utilities
- Mock external dependencies
-
Integration Tests
- Test component interactions
- Test data flow
- Test routing
-
End-to-End Tests
- Test critical user flows
- Test authentication
- Test media playback
-
Code Documentation
- Document complex functions
- Add JSDoc comments
- Include usage examples
-
Component Documentation
- Document props
- Add usage examples
- Include edge cases
-
Wiki Updates
- Update relevant wiki pages
- Add new features documentation
- Keep guides up to date