Thank you for your interest in contributing to NextSaaS! This document outlines the process for contributing to this project and helps you get started.
Before you begin contributing, ensure you have:
- Node.js 18+ installed
- npm 10.9.2+ installed
- Git installed and configured
- A GitHub account
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/next-saas.git cd next-saas -
Add the upstream remote:
git remote add upstream https://github.com/abhaytalreja/next-saas.git
-
Install dependencies:
npm install
-
Create a new branch for your changes:
git checkout -b feature/your-feature-name
-
Start the development server:
npm run dev
We use automated tools to maintain code quality:
- ESLint - For code linting
- Prettier - For code formatting
- TypeScript - For type checking
- Husky - For pre-commit hooks
All code must pass these checks before being merged.
We follow the Conventional Commits specification:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(ui): add new Button component
fix(auth): resolve login redirect issue
docs(readme): update installation instructions
Use descriptive branch names:
feat/feature-name- For new featuresfix/bug-description- For bug fixesdocs/documentation-update- For documentationrefactor/component-name- For refactoring
- Write tests for new features and bug fixes
- Ensure all tests pass before submitting a PR
- Maintain or improve test coverage
# Run all tests
npm run test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage-
Sync with upstream:
git fetch upstream git checkout main git merge upstream/main
-
Rebase your branch:
git checkout feature/your-feature-name git rebase main
-
Run quality checks:
npm run lint npm run type-check npm run test npm run build
-
Push your branch:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub with:
- Clear title and description
- Reference related issues
- Screenshots for UI changes
- Testing instructions
## Description
Brief description of the changes made.
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Related Issues
Closes #(issue number)
## Testing
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed
## Screenshots (if applicable)
Add screenshots for UI changes.
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Code is commented where needed
- [ ] Tests added/updated
- [ ] Documentation updatedWhen reporting bugs, please include:
- Clear title describing the issue
- Steps to reproduce the problem
- Expected behavior vs actual behavior
- Environment details (OS, Node.js version, browser)
- Screenshots if applicable
- Error messages and stack traces
For feature requests, please provide:
- Clear description of the feature
- Use case and motivation
- Acceptance criteria
- Implementation suggestions (if any)
Understanding the project structure helps with contributions:
next-saas/
├── apps/
│ ├── web/ # Main SaaS application
│ ├── docs/ # Documentation site
│ └── landing/ # Marketing landing page
├── packages/
│ ├── ui/ # Shared UI components
│ ├── auth/ # Authentication utilities
│ ├── database/ # Database client and schemas
│ ├── config/ # Shared configurations
│ ├── types/ # Shared TypeScript types
│ └── utils/ # Shared utility functions
├── .github/ # GitHub Actions workflows
├── .husky/ # Git hooks
└── scripts/ # Build and development scripts
- Adding dependencies: Use workspace-specific commands
- Shared components: Add to
packages/ui - Utilities: Add to
packages/utils - Types: Add to
packages/types
- Test across all apps when making package changes
- Use
npm run devto test all apps simultaneously - Check console for TypeScript errors
- Use Turborepo's caching effectively
- Avoid unnecessary re-renders in React components
- Optimize bundle sizes
We pledge to make participation in our project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to a positive environment:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. All complaints will be reviewed and investigated promptly and fairly.
If you need help with development:
- Check existing issues and discussions
- Read the documentation thoroughly
- Ask questions in GitHub Discussions
- Join our community for real-time help
Contributors are recognized in several ways:
- Listed in the project's contributors
- Mentioned in release notes for significant contributions
- Invited to join the core team for consistent valuable contributions
By contributing to NextSaaS, you agree that your contributions will be licensed under the same MIT License that covers the project.
Thank you for contributing to NextSaaS! Your efforts help make this project better for everyone. 🚀