Contributing Guidelines¶
Thank you for your interest in contributing to this portfolio and blog application! This guide will help you understand our development process and how to submit contributions effectively.
Code of Conduct¶
- Be respectful and inclusive
- Provide constructive feedback
- Focus on the code, not the person
- Help create a welcoming environment
Getting Started¶
- Fork the Repository: Create your own fork of the project
- Clone Your Fork:
git clone https://github.com/YOUR_USERNAME/portfolio.git - Create a Branch:
git checkout -b feature/your-feature-name - Set Up Development: Follow the Getting Started Guide
Development Workflow¶
1. Before Making Changes¶
- Ensure you're on the latest main branch
- Run tests to verify everything works:
pnpm test - Run linting to check code quality:
pnpm lint
2. Making Changes¶
Follow these principles:
- Make minimal changes: Only modify what's necessary
- Write clean code: Follow existing patterns and conventions
- Add tests: For new features or bug fixes
- Update documentation: If changing APIs or behavior
3. Code Standards¶
TypeScript¶
- Use TypeScript for all new code
- Avoid
anytypes - use proper type definitions - Use path aliases (
@/) instead of relative imports - Add JSDoc comments for complex functions
React Components¶
- Use functional components
- Mark client components with
"use client"directive - Use Server Components by default
- Follow the single responsibility principle
"use client";
import { useState } from "react";
export function MyComponent() {
const [state, setState] = useState(false);
return <div>{/* component content */}</div>;
}
API Development¶
- All business logic goes through tRPC
- Use Zod for input validation
- Follow RESTful naming conventions
- Add proper error handling
export const myRouter = createTRPCRouter({
getItem: publicProcedure
.input(z.object({ id: z.string() }))
.query(async ({ input }) => {
// Implementation
}),
});
4. Testing¶
Write tests for:
- New features
- Bug fixes
- Critical business logic
- Complex components
Run tests before committing:
5. Linting and Formatting¶
Before every commit:
6. Commit Messages¶
Use clear, descriptive commit messages:
# Good
git commit -m "Add user authentication to blog posts"
git commit -m "Fix pagination bug in post listing"
# Bad
git commit -m "updates"
git commit -m "fix bug"
Follow this format:
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting)refactor: Code refactoringtest: Adding or updating testschore: Build process or tool changes
7. Creating a Pull Request¶
- Push to Your Fork:
-
Open a Pull Request: Go to GitHub and create a PR from your branch
-
Fill Out the Template: Provide a clear description of your changes
-
Link Issues: Reference any related issues (
Fixes #123) -
Wait for Review: Maintainers will review your PR
Pull Request Guidelines¶
PR Checklist¶
- [ ] Code follows the project's style guidelines
- [ ] All tests pass (
pnpm test) - [ ] Linting passes (
pnpm lint) - [ ] Formatting is correct (
pnpm format) - [ ] Documentation is updated if needed
- [ ] Commit messages are clear and descriptive
- [ ] PR description explains the changes
- [ ] No unrelated changes are included
PR Description Template¶
## Description
Brief description of what this PR does
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Changes Made
- Bullet point list of changes
## Testing
How to test these changes
## Screenshots
If applicable, add screenshots
## Related Issues
Fixes #(issue number)
Review Process¶
What to Expect¶
- Initial Review: Usually within 1-3 days
- Feedback: Reviewers may request changes
- Iteration: Make requested changes and push updates
- Approval: Once approved, PR will be merged
Responding to Feedback¶
- Be open to suggestions
- Ask questions if feedback is unclear
- Make requested changes promptly
- Push updates to the same branch
Common Pitfalls¶
❌ Don't¶
- Use
npmoryarn(usepnpmonly) - Commit
node_modulesor build artifacts - Mix unrelated changes in one PR
- Ignore linting or test failures
- Remove or modify unrelated code
- Hand-edit database migration SQL files
✅ Do¶
- Use
pnpmfor all operations - Keep PRs focused and small
- Write descriptive commit messages
- Add tests for new features
- Update documentation
- Run all checks before pushing
Need Help?¶
- Check the Getting Started Guide
- Review the Architecture Documentation
- Search existing GitHub Issues
- Ask questions in your PR
Recognition¶
Contributors will be recognized in:
- GitHub Contributors page
- Project acknowledgments
- Release notes (for significant contributions)
Thank you for contributing to this project! 🎉