Thank you for your interest in contributing to Bando-Fi AI! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Workflow
- Building and Testing
- Pull Request Process
- Coding Standards
- Commit Messages
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Help maintain a positive environment
-
Fork the repository
# Click the "Fork" button on GitHub -
Clone your fork
git clone https://github.com/YOUR_USERNAME/Bando-Fi-AI.git cd Bando-Fi-AI -
Add upstream remote
git remote add upstream https://github.com/MASSIVEMAGNETICS/Bando-Fi-AI.git
-
Install dependencies
npm install --legacy-peer-deps
-
Create a branch
git checkout -b feature/your-feature-name
npm run devAccess at http://localhost:3000. Changes auto-reload.
npm run electron:devBoth Vite and Electron will run with hot reload.
# Android
npm run cap:sync:android
npm run cap:open:android
# iOS
npm run cap:sync:ios
npm run cap:open:ios# Web
npm run build:web
# Windows
npm run dist:win
# Android
npm run build:android
# iOS
npm run build:ios# Add tests as appropriate
npm test-
Update your branch
git fetch upstream git rebase upstream/main
-
Make your changes
- Write clean, documented code
- Follow existing code style
- Add tests if applicable
- Update documentation
-
Test your changes
- Build on all platforms you've modified
- Test functionality thoroughly
- Check for console errors
- Verify responsive design (if UI changes)
-
Commit your changes
git add . git commit -m "feat: add amazing feature"
-
Push to your fork
git push origin feature/your-feature-name
-
Create Pull Request
- Go to GitHub and create PR
- Fill out the PR template
- Link related issues
- Request review
-
Address feedback
- Respond to review comments
- Make requested changes
- Push updates to same branch
- Use TypeScript for type safety
- Follow existing code patterns
- Use meaningful variable names
- Add JSDoc comments for complex functions
- Avoid
anytypes when possible
// Good
interface GenerateOptions {
prompt: string;
resolution: 'low' | 'standard' | 'high';
}
function generate(options: GenerateOptions): Promise<Result> {
// Implementation
}
// Avoid
function generate(options: any): any {
// Implementation
}- Use functional components
- Implement proper prop types
- Follow hooks rules
- Keep components focused and single-purpose
interface ButtonProps {
label: string;
onClick: () => void;
disabled?: boolean;
}
export function Button({ label, onClick, disabled = false }: ButtonProps) {
return (
<button onClick={onClick} disabled={disabled}>
{label}
</button>
);
}src/
├── components/ # React components
├── models/ # AI models
├── utils/ # Utility functions
├── types/ # TypeScript types
└── styles/ # CSS/styling
- Use CSS custom properties (variables)
- Follow existing color scheme
- Maintain responsive design
- Support dark mode (already implemented)
Follow Conventional Commits:
type(scope): subject
body (optional)
footer (optional)
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting)refactor: Code refactoringperf: Performance improvementstest: Adding testschore: Maintenance tasksci: CI/CD changesbuild: Build system changes
# Feature
git commit -m "feat(ui): add image preview component"
# Bug fix
git commit -m "fix(electron): resolve window creation issue on Linux"
# Documentation
git commit -m "docs(readme): update build instructions"
# Breaking change
git commit -m "feat(api)!: change response format
BREAKING CHANGE: API responses now include metadata object"- Test on Windows, macOS, and Linux if possible
- Use IPC for renderer-main communication
- Follow security best practices
- Keep main process minimal
- Test on real devices when possible
- Follow platform guidelines (Material Design, Human Interface)
- Handle permissions properly
- Consider offline functionality
- Ensure offline functionality works
- Test service worker updates
- Validate manifest.json
- Check responsive design on multiple devices
Update documentation when:
- Adding new features
- Changing APIs
- Modifying build process
- Updating dependencies
- Changing configuration
Files to update:
- README.md - General information
- BUILD.md - Build instructions
- DEPLOYMENT.md - Deployment procedures
- CHANGELOG.md - Version changes
- Code comments - Complex logic
- Open an issue for bugs
- Use discussions for questions
- Tag maintainers for urgent issues
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to Bando-Fi AI! 🚀