- Initialize Git repository with main branch - Create .gitignore for web application (Node.js) - Setup docs/ directory for project documentation - Add README.md with project overview and setup instructions - Add CONTRIBUTING.md with contribution guidelines - Add LICENSE with MIT license text - Configure pre-push hooks for code quality checks BREAKING CHANGE: Repository structure established for team collaboration
169 lines
4.4 KiB
Markdown
169 lines
4.4 KiB
Markdown
# Contributing to newzy
|
|
|
|
First off, thank you for considering contributing to newzy! It's people like you that make newzy such a great tool.
|
|
|
|
## Table of Contents
|
|
|
|
- [Code of Conduct](#code-of-conduct)
|
|
- [How Can I Contribute?](#how-can-i-contribute)
|
|
- [Reporting Bugs](#reporting-bugs)
|
|
- [Suggesting Enhancements](#suggesting-enhancements)
|
|
- [Pull Requests](#pull-requests)
|
|
- [Development Setup](#development-setup)
|
|
- [Coding Standards](#coding-standards)
|
|
- [Git Workflow](#git-workflow)
|
|
- [Style Guides](#style-guides)
|
|
|
|
## Code of Conduct
|
|
|
|
This project and everyone participating in it is expected to abide by the following code of conduct:
|
|
|
|
- Be respectful and considerate
|
|
- Focus on what is best for the community
|
|
- Accept constructive criticism gracefully
|
|
|
|
Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.
|
|
|
|
## How Can I Contribute?
|
|
|
|
### Reporting Bugs
|
|
|
|
Before creating bug reports, please check existing issues to avoid duplicates. When you are creating a bug report, please include as many details as possible:
|
|
|
|
- **Use a clear and descriptive title**
|
|
- **Describe the exact steps to reproduce** the bug
|
|
- **Provide specific examples** to demonstrate the steps (include links to files or projects that demonstrate the issue)
|
|
- **Describe the behavior you observed** after following the steps
|
|
- **Describe the behavior you expected** after following the steps
|
|
|
|
### Suggesting Enhancements
|
|
|
|
Enhancement suggestions are tracked as GitHub issues. Create an issue and clearly describe:
|
|
|
|
1. **Is your feature request related to a problem? Please describe it.**
|
|
2. **Describe the solution you'd like**
|
|
3. **Describe alternatives you've considered**
|
|
4. **Provide additional context** (e.g., motivation for this feature)
|
|
|
|
### Pull Requests
|
|
|
|
1. Fork the repo and create your branch from `develop`.
|
|
2. If you've added code that should be tested, add tests.
|
|
3. Ensure the test suite passes.
|
|
4. Update documentation if needed.
|
|
5. Make sure your code lints.
|
|
6. Issue that pull request!
|
|
|
|
**Pull Request Guidelines**: Use one of the following prefixes to categorize your PR:
|
|
|
|
- `feat:` - A new feature
|
|
- `fix:` - A bug fix
|
|
- `docs:` - Documentation changes
|
|
- `style:` - Formatting, missing semicolons, etc; no code change
|
|
- `refactor:` - Code change that neither fixes a bug nor adds a feature
|
|
- `perf:` - A code change that improves performance
|
|
- `test:` - Adding missing tests
|
|
- `chore:` - Changes to the build process or auxiliary tools
|
|
|
|
## Development Setup
|
|
|
|
### Requirements
|
|
|
|
- Node.js (v18+)
|
|
- npm or yarn
|
|
|
|
### Installation
|
|
|
|
```bash
|
|
git clone https://github.com/daniel/newzy.git
|
|
cd newzy
|
|
npm install
|
|
cp .env.example .env
|
|
# Edit .env with your configuration
|
|
npm run dev
|
|
```
|
|
|
|
## Coding Standards
|
|
|
|
We use modern JavaScript (ES6+). Follow these guidelines:
|
|
|
|
- Use consistent indentation (2 spaces)
|
|
- Single quotes instead of double quotes (unless using template literals)
|
|
- Semicolons at the end of each statement
|
|
- No trailing whitespace
|
|
- One function per file when possible
|
|
- Meaningful variable and function names
|
|
|
|
Example:
|
|
|
|
```javascript
|
|
// Good
|
|
const users = getUserData();
|
|
if (users.length > 0) {
|
|
return users[0];
|
|
}
|
|
|
|
// Bad
|
|
const user = get_data();
|
|
if(user.length > 0){
|
|
return user[0]
|
|
}
|
|
```
|
|
|
|
## Git Workflow
|
|
|
|
### Branching Strategy
|
|
|
|
We follow a GitFlow-inspired workflow:
|
|
|
|
- `main` - Production-ready code
|
|
- `develop` - Integration branch for feature development
|
|
- `feature/*` - New features and enhancements (branch from develop)
|
|
- `bugfix/*` - Bug fixes from develop
|
|
- `hotfix/*` - Critical fixes from main
|
|
|
|
### Making a Commit
|
|
|
|
When making commits, use the following format:
|
|
|
|
```
|
|
<type>(<scope>): <subject>
|
|
|
|
<body>
|
|
|
|
<footer>
|
|
```
|
|
|
|
**Types**:
|
|
- `feat:` - A new feature
|
|
- `fix:` - A bug fix
|
|
- `docs:` - Documentation changes
|
|
- `style:` - Formatting changes
|
|
- `refactor:` - Code refactoring
|
|
- `perf:` - Performance improvements
|
|
- `test:` - Test additions/changes
|
|
- `chore:` - Maintenance tasks
|
|
|
|
**Examples**:
|
|
```
|
|
feat(auth): add OAuth2 authentication flow
|
|
|
|
Implement OAuth2 login with Google, GitHub, and Microsoft providers.
|
|
Added user session management with refresh token support.
|
|
|
|
Closes #123
|
|
```
|
|
|
|
### Pre-Push Hooks
|
|
|
|
Pre-push hooks are configured to run linting and tests before pushing to the remote repository.
|
|
|
|
## Style Guides
|
|
|
|
- Follow [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)
|
|
- Use ESLint for code linting
|
|
- Follow Prettier formatting rules
|
|
|
|
---
|
|
|
|
Thank you for contributing to newzy! 🎉 |