|
| 1 | +# Contributing to BitChat |
| 2 | + |
| 3 | +Thank you for your interest in contributing to BitChat! This guide will help you get started with contributing to our decentralized, privacy-focused messaging application. |
| 4 | + |
| 5 | +## 🎯 What is BitChat? |
| 6 | + |
| 7 | +BitChat is a decentralized peer-to-peer messaging app with dual transport architecture: |
| 8 | +- **Bluetooth Mesh Network**: Local offline communication |
| 9 | +- **Nostr Protocol**: Global internet-based messaging |
| 10 | +- **Noise Protocol**: End-to-end encryption |
| 11 | +- **Location-Based Channels**: Geographic chat rooms |
| 12 | + |
| 13 | +## 🚀 Getting Started |
| 14 | + |
| 15 | +### Prerequisites |
| 16 | + |
| 17 | +- **macOS**: For iOS/macOS development |
| 18 | +- **Xcode**: Latest version from App Store |
| 19 | +- **Homebrew**: For installing development tools |
| 20 | +- **Git**: Version control |
| 21 | + |
| 22 | +### Setup Development Environment |
| 23 | + |
| 24 | +1. **Fork and Clone** |
| 25 | + ```bash |
| 26 | + git clone https://github.com/yourusername/Freechat.git |
| 27 | + cd Freechat |
| 28 | + ``` |
| 29 | + |
| 30 | +2. **Install Tools** |
| 31 | + ```bash |
| 32 | + brew install xcodegen just |
| 33 | + ``` |
| 34 | + |
| 35 | +3. **Generate Xcode Project** |
| 36 | + ```bash |
| 37 | + xcodegen generate |
| 38 | + open bitchat.xcodeproj |
| 39 | + ``` |
| 40 | + |
| 41 | +4. **Alternative Setup with Just** |
| 42 | + ```bash |
| 43 | + just run # Sets up and runs from source |
| 44 | + just clean # Restores original state |
| 45 | + ``` |
| 46 | + |
| 47 | +## 🔧 Areas to Contribute |
| 48 | + |
| 49 | +### 🟢 Beginner-Friendly |
| 50 | + |
| 51 | +- **Documentation**: Improve README, add tutorials, create user guides |
| 52 | +- **UI/UX**: Polish SwiftUI interfaces, improve accessibility |
| 53 | +- **Testing**: Write unit tests, improve test coverage |
| 54 | +- **Localization**: Add support for multiple languages |
| 55 | +- **Error Handling**: Better user-friendly error messages |
| 56 | + |
| 57 | +### 🟡 Intermediate |
| 58 | + |
| 59 | +- **New Features**: Implement privacy enhancements, add new message types |
| 60 | +- **Performance**: Optimize Bluetooth mesh networking, improve battery life |
| 61 | +- **Security**: Audit encryption implementation, add security features |
| 62 | +- **Platform Support**: Help port to Android, web, or other platforms |
| 63 | + |
| 64 | +### 🔴 Advanced |
| 65 | + |
| 66 | +- **Protocol Extensions**: Add new transport protocols, enhance mesh routing |
| 67 | +- **Cryptography**: Implement post-quantum algorithms, improve Noise protocol |
| 68 | +- **Architecture**: Refactor core components, improve modularity |
| 69 | +- **Cross-Platform**: Create unified codebase for multiple platforms |
| 70 | + |
| 71 | +## 🎯 Current Priority Areas |
| 72 | + |
| 73 | +Based on our privacy assessment, these areas need immediate attention: |
| 74 | + |
| 75 | +1. **Add optional coalesced READ behavior** for large backlogs |
| 76 | +2. **Implement "low-visibility mode"** to reduce scanning aggressiveness |
| 77 | +3. **User-configurable Nostr relay set** with "private relays only" toggle |
| 78 | +4. **Enhanced logging controls** for different privacy levels |
| 79 | + |
| 80 | +## 📝 Contribution Guidelines |
| 81 | + |
| 82 | +### Code Style |
| 83 | + |
| 84 | +- Follow existing Swift/SwiftUI patterns |
| 85 | +- Use meaningful variable and function names |
| 86 | +- Add comments for complex logic |
| 87 | +- Follow Swift API Design Guidelines |
| 88 | + |
| 89 | +### Testing |
| 90 | + |
| 91 | +- Write tests for new features |
| 92 | +- Ensure existing tests pass |
| 93 | +- Test on both iOS and macOS |
| 94 | +- Consider edge cases and error conditions |
| 95 | + |
| 96 | +### Documentation |
| 97 | + |
| 98 | +- Update relevant documentation |
| 99 | +- Add inline code comments |
| 100 | +- Update README if adding new features |
| 101 | +- Document API changes |
| 102 | + |
| 103 | +### Privacy First |
| 104 | + |
| 105 | +- Always consider privacy implications |
| 106 | +- Minimize metadata exposure |
| 107 | +- Follow the principle of least privilege |
| 108 | +- Test privacy features thoroughly |
| 109 | + |
| 110 | +## 🔍 Finding Issues to Work On |
| 111 | + |
| 112 | +1. **Check the Codebase**: Look for `TODO`, `FIXME`, or `HACK` comments |
| 113 | +2. **Review Privacy Assessment**: Address recommendations in `docs/privacy-assessment.md` |
| 114 | +3. **Test the App**: Use it and identify bugs or missing features |
| 115 | +4. **Security Review**: Audit the Noise protocol implementation |
| 116 | + |
| 117 | +## 📋 Pull Request Process |
| 118 | + |
| 119 | +1. **Fork the Repository**: Create your own fork |
| 120 | +2. **Create a Branch**: Use descriptive branch names |
| 121 | + ```bash |
| 122 | + git checkout -b feature/your-feature-name |
| 123 | + ``` |
| 124 | +3. **Make Changes**: Implement your feature or fix |
| 125 | +4. **Test Thoroughly**: Ensure everything works on both platforms |
| 126 | +5. **Commit Changes**: Use clear, descriptive commit messages |
| 127 | + ```bash |
| 128 | + git commit -m "feat: add low-visibility mode for privacy" |
| 129 | + ``` |
| 130 | +6. **Push and Create PR**: Submit your pull request |
| 131 | +7. **Code Review**: Address feedback and iterate |
| 132 | + |
| 133 | +### Commit Message Format |
| 134 | + |
| 135 | +We use conventional commit format: |
| 136 | +- `feat:` New features |
| 137 | +- `fix:` Bug fixes |
| 138 | +- `docs:` Documentation changes |
| 139 | +- `style:` Code style changes |
| 140 | +- `refactor:` Code refactoring |
| 141 | +- `test:` Adding or updating tests |
| 142 | +- `chore:` Maintenance tasks |
| 143 | + |
| 144 | +## 🧪 Testing Your Changes |
| 145 | + |
| 146 | +### Unit Tests |
| 147 | +```bash |
| 148 | +# Run all tests |
| 149 | +xcodebuild test -project bitchat.xcodeproj -scheme "bitchat (iOS)" -destination 'platform=iOS Simulator,name=iPhone 15' |
| 150 | + |
| 151 | +# Run specific test target |
| 152 | +xcodebuild test -project bitchat.xcodeproj -scheme "bitchatTests" -destination 'platform=iOS Simulator,name=iPhone 15' |
| 153 | +``` |
| 154 | + |
| 155 | +### Manual Testing |
| 156 | +- Test on both iOS and macOS |
| 157 | +- Test Bluetooth mesh functionality |
| 158 | +- Test Nostr internet messaging |
| 159 | +- Test privacy features |
| 160 | +- Test error conditions |
| 161 | + |
| 162 | +## 🐛 Reporting Issues |
| 163 | + |
| 164 | +When reporting bugs, please include: |
| 165 | + |
| 166 | +- **Device**: iOS/macOS version, device model |
| 167 | +- **Steps**: Clear steps to reproduce |
| 168 | +- **Expected vs Actual**: What you expected vs what happened |
| 169 | +- **Logs**: Any relevant error messages or logs |
| 170 | +- **Privacy Impact**: If the issue affects privacy |
| 171 | + |
| 172 | +## 💡 Feature Requests |
| 173 | + |
| 174 | +For feature requests: |
| 175 | + |
| 176 | +- **Use Case**: Describe the problem you're solving |
| 177 | +- **Privacy Impact**: How does this affect user privacy? |
| 178 | +- **Implementation**: Any thoughts on how to implement? |
| 179 | +- **Alternatives**: Are there existing solutions? |
| 180 | + |
| 181 | +## 🤝 Getting Help |
| 182 | + |
| 183 | +- **GitHub Issues**: For bugs and feature requests |
| 184 | +- **Discussions**: For questions and ideas |
| 185 | +- **Code Review**: Ask questions in PR reviews |
| 186 | +- **Documentation**: Check existing docs first |
| 187 | + |
| 188 | +## 🏆 Recognition |
| 189 | + |
| 190 | +Contributors are recognized in: |
| 191 | +- Project README |
| 192 | +- Release notes |
| 193 | +- Contributor hall of fame |
| 194 | +- Special thanks in documentation |
| 195 | + |
| 196 | +## 📚 Learning Resources |
| 197 | + |
| 198 | +- **Swift Documentation**: [developer.apple.com/swift](https://developer.apple.com/swift/) |
| 199 | +- **SwiftUI Tutorials**: [developer.apple.com/tutorials/swiftui](https://developer.apple.com/tutorials/swiftui) |
| 200 | +- **Noise Protocol**: [noiseprotocol.org](http://www.noiseprotocol.org/) |
| 201 | +- **Nostr Protocol**: [github.com/nostr-protocol/nostr](https://github.com/nostr-protocol/nostr) |
| 202 | +- **Bluetooth LE**: [developer.apple.com/bluetooth](https://developer.apple.com/bluetooth/) |
| 203 | + |
| 204 | +## 🎉 Thank You! |
| 205 | + |
| 206 | +Thank you for contributing to BitChat! Your contributions help build tools for privacy, decentralization, and resilient communication. Whether you're fixing a small bug or implementing a major feature, every contribution makes a difference. |
| 207 | + |
| 208 | +--- |
| 209 | + |
| 210 | +**Remember**: BitChat is released into the public domain. By contributing, you're helping create tools that can work in protests, disasters, remote areas, and anywhere people need private, decentralized communication. |
| 211 | + |
| 212 | +Happy coding! 🚀 |
0 commit comments